Skip to content

Class Ase::IniFile

ClassList > Ase > IniFile

Class to parse INI configuration file sections and values. More...

  • #include <inifile.hh>

Public Functions

Type Name
IniFile (const String & name, const String & inidata)
Load INI file from immediate data .
IniFile (Blob blob)
Load INI file from Blob .
IniFile (const IniFile & source)
Copy constructor.
StringS attributes (const String & section) const
List all attributes available in section .
bool has_attribute (const String & section, const String & key) const
Return if section containskey .
bool has_raw_value (const String & dotpath, String * valuep=NULL) const
Check and possibly retrieve raw value if present.
bool has_section (const String & section) const
Check presence of a section.
bool has_sections () const
Checks if IniFile is non-empty.
bool has_value (const String & dotpath, String * valuep=NULL) const
Check and possibly retrieve value if present.
IniFile & operator= (const IniFile & source)
Assignment operator.
String raw_value (const String & dotpath) const
Retrieve raw (uncooked) value of section.attribute[locale].
StringS raw_values () const
List all section.attribute=value pairs.
StringS sections () const
List all sections.
String value_as_string (const String & dotpath) const
Retrieve value of section.attribute[locale].

Public Static Functions

Type Name
String cook_string (const String & input_string)
Unquote contents of input_string __

Detailed Description

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:

[Section]
  key = value  # definition of Section.key = "value"
  name = "quoted string with \n newlines and spaces"

Public Functions Documentation

function IniFile [1/3]

explicit Ase::IniFile::IniFile (
    const String & name,
    const String & inidata
) 

function IniFile [2/3]

explicit Ase::IniFile::IniFile (
    Blob blob
) 

function IniFile [3/3]

explicit Ase::IniFile::IniFile (
    const IniFile & source
) 

function attributes

StringS Ase::IniFile::attributes (
    const String & section
) const

function has_attribute

bool Ase::IniFile::has_attribute (
    const String & section,
    const String & key
) const

function has_raw_value

bool Ase::IniFile::has_raw_value (
    const String & dotpath,
    String * valuep=NULL
) const

function has_section

bool Ase::IniFile::has_section (
    const String & section
) const

function has_sections

bool Ase::IniFile::has_sections () const

function has_value

bool Ase::IniFile::has_value (
    const String & dotpath,
    String * valuep=NULL
) const

function operator=

IniFile & Ase::IniFile::operator= (
    const IniFile & source
) 

function raw_value

String Ase::IniFile::raw_value (
    const String & dotpath
) const

function raw_values

StringS Ase::IniFile::raw_values () const

function sections

StringS Ase::IniFile::sections () const

function value_as_string

String Ase::IniFile::value_as_string (
    const String & dotpath
) const

Public Static Functions Documentation

function cook_string

static String Ase::IniFile::cook_string (
    const String & input_string
) 


The documentation for this class was generated from the following file /__w/anklang/anklang/ase/inifile.hh