Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
Elements::Kernel Namespace Reference

Namespaces

namespace  Auxiliary
 
namespace  Configuration
 
namespace  Path
 
namespace  Units
 

Enumerations

enum class  SearchType { Local , Recursive }
 

Functions

ELEMENTS_API std::string getAuxiliaryVariableName ()
 retrieve the variable name used for the auxiliary file lookup
 
template<typename T >
ELEMENTS_API Path::Item getAuxiliaryPath (const T &file_name, bool raise_exception=true)
 
template ELEMENTS_API Path::Item getAuxiliaryPath (const Path::Item &file_name, bool raise_exception)
 
template ELEMENTS_API Path::Item getAuxiliaryPath (const std::string &file_name, bool raise_exception)
 
ELEMENTS_API std::vector< Path::ItemgetAuxiliaryLocations (bool exist_only=false)
 
ELEMENTS_API std::string getConfigurationVariableName ()
 retrieve the variable name used for the configuration file lookup
 
template<typename T >
ELEMENTS_API Path::Item getConfigurationPath (const T &file_name, bool raise_exception=true)
 
template ELEMENTS_API Path::Item getConfigurationPath (const Path::Item &file_name, bool raise_exception)
 
template ELEMENTS_API Path::Item getConfigurationPath (const std::string &file_name, bool raise_exception)
 
ELEMENTS_API std::vector< Path::ItemgetConfigurationLocations (bool exist_only=false)
 
template<typename T , typename... Args>
ELEMENTS_API std::unique_ptr< T > make_unique (Args &&... args)
 Constructs an object of type T and wraps it in a std::unique_ptr using args as the parameter list for the constructor of T.
 
template<typename T >
ELEMENTS_API std::vector< T > pathSearch (const std::string &searched_name, T directory, SearchType search_type)
 Searches for a file or a directory in a directory. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return.
 
template ELEMENTS_API std::vector< Path::ItempathSearch (const std::string &searched_name, Path::Item directory, SearchType search_type)
 
template ELEMENTS_API std::vector< std::stringpathSearch (const std::string &searched_name, std::string directory, SearchType search_type)
 
ELEMENTS_API std::vector< Path::ItempathSearchInEnvVariable (const std::string &file_name, const std::string &path_like_env_variable, SearchType search_type=SearchType::Recursive)
 Searches for a file or a directory in a path pointed by an environment variable. It can contains collection of colon separated locations. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return.
 
template vector< stringpathSearch< string, directory_iterator > (const string &searched_name, string directory)
 
template vector< Path::ItempathSearch< Path::Item, directory_iterator > (const string &searched_name, Path::Item directory)
 
template vector< stringpathSearch< string, recursive_directory_iterator > (const string &searched_name, string directory)
 
template vector< Path::ItempathSearch< Path::Item, recursive_directory_iterator > (const string &searched_name, Path::Item directory)
 

Enumeration Type Documentation

◆ SearchType

enum class Elements::Kernel::SearchType
strong
Enumerator
Local 
Recursive 

Definition at line 38 of file PathSearch.h.

Function Documentation

◆ getAuxiliaryLocations()

std::vector< Path::Item > Elements::Kernel::getAuxiliaryLocations ( bool  exist_only = false)

Definition at line 49 of file Auxiliary.cpp.

Referenced by Elements::Kernel::Auxiliary::getLocations().

◆ getAuxiliaryPath() [1/3]

template Path::Item Elements::Kernel::getAuxiliaryPath ( const Path::Item file_name,
bool  raise_exception 
)

◆ getAuxiliaryPath() [2/3]

template Path::Item Elements::Kernel::getAuxiliaryPath ( const std::string file_name,
bool  raise_exception 
)

◆ getAuxiliaryPath() [3/3]

template<typename T >
ELEMENTS_API Path::Item Elements::Kernel::getAuxiliaryPath ( const T &  file_name,
bool  raise_exception = true 
)

◆ getConfigurationLocations()

std::vector< Path::Item > Elements::Kernel::getConfigurationLocations ( bool  exist_only = false)

Definition at line 49 of file Configuration.cpp.

Referenced by Elements::Kernel::Configuration::getLocations().

◆ getConfigurationPath() [1/3]

template Path::Item Elements::Kernel::getConfigurationPath ( const Path::Item file_name,
bool  raise_exception 
)

◆ getConfigurationPath() [2/3]

template Path::Item Elements::Kernel::getConfigurationPath ( const std::string file_name,
bool  raise_exception 
)

◆ getConfigurationPath() [3/3]

template<typename T >
ELEMENTS_API Path::Item Elements::Kernel::getConfigurationPath ( const T &  file_name,
bool  raise_exception = true 
)

◆ make_unique()

template<typename T , typename... Args>
ELEMENTS_API std::unique_ptr< T > Elements::Kernel::make_unique ( Args &&...  args)

Constructs an object of type T and wraps it in a std::unique_ptr using args as the parameter list for the constructor of T.

Parameters
argslist of arguments with which the instance of T will be constructed
Returns
std::unique_ptr of the instance of type T

Definition at line 55 of file Memory.h.

◆ pathSearch() [1/2]

template vector< Path::Item > Elements::Kernel::pathSearch ( const std::string searched_name,
Path::Item  directory,
SearchType  search_type 
)

◆ pathSearch() [2/2]

template vector< string > Elements::Kernel::pathSearch ( const std::string searched_name,
std::string  directory,
SearchType  search_type 
)

◆ pathSearch< Path::Item, directory_iterator >()

template vector< Path::Item > Elements::Kernel::pathSearch< Path::Item, directory_iterator > ( const string searched_name,
Path::Item  directory 
)

◆ pathSearch< Path::Item, recursive_directory_iterator >()

template vector< Path::Item > Elements::Kernel::pathSearch< Path::Item, recursive_directory_iterator > ( const string searched_name,
Path::Item  directory 
)

◆ pathSearch< string, directory_iterator >()

template vector< string > Elements::Kernel::pathSearch< string, directory_iterator > ( const string searched_name,
string  directory 
)

◆ pathSearch< string, recursive_directory_iterator >()

template vector< string > Elements::Kernel::pathSearch< string, recursive_directory_iterator > ( const string searched_name,
string  directory 
)

◆ pathSearchInEnvVariable()

vector< Path::Item > Elements::Kernel::pathSearchInEnvVariable ( const std::string file_name,
const std::string path_like_env_variable,
SearchType  search_type = SearchType::Recursive 
)

Searches for a file or a directory in a path pointed by an environment variable. It can contains collection of colon separated locations. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return.

Parameters
file_nameName of the searched file or directory
path_like_env_variableThe environment variable name that contains the list of directories
search_typeTwo options: SearchType.Local search in directory only SearchType.Recursive search in sub-directories too
Returns
A vector of paths of the files found or empty string, if nothing is found

Iterate over the different directories included in the path-like environment variable, i.e.,

path1:path2:path3 ...

and call pathSearch(...) for each of them

Definition at line 68 of file PathSearch.cpp.