2 #ifndef ENIGMA_CONFIG_H
3 #define ENIGMA_CONFIG_H
18 explicit Config(
const fs::path& file_name);
29 inline typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value,
T>::type
30 Get(
const std::string& section,
const std::string& name,
const T& default_value)
const {
31 return static_cast<T>(m_ini_reader->GetInteger(section, name, default_value));
40 inline typename std::enable_if<std::is_floating_point<T>::value,
T>::type
41 Get(
const std::string& section,
const std::string& name,
const T& default_value)
const {
42 return static_cast<T>(m_ini_reader->GetReal(section, name, default_value));
51 inline typename std::enable_if<std::is_same<T, bool>::value,
T>::type
52 Get(
const std::string& section,
const std::string& name,
const T& default_value)
const {
53 return m_ini_reader->GetBoolean(section, name, default_value);
62 inline typename std::enable_if<std::is_same<T, std::string>::value,
T>::type
63 Get(
const std::string& section,
const std::string& name,
const T& default_value)
const {
64 return m_ini_reader->GetString(section, name, default_value);
68 std::unique_ptr<INIReader> m_ini_reader{};
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Config(const fs::path &file_name)
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
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
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
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