#include <inipat.h>
Public Member Functions | |
ConfigObj (const char *N, unsigned int L) | |
ConfigObj (const ConfigObj &Other) | |
ConfigObj (const ConfigObj *Other) | |
ConfigObj & | operator= (const ConfigObj &Other) |
bool | IsMyName (const char *N) const |
ConfigIterator | GetConfig (const char *N, unsigned int Index=0) |
ConfigIterator | GetConfig (const char *N, const char *Param, const char *ValueOfParam) |
TagIterator | GetTag (const char *N, unsigned int Index=0) |
TagInfo * | GetTag (unsigned int Index) |
ConfigObj * | GetConfig (unsigned int Index) |
unsigned int | GetLineNo () |
TagIterator | TagsBegin () |
TagIterator | TagsEnd () |
ConfigIterator | ConfigBegin () |
ConfigIterator | ConfigEnd () |
ConfigRevIterator | ConfigRbegin () |
ConfigRevIterator | ConfigRend () |
TagIterator | FindFirstTag (const char *ParamName) |
ConfigIterator | FindFirstConfig (const char *ConfigName) |
ConfigIterator | FindNextConfig (ConfigIterator &First) |
ConfigIterator | FindNextConfig (ConfigIterator &First, const char *TwinTag) |
void | Reverse () |
Reverses order of subconfigs in this collection. | |
void | Absorb (ConfigObj *Other) |
moves all tags and configs from *Other to *this, but does not deletes *Other | |
void | Absorb (ConfigIterator Other) |
void | Load (char *filename) |
ConfigStream & | Load (ConfigStream &Input) |
ostream & | Write (ostream &oStream, short TabShift=0) |
unsigned int | CountParams (const char *Name=NULL) |
unsigned int | CountConfigs (const char *Name=NULL) |
void | Merge (const char *Name=NULL) |
void | DropTwins (const char *Name, const char *TagName) |
bool | empty () const |
void | Drop (TagInfo *Param) |
void | Drop (ConfigObj *C) |
void | Drop (TagIterator &it) |
void | Drop (ConfigIterator &ci) |
void | DropAll () |
TagInfo * | operator[] (unsigned int i) |
bool | operator== (char *N) |
Friends | |
class | TypeTagIs |
class | NameIs |
ConfigObj also can be a collection (another vector) of the other ConfigObj pointers instances which were incapsulated in this one in configuration file. Pointers are easier to manipulate with the collection, copy, move, or Drop them. Also stores the stream line number where this configuration markup <blahblah> has been opened
void ConfigObj::Absorb | ( | ConfigIterator | Other | ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
unsigned int ConfigObj::CountConfigs | ( | const char * | Name = NULL |
) |
count the incapsulated config objects
Name | is the incapsulated object name we want count up, caseinsensitive if not specified, or ==NULL then returned just the number of all config objects incapsulated in this config object. |
unsigned int ConfigObj::CountParams | ( | const char * | Name = NULL |
) |
count the tags, which have the specified text at beginning
Name | is the text at the begin of the tags to be counted up. If not specified or ==NULL, then returned just the number of all tags at this config object independent on their names |
void ConfigObj::Drop | ( | ConfigIterator & | ci | ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void ConfigObj::Drop | ( | TagIterator & | it | ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void ConfigObj::Drop | ( | ConfigObj * | C | ) |
deletes the included Config object
void ConfigObj::Drop | ( | TagInfo * | Param | ) |
deletes single parameter from array of tags
deletes single parameter from array of tags most often is the parameter after have been used to configurate object variable or the property
Param | the pointer to used tag parameter |
void ConfigObj::DropTwins | ( | const char * | Name, | |
const char * | TagName | |||
) |
search and delete the config objects with equal markup name and equal tag
Assume we have read the configuration details from a number of some other files and now we do need to drop some of configuration objects with the same markup name and the same tag property, to enshure the objects of given markup and tag values are unique in the collection. Only the first object with the same MarkupName and Tag=value pair will survive If you need the last Twin object to survived call Reverse() before and Reverse() again after DropTwins
Name | the markup name of searched twin subconfigs | |
TagName | the beginning of the tag which should have unique values (tag=value) in our collection |
bool ConfigObj::empty | ( | ) | const [inline] |
just means if no params and no subconfigs
ConfigIterator ConfigObj::FindFirstConfig | ( | const char * | ConfigName | ) |
Finds the Config Collection which had tag <ConfigName> in the configuration file
ConfigName |
TagIterator ConfigObj::FindFirstTag | ( | const char * | ParamName | ) |
returns first tag iterator with given ParamName
actually does the same as GetTag(ParamName,0); later tags should be iterated by iterator cycle
ParamName | At least some characters of the searched Tag, |
ConfigIterator ConfigObj::FindNextConfig | ( | ConfigIterator & | First, | |
const char * | TwinTag | |||
) |
Finds next config object with the same Name as the *First has, and the same value of TwinTag
First | the iterator of the starting object | |
TwinTag | string of the beginning of the tag, which should have the same value as the *First has |
ConfigIterator ConfigObj::FindNextConfig | ( | ConfigIterator & | First | ) |
Finds next config object with the same Name as the *First has
First |
ConfigObj* ConfigObj::GetConfig | ( | unsigned int | Index | ) | [inline] |
ConfigIterator ConfigObj::GetConfig | ( | const char * | N, | |
const char * | Param, | |||
const char * | ValueOfParam | |||
) |
get config object wich has specific parameter, with specific value
you should be shure the Value is unique among all Config objects of Type
Type | this object was opened with <Type> mark in the config file | |
Param | and had the Param=Value line in it's scope | |
Value | the text of the tag after = |
ConfigIterator ConfigObj::GetConfig | ( | const char * | N, | |
unsigned int | Index = 0 | |||
) |
Finds the Config object which had been opened with <N> mark and after repeated sequented Index times
N | name of the mark | |
Index | sequental index |
TagIterator ConfigObj::GetTag | ( | const char * | N, | |
unsigned int | Index = 0 | |||
) |
returns Index-th tag wich begins with the text N
N | some characters of the searched tag | |
Index | sequental (counted) number of the tag, matching the N |
bool ConfigObj::IsMyName | ( | const char * | N | ) | const |
Compares the text with the config object name
Name of the config object is the text which was found between but the <sharp brackets>=""> themselves are excluded from name
N | pointer to text to be compared with ConfigObj Name |
N | the text of the opening markup |
ConfigStream & ConfigObj::Load | ( | ConfigStream & | Input | ) |
recursive read of included objects
this function is used to read the incapsulated config sections recursively until the markup </Name> will met
Input | stream, where to read the config from |
void ConfigObj::Load | ( | char * | filename | ) |
open the config stream and read the tags and objects of top level
filename | is the string of config file name |
void ConfigObj::Merge | ( | const char * | Name = NULL |
) |
merges the config objects at the same incapsulation level
Assume we have read the configuration details from a number of some other files where are the properties of the one collection are scattered and eventually we want to gather all theese properties in the single config collection before we pass it to the program class instance to be configured
Name | is the markup name of the scattered collection |
ostream & ConfigObj::Write | ( | ostream & | oStream, | |
short | TabShift = 0 | |||
) |
write the all configuration forest.
Is usefull for learn, test and debug purposes. After load and manipulations to see the results in some output stream
oStream | stream where to output the configurations | |
TabShift | is the indent of the recursively incapsulated objects. Just leave this parameter default, all incapsulated objects were indented automatically |