37 throw std::runtime_error(
"");
42 throw std::runtime_error(
"");
47 throw std::runtime_error(
"");
52 throw std::runtime_error(
"");
62 operator std::string()
const 71 operator double()
const 73 throw std::runtime_error(
"Enum type cannot be converted to double");
78 return data_ == other.data_;
83 return !(*
this == other);
88 return data_ < other.data_;
102 enum class option_type : char { boolean_e, signed_e, unsigned_e, float_e, enum_e, string_e, invalid_e };
105 using boolean_ini_t = bool;
106 using signed_ini_t = int64_t;
107 using unsigned_ini_t = uint64_t;
108 using float_ini_t = double;
110 using string_ini_t = std::string;
116 enum class option_item : bool { single, list };
122 enum class item_requirement : bool { mandatory, optional };
129 enum class schema_mode : bool { strict, relaxed };
137 template <
typename ValueType> option_type get_option_enum_type()
139 if (std::is_same<ValueType, boolean_ini_t>::value) {
140 return option_type::boolean_e;
141 }
else if (std::is_same<ValueType, signed_ini_t>::value) {
142 return option_type::signed_e;
143 }
else if (std::is_same<ValueType, unsigned_ini_t>::value) {
144 return option_type::unsigned_e;
145 }
else if (std::is_same<ValueType, float_ini_t>::value) {
146 return option_type::float_e;
147 }
else if (std::is_same<ValueType, string_ini_t>::value) {
148 return option_type::string_e;
149 }
else if (std::is_same<ValueType, enum_ini_t>::value) {
150 return option_type::enum_e;
152 return option_type::invalid_e;
157 #endif // INICPP_TYPES_H bool operator<(const internal_enum_type &other)
internal_enum_type(const char *value)
bool operator!=(const internal_enum_type &other)
internal_enum_type(uint64_t)
internal_enum_type(const internal_enum_type &other)
internal_enum_type & operator=(const internal_enum_type &other)
internal_enum_type(double)
internal_enum_type(int64_t)
internal_enum_type(const std::string &value)
bool operator==(const internal_enum_type &other)