MboIniData.h File Reference

class CIniData: storage/retrieval of initialisation data. More...

#include "Mbo.h"
#include "MboSynch.h"
#include "MboStrList.h"
#include "MboStrMap.h"
#include "MboStrHelper.h"
#include "triplet.h"
#include "quaternion.h"
#include <vector>
#include <float.h>
#include <fstream>
#include <sstream>
#include <sys/types.h>
#include <sys/stat.h>

Include dependency graph for MboIniData.h:

Mbo.hMboSynch.hMboStrList.hMboStrHelper.hMboStrMap.htriplet.hquaternion.hMboTString.hMboDebugTrace.harg_info.hmap2.hlist2.hvector2.hdeque2.h

This graph shows which files directly or indirectly include this file:

MboDrawWin.h

Go to the source code of this file.

Namespaces

namespace  mbo

Classes

class  mbo::CIniData
 Storage/Retrieval of Initialisation data. More...
class  mbo::CIniData::CIniMutex
 extended mutex that enables auto-flushing

Typedefs

typedef std::list< std::pair
< MboString, MboString > > 
mbo::CIniSectionList

Functions

template<class _E, class _Tr, class _A>
COLORREF mbo::StrToColor (const std::basic_string< _E, _Tr, _A > &str, COLORREF colDefault)
template<class _E, class _Tr, class _A>
std::basic_string< _E, _Tr, _A > & mbo::StrFromColor (std::basic_string< _E, _Tr, _A > &str, COLORREF col)


Detailed Description

class CIniData: storage/retrieval of initialisation data.

Author:
Marcus Boerger (http://marcus-boerger.de/)

Note:
You must compile this source with RTTI enabled.

This file is distributed under the LGPL license GNU Lesser General Public License, version 2.1.

See also:
INI_FILE_MAIN_PAGE for a description of supported Ini Files.
An ini file consits of several groups containing several key=value pairs as follows:

 [group-name-1]
 key-name-1=value-1
 key-name-2=value-2
 [group-name-2]
 key-name-3=value-3
 key-name-4=value-4
 

Any empty lines are ignored and comments are not possible. However it is common to not have any keyname starting with ";" or "#". So that lines starting with one of these characters are usually ignored.

Keynames may be appended by additional whitespace and whitespace before or after a value is ignored. If a value is enclosed in single or double quotes then the surrounding quotes are dropped and the value inside the quotes is taken as this. This way whitespace at beginning or end of a value is possible.

List of types

Ini string

A string setting is any value but the left and right most whitespace is ignored and you cannot have ini settings that exceed one line.

Ini filename

A filename is basically the same as string but it is intended for filenames. The difference is that filename settings may contain environment variables. For example %TEMP% will be replaced in the value of the environment variable TEMP. If an environment variable contains other environment variables the resolution is done recursively. If you need a single % in you setting then you must use double %% in you setting.

Ini path

Same as filename but used for directories.

Ini integer

This is used for settings in integer format with type int.

Ini long

This is used for settings in integer format with type long.

Ini float

This is used for floating point settings with type float.

Ini double

This is used for floating point settings with type double.

Ini boolean

A boolean value is either true or false. The following values are recognized as true: "true", "yes", "on", "ja", "1". The next list shows values recognized as false: "false", "no", "off", "nein", "0". Any other value is ignored and instead the default value will be used.

Ini color

A color value is denoted by the three color components red, green and blue in any order with range 0 to 255 each. These components are all optional where an omitted value will be set to 0. The format is as follows:

 key-name=R=<red>,G=<green>,B=<blue>
 

Ini map

Maps are group level elements. That is all elements within a group are taken for elements of the map.

 [<string>]
 <string>=<string>
 <string>=<string>
 ...
 

Other than getting or setting the map with the above described methods it is possible to get and set all entries of a section using CIniSectionList. This allows to read and write sections with duplicate entries.

Definition in file MboIniData.h.


  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:08 2008 for MBO-lib by doxygen 1.5.4