|
| | INIReader (const std::string &filename) |
| | Construct an INIReader object from a file name.
|
| |
| | INIReader (std::FILE *file) |
| | Construct an INIReader object from a file pointer.
|
| |
| int | ParseError () const |
| | Return the result of the parse, i.e., 0 on success.
|
| |
| std::set< std::string > | Sections () const |
| | Return the list of sections found in ini file.
|
| |
| std::set< std::string > | Keys (const std::string §ion) const |
| | Return the list of keys in the given section.
|
| |
| std::unordered_map< std::string, std::string > | Get (const std::string §ion) const |
| | Get the map representing the values in a section of the INI file.
|
| |
| template<typename T = std::string> |
| T | Get (const std::string §ion, const std::string &name) const |
| | Return the value of the given key in the given section.
|
| |
| template<typename T > |
| T | Get (const std::string §ion, const std::string &name, T &&default_v) const |
| | Return the value of the given key in the given section, return default if not found.
|
| |
| template<typename T = std::string> |
| std::vector< T > | GetVector (const std::string §ion, const std::string &name) const |
| | Return the value array of the given key in the given section.
|
| |
| template<typename T > |
| std::vector< T > | GetVector (const std::string §ion, const std::string &name, const std::vector< T > &default_v) const |
| | Return the value array of the given key in the given section, return default if not found.
|
| |
| template<typename T = std::string> |
| void | InsertEntry (const std::string §ion, const std::string &name, const T &v) |
| | Insert a key-value pair into the INI file.
|
| |
| template<typename T = std::string> |
| void | InsertEntry (const std::string §ion, const std::string &name, const std::vector< T > &vs) |
| | Insert a vector of values into the INI file.
|
| |
| template<typename T = std::string> |
| void | UpdateEntry (const std::string §ion, const std::string &name, const T &v) |
| | Update a key-value pair in the INI file.
|
| |
| template<typename T = std::string> |
| void | UpdateEntry (const std::string §ion, const std::string &name, const std::vector< T > &vs) |
| | Update a vector of values in the INI file.
|
| |
|
|
template<typename T > |
| T | Converter (const std::string &s) const |
| | Parse s as a T; throws std::runtime_error on failure.
|
| |
|
bool | BoolConverter (std::string s) const |
| | Parse a boolean token: 1/0/true/false/yes/no/on/off, case-insensitive; throws std::runtime_error on anything else.
|
| |
|
template<typename T > |
| std::string | V2String (const T &v) const |
| | Serialize a value with operator<<.
|
| |
|
template<typename T > |
| std::string | Vec2String (const std::vector< T > &v) const |
| | Serialize a vector as space-separated values.
|
| |
Read an INI file into easy-to-access name/value pairs.