Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/ini.h>
Classes | |
class | Iterator |
Public Member Functions | |
const string & | name (void) const |
string | get (const string &key) const |
string | operator[] (const string &key) const |
bool | isDefined (const string &key) const |
string | get (const string &key, const string &def) const |
int | getInt (const string &key, int def) |
void | getList (const string &key, genstruct::Vector< string > &list) |
Data in ".INI" files are grouped by sections containing a set if key/value pairs.
name | Name of looked section. |
References elm::genstruct::AssocList< K, T, C, E, N >::get().
Get a value and possibly a default value if not defined.
key | Key to look for. |
def | Default value. |
References elm::genstruct::AssocList< K, T, C, E, N >::hasKey().
int elm::ini::Section::getInt | ( | const string & | key, |
int | def | ||
) |
Get a value and transform it to integer.
key | Looked key. |
def | Default value if the key is not defined or if the conversion fails. |
void elm::ini::Section::getList | ( | const string & | key, |
genstruct::Vector< string > & | list | ||
) |
References elm::genstruct::Vector< T >::add(), elm::String::indexOf(), and elm::String::substring().
bool elm::ini::Section::isDefined | ( | const string & | key | ) | const |
Test if a key/value pair is defined.
key | Key to test. |
References elm::genstruct::AssocList< K, T, C, E, N >::hasKey().
const string & elm::ini::Section::name | ( | void | ) | const |
string Section::get(const string& key) const; Get the value associated with the given key or an empty string if it is not defined.
key | Key of the looked value. |
Alias to get().
Alias to get().