#include <appconf.h>
Inheritance diagram for BaseConfig:

Set and retrieve current path | |
| virtual void | setCurrentPath (const char *szPath="") |
| virtual void | changeCurrentPath (const char *szPath="") |
| const char* | getCurrentPath () const |
| char* | normalizePath (const char *szStartPath, const char *szPath) |
Filter functions. | |
| All key values should pass by these functions, derived classes should call them in their read/writeEntry functions. Currently, these functions only escape meta-characters (mainly spaces which would otherwise confuse the parser), but they could also be used to encode/decode key values. | |
| void | expandVariables (Bool bExpand=TRUE) |
| should environment variables be automatically expanded? | |
| Bool | doesExpandVariables (void) const |
| do environment variables get automatically expanded? | |
| char* | filterOut (const char *szValue) |
| should be called from writeEntry, returns pointer to dynamic buffer. | |
| char* | filterIn (const char *szValue) |
| should be called from readEntry, returns pointer to dynamic buffer. | |
Public Methods | |
| void | recordDefaults (Bool enable=TRUE) |
Constructors and destructor | |
| BaseConfig () | |
| default ctor. | |
| virtual | ~BaseConfig () |
| dtor. | |
Enumeration of subgroups/entries | |
| virtual Enumerator* | enumSubgroups () const=0 |
| virtual Enumerator* | enumEntries () const=0 |
Key access | |
| virtual const char* | readEntry (const char *szKey, const char *szDefault=NULL) const=0 |
| long int | readEntry (const char *szKey, long int Default) const |
| double | readEntry (const char *szKey, double Default) const |
| virtual Bool | writeEntry (const char *szKey, const char *szValue)=0 |
| Bool | writeEntry (const char *szKey, long int Value) |
| Bool | writeEntry (const char *szKey, double Value) |
| virtual Bool | deleteEntry (const char *szKey)=0 |
Other functions | |
| virtual Bool | flush (Bool=FALSE) |
| permanently writes changes, returns TRUE on success. | |
| Bool | isInitialized () const |
| returns TRUE if object was correctly initialized. | |
Protected Attributes | |
| Bool | m_bOk |
| TRUE if ctor successfully initialized the object. | |
| Bool | m_bExpandVariables |
| TRUE if environment variables are to be auto-expanded. | |
| Bool | m_bRecordDefaults |
| TRUE if default values are to be recorded. | |
Private Attributes | |
| char* | m_szCurrentPath |
Definition at line 181 of file appconf.h.
|
|
default ctor.
|
|
|
dtor.
|
|
|
Change the current path. Works like 'cd' and supports "..".
Reimplemented in FileConfig. |
|
|
Delets the entry. Notice that there is intentionally no such function as deleteGroup: the group is automatically deleted when it's last entry is deleted. @memo Deletes the entry.
Reimplemented in FileConfig. |
|
|
do environment variables get automatically expanded?
|
|
|
Enumerate entries of the current group.
Reimplemented in FileConfig. |
|
|
Enumerate subgroups of the current group. Caller must delete the returned pointer. Example of usage:
char **aszGroups;
config.setCurrentPath("mygroup");
BaseConfig::Enumerator *pEnum = config.enumSubgroups();
size_t nGroups = pEnum->Count();
for ( size_t n = 0; n < nGroups; n++ )
cout << "Name of subgorup #" << n << " is " << (*pEnum)[n] << endl;
delete pEnum;
Reimplemented in FileConfig. |
|
|
should environment variables be automatically expanded?
|
|
|
should be called from readEntry, returns pointer to dynamic buffer.
|
|
|
should be called from writeEntry, returns pointer to dynamic buffer.
|
|
|
permanently writes changes, returns TRUE on success.
Reimplemented in FileConfig. |
|
|
Query the current path.
|
|
|
returns TRUE if object was correctly initialized.
|
|
|
Resolve ".." and "/" in the path.
|
|
|
Get the value of an entry, or the default value, interpreted as a double value.
Reimplemented in FileConfig. |
|
|
Get the value of an entry, or the default value, interpreted as a long integer.
Reimplemented in FileConfig. |
|
|
Get the value of an entry, or the default value.
Reimplemented in FileConfig. Referenced by FileConfig::m_szComment(), and FileConfig::readEntry(). |
|
|
activates recording of default values
|
|
|
Specify the new current path by its absolute name.
|
|
|
Set the value of an entry to a double value.
Reimplemented in FileConfig. |
|
|
Set the value of an entry to a long int value.
Reimplemented in FileConfig. |
|
|
Set the value of an entry.
Reimplemented in FileConfig. Referenced by FileConfig::writeEntry(). |
|
|
TRUE if environment variables are to be auto-expanded.
|
|
|
TRUE if ctor successfully initialized the object.
|
|
|
TRUE if default values are to be recorded.
|
|
|
|
1.2.6 written by Dimitri van Heesch,
© 1997-2001