Rapicorn - Experimental UI Toolkit - Source Code
13.07.0
|
Configuration parser for INI files. More...
Public Member Functions | |
IniFile (const String &res_ini) | |
Construct IniFile from INI resource blob. | |
IniFile (Blob blob) | |
Construct IniFile from Blob. | |
IniFile (const IniFile &source) | |
Copy constructor. | |
IniFile & | operator= (const IniFile &source) |
Assignment operator. | |
bool | has_sections () const |
Checks if IniFile is non-empty. | |
StringVector | sections () const |
List all sections. | |
bool | has_section (const String §ion) const |
Check presence of a section. | |
StringVector | attributes (const String §ion) const |
List all attributes available in section. | |
bool | has_attribute (const String §ion, const String &key) const |
Return if section contains key. | |
String | raw_value (const String &dotpath) const |
Retrieve raw (uncooked) value of section.attribute[locale]. | |
StringVector | raw_values () const |
List all section.attribute=value pairs. | |
String | value_as_string (const String &dotpath) const |
Retrieve value of section.attribute[locale]. | |
Static Public Member Functions | |
static String | cook_string (const String &input_string) |
Unquote contents of input_string;. |
Configuration parser for INI files.
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
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:
[Section] key = value # definition of Section.key = "value" name = "quoted string with \n newlines and spaces"