Elements  6.2
A C++ base framework for the Euclid Software.
Namespaces | Enumerations | Functions
Elements::Kernel Namespace Reference

Namespaces

 Auxiliary
 
 Configuration
 
 Path
 
 Units
 

Enumerations

enum  SearchType { SearchType::Local, SearchType::Recursive }
 

Functions

ELEMENTS_API std::string getAuxiliaryVariableName ()
 retrieve the variable name used for the auxiliary file lookup More...
 
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 More...
 
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. More...
 
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. More...
 
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. More...
 
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

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)

◆ 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)

◆ 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.

References Elements::Environment::hasKey(), Elements::Examples::log, pathSearch(), and Elements::Kernel::Path::split().

Here is the call graph for this function: