#include <ConfigFileReader.h>
Configuration file manager.
Definition at line 9 of file ConfigFileReader.h.
|
std::deque< std::string > | m_directories |
| Stack of directories to search for a file.
|
|
std::deque< std::string > | m_files |
| Stack of file names to parse.
|
|
std::string | m_name |
| The name of this object.
|
|
std::unique_ptr< Logger > | m_log |
| Logger instance for this object
|
|
◆ ConfigFileReader()
iguana::ConfigFileReader::ConfigFileReader |
( |
std::string_view | name = "config" | ) |
|
- Parameters
-
name | the name of this configuration file handler |
◆ AddDirectory()
void iguana::ConfigFileReader::AddDirectory |
( |
std::string const & | dir | ) |
|
Add a directory to the configuration files' search paths.
- Parameters
-
dir | the directory, which may be relative or absolute |
◆ AddFile()
void iguana::ConfigFileReader::AddFile |
( |
std::string const & | name | ) |
|
Add a configuration file to be parsed
- Parameters
-
◆ ConvertAlgoNameToConfigName()
static std::string iguana::ConfigFileReader::ConvertAlgoNameToConfigName |
( |
std::string_view | algo_name, |
|
|
std::string_view | ext = "yaml" ) |
|
static |
Convert a full algorithm name to its corresponding default config file name
- Parameters
-
algo_name | the algorithm name |
ext | the file extension |
- Returns
- the config file name
◆ FindFile()
std::string iguana::ConfigFileReader::FindFile |
( |
std::string const & | name | ) |
|
Find a configuration file by name. You may either give just a file name, or specify the full path and filename. The following locations are searched, in order:
- current working directory
./
- directories included by
ConfigFileReader::AddDirectory
, starting from the most recently added directory
- the common installation prefix
- Parameters
-
name | the configuration file name (with or without a directory) |
- Returns
- the found configuration file (with the directory)
◆ GetConfigInstallationPrefix()
static std::string iguana::ConfigFileReader::GetConfigInstallationPrefix |
( |
| ) |
|
|
static |
Get the config files' fixed installation prefix
- Warning
- if the Iguana installation is relocated, this directory will not be correct, since it is compiled in the shared library; as a fallback, you may use the environment variable
$IGUANA_CONFIG_PATH
.
- Returns
- the absolute path to the installed configuration file directory
◆ PrintDirectories()
void iguana::ConfigFileReader::PrintDirectories |
( |
Logger::Level const | level = Logger::info | ) |
|
Print the list of directories (search path)
- Parameters
-
◆ m_directories
std::deque<std::string> iguana::ConfigFileReader::m_directories |
|
protected |
◆ m_files
std::deque<std::string> iguana::ConfigFileReader::m_files |
|
protected |
The documentation for this class was generated from the following file: