![]() |
Exiv2
|
Read an INI file into easy-to-access name/value pairs. (Note that I've gone for simplicity here rather than speed, but it should be pretty decent.) More...
#include <ini.hpp>
Public Member Functions | |
| INIReader (const std::string &filename) | |
| Construct INIReader and parse given filename. See ini.h for more info about the parsing. | |
| int | ParseError () |
| Return the result of ini_parse(), i.e., 0 on success, line number of first error on parse error, or -1 on file open error. | |
| std::string | Get (std::string section, std::string name, std::string default_value) |
| Get a string value from INI file, returning default_value if not found. More... | |
| long | GetInteger (std::string section, std::string name, long default_value) |
| Get an integer (long) value from INI file, returning default_value if not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2"). More... | |
| double | GetReal (std::string section, std::string name, double default_value) |
| Get a real (floating point double) value from INI file, returning default_value if not found or not a valid floating point value according to strtod(). More... | |
| bool | GetBoolean (std::string section, std::string name, bool default_value) |
| Get a boolean value from INI file, returning default_value if not found or if not a valid true/false value. Valid true values are "true", "yes", "on", "1", and valid false values are "false", "no", "off", "0" (not case sensitive). More... | |
Read an INI file into easy-to-access name/value pairs. (Note that I've gone for simplicity here rather than speed, but it should be pretty decent.)
| string INIReader::Get | ( | std::string | section, |
| std::string | name, | ||
| std::string | default_value | ||
| ) |
Get a string value from INI file, returning default_value if not found.
| section | name of section |
| name | name of key |
| default_value | default if not found |
Referenced by GetBoolean(), GetInteger(), GetReal(), and Exiv2::Internal::readExiv2Config().
| bool INIReader::GetBoolean | ( | std::string | section, |
| std::string | name, | ||
| bool | default_value | ||
| ) |
Get a boolean value from INI file, returning default_value if not found or if not a valid true/false value. Valid true values are "true", "yes", "on", "1", and valid false values are "false", "no", "off", "0" (not case sensitive).
| section | name of section |
| name | name of key |
| default_value | default if not found |
References Get().
| long INIReader::GetInteger | ( | std::string | section, |
| std::string | name, | ||
| long | default_value | ||
| ) |
Get an integer (long) value from INI file, returning default_value if not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2").
| section | name of section |
| name | name of key |
| default_value | default if not found |
References Get().
| double INIReader::GetReal | ( | std::string | section, |
| std::string | name, | ||
| double | default_value | ||
| ) |
Get a real (floating point double) value from INI file, returning default_value if not found or not a valid floating point value according to strtod().
| section | name of section |
| name | name of key |
| default_value | default if not found |
References Get().
1.8.14