#include "inifile.hh"
Public Member Functions | |
StringS | attributes (const String §ion) const |
bool | has_attribute (const String §ion, const String &key) const |
bool | has_raw_value (const String &dotpath, String *valuep=NULL) const |
bool | has_section (const String §ion) const |
bool | has_sections () const |
bool | has_value (const String &dotpath, String *valuep=NULL) const |
IniFile (Blob blob) | |
IniFile (const IniFile &source) | |
IniFile (const String &name, const String &inidata) | |
IniFile & | operator= (const IniFile &source) |
String | raw_value (const String &dotpath) const |
StringS | raw_values () const |
StringS | sections () const |
String | value_as_string (const String &dotpath) const |
Static Public Member Functions | |
static String | cook_string (const String &input_string) |
Class to parse INI configuration file sections and values.
This class parses configuration files, commonly known as INI files. The files contain "[Section]" markers and "attribute=value" definitions. Comment lines are preceeded by a hash "#" sign. For a detailed reference, see: http://wikipedia.org/wiki/INI_file
To write INI files, refer to the IniWriter class. Localization of attributes is supported with the "attribute[locale]=value" syntax, in accordance with the desktop file spec: http://freedesktop.org/Standards/desktop-entry-spec
Example:
Load INI file from immediate `data`.
bool has_sections | ( | ) | const |
Checks if IniFile is non-empty.
StringS sections | ( | ) | const |
List all sections.
bool has_section | ( | const String & | section | ) | const |
Check presence of a section.
Return if `section` contains `key`.
Check and possibly retrieve raw value if present.
Retrieve raw (uncooked) value of section.attribute[locale].
StringS raw_values | ( | ) | const |
List all section.attribute=value pairs.
Check and possibly retrieve value if present.