Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
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, Vector< string > &list)
 

Detailed Description

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

Member Function Documentation

◆ get() [1/2]

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

References ListMap< K, T, C, E, A >::get().

Referenced by Section::get(), Section::getInt(), Section::getList(), and Section::operator[]().

◆ get() [2/2]

string 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 Section::get(), and ListMap< K, T, C, E, A >::hasKey().

◆ getInt()

int 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.

References Section::get().

◆ getList()

void getList ( const string key,
Vector< string > &  list 
)

◆ isDefined()

bool isDefined ( const string key) const
inline

Test if a key/value pair is defined.

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

References ListMap< K, T, C, E, A >::hasKey().

◆ name()

const string & name ( void  ) const
inline

Get the name of a section.

Returns
Section name.

Referenced by File::load().

◆ operator[]()

Section * operator[] ( const string name) const
inline

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().

References Section::get().


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