Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::ini::Section Class Reference

#include <elm/ini.h>

Classes

class  Iterator
 

Public Member Functions

const stringname (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)
 

Detailed Description

Data in ".INI" files are grouped by sections containing a set if key/value pairs.

Member Function Documentation

Section * elm::ini::Section::get ( const string name) const
Parameters
nameName of looked section.
Returns
Found section or null.

References elm::genstruct::AssocList< K, T, C, E, N >::get().

string elm::ini::Section::get ( const string key,
const string def 
) const

Get a value and possibly a default value if not defined.

Parameters
keyKey to look for.
defDefault value.
Returns
Found value or 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.

Parameters
keyLooked key.
defDefault value if the key is not defined or if the conversion fails.
Returns
Value transformed to integer.
void elm::ini::Section::getList ( const string key,
genstruct::Vector< string > &  list 
)
bool elm::ini::Section::isDefined ( const string key) const

Test if a key/value pair is defined.

Parameters
keyKey to test.
Returns
True if the key exists, false else.

References elm::genstruct::AssocList< K, T, C, E, N >::hasKey().

const string & elm::ini::Section::name ( void  ) const

Get the name of a section.

Returns
Section name.

Referenced by elm::ini::File::load().

Section * elm::ini::Section::operator[] ( const string name) 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.

Parameters
keyKey of the looked value.
Returns
Value associated with the key or an empty string.

Alias to get().

Alias to get().


The documentation for this class was generated from the following files: