Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions | Static Public Member Functions
Rapicorn::IniFile Class Reference

Configuration parser for INI files. More...

List of all members.

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.
IniFileoperator= (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 &section) const
 Check presence of a section.
StringVector attributes (const String &section) const
 List all attributes available in section.
bool has_attribute (const String &section, 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;.

Detailed Description

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"

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines