YGP::INIMap< T, M > Class Template Reference

Class to parse all entries of a section into a list (map) of values (see INIFile for more details). More...

Inherits YGP::INISection.

List of all members.

Public Member Functions

 INIMap (const char *name, M &values)
 ~INIMap ()
void write (std::ostream &stream)

Static Public Member Functions

static void write (std::ostream &stream, const char *section, const M &values)

Protected Member Functions

virtual int foundKey (const char *key, unsigned int)
virtual int foundValue (const char *value, unsigned int len)


Detailed Description

template<class T, class M = std::map<std::string, T>>
class YGP::INIMap< T, M >

Class to parse all entries of a section into a list (map) of values (see INIFile for more details).

The entries of the section must have a unique (alphanumeric) key.


Constructor & Destructor Documentation

template<class T , class M = std::map<std::string, T>>
YGP::INIMap< T, M >::INIMap ( const char *  name,
M &  values 
) [inline]

Constructor; Creates an object named name and a vector to receive the parsed values.

Parameters:
name Name of the section
values Map to store the passed values

template<class T , class M = std::map<std::string, T>>
YGP::INIMap< T, M >::~INIMap (  )  [inline]

Destructor; Frees the internally used attribute list.


Member Function Documentation

template<class T , class M = std::map<std::string, T>>
virtual int YGP::INIMap< T, M >::foundKey ( const char *  key,
unsigned  int 
) [inline, protected, virtual]

Callback when a key is found while parsing the INI-file (during parsing the INIMap).

This method considers the key as offet for the value in the list.

Reimplemented from YGP::INISection.

template<class T , class M = std::map<std::string, T>>
virtual int YGP::INIMap< T, M >::foundValue ( const char *  value,
unsigned int  len 
) [inline, protected, virtual]

Callback when a value is found while parsing the INI-file (during parsing the INIMap).

This method assigns value to the previously parsed offset.

Reimplemented from YGP::INISection.

template<class T , class M = std::map<std::string, T>>
static void YGP::INIMap< T, M >::write ( std::ostream &  stream,
const char *  section,
const M &  values 
) [inline, static]

Writes the contents of the passed values to the passed stream (in its own section named section).

Parameters:
stream Stream to write to
section Name of section to write
values Values to write

template<class T , class M = std::map<std::string, T>>
void YGP::INIMap< T, M >::write ( std::ostream &  stream  )  [inline]

Writes the contents of the holded attribute values to the passed stream (in its own section).

Parameters:
stream Stream to write to


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

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:27 2009 by doxygen 1.5.8