#include <Config.hpp>
|
| Config (const fs::path &file_name) |
|
| ~Config ()=default |
|
template<typename T > |
std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value, T >::type | Get (const std::string §ion, const std::string &name, const T &default_value) const |
|
template<typename T > |
std::enable_if< std::is_floating_point< T >::value, T >::type | Get (const std::string §ion, const std::string &name, const T &default_value) const |
|
template<typename T > |
std::enable_if< std::is_same< T, bool >::value, T >::type | Get (const std::string §ion, const std::string &name, const T &default_value) const |
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value, T >::type | Get (const std::string §ion, const std::string &name, const T &default_value) const |
|
Config file Loader (.ini)
Definition at line 11 of file Config.hpp.
◆ Config()
Config::Config |
( |
const fs::path & |
file_name | ) |
|
|
explicit |
Config Constructor Loads and initializes config file
- Parameters
-
file_name | ini config file path |
- Exceptions
-
std::runtime_error | on failure |
◆ ~Config()
◆ Get() [1/4]
template<typename T >
std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value, T>::type Config::Get |
( |
const std::string & |
section, |
|
|
const std::string & |
name, |
|
|
const T & |
default_value |
|
) |
| const |
|
inline |
◆ Get() [2/4]
template<typename T >
std::enable_if<std::is_floating_point<T>::value, T>::type Config::Get |
( |
const std::string & |
section, |
|
|
const std::string & |
name, |
|
|
const T & |
default_value |
|
) |
| const |
|
inline |
Get Floating point fields from loaded config file
- Parameters
-
section | section name |
name | field name |
default_value | default value to return if field not found |
Definition at line 41 of file Config.hpp.
◆ Get() [3/4]
template<typename T >
std::enable_if<std::is_same<T, bool>::value, T>::type Config::Get |
( |
const std::string & |
section, |
|
|
const std::string & |
name, |
|
|
const T & |
default_value |
|
) |
| const |
|
inline |
Get Boolean fields from loaded config file
- Parameters
-
section | section name |
name | field name |
default_value | default value to return if field not found |
Definition at line 52 of file Config.hpp.
◆ Get() [4/4]
template<typename T >
std::enable_if<std::is_same<T, std::string>::value, T>::type Config::Get |
( |
const std::string & |
section, |
|
|
const std::string & |
name, |
|
|
const T & |
default_value |
|
) |
| const |
|
inline |
Get std::string fields from loaded config file
- Parameters
-
section | section name |
name | field name |
default_value | default value to return if field not found |
Definition at line 63 of file Config.hpp.
The documentation for this class was generated from the following file: