Main Page   Class Hierarchy   Compound List   File List   Compound Members  

config::KConfigBase Class Reference

Abstract base class for KDE configuration entries. KDE Configuration Management abstract base class. More...

#include <kconfigbase.h>

Inheritance diagram for config::KConfigBase:

config::KConfig config::KSimpleConfig List of all members.

Public Types

enum  ConfigState { NoAccess, ReadOnly, ReadWrite }
 Possible return values for getConfigState(). More...


Public Methods

 KConfigBase ()
 *.

virtual ~KConfigBase ()
 Destructs the KConfigBase object.

void setGroup (const string &group)
 Specifies the group in which keys will be read and written. More...

void setGroup (const char *group)
string group () const
 Returns the name of the group in which we are searching for keys and from which we are retrieving entries. More...

bool hasGroup (const string &group) const
 Returns true if the specified group is known about. More...

virtual vector< string > groupList () const=0
 Returns a list of groups that are known about. More...

string locale () const
 Returns a the current locale. More...

string readEntry (const string &pKey, const string &aDefault="") const
 Reads the value of an entry specified by pKey in the current group. More...

string readEntry (const char *pKey, const string &aDefault="") const
int readListEntry (const string &pKey, vector< string > &list, char sep=',') const
 Reads a list of strings. More...

int readListEntry (const char *pKey, vector< string > &list, char sep=',') const
vector< string > readListEntry (const string &pKey, char sep=',') const
 Reads a list of strings. More...

vector< string > readListEntry (const char *pKey, char sep=',') const
vector< int > readIntListEntry (const string &pKey) const
 Reads a list of Integers. More...

vector< int > readIntListEntry (const char *pKey) const
string readPathEntry (const string &pKey, const string &aDefault="") const
 Reads a path. More...

string readPathEntry (const char *pKey, const string &aDefault="") const
int readNumEntry (const string &pKey, int nDefault=0) const
 Reads a numerical value. More...

int readNumEntry (const char *pKey, int nDefault=0) const
unsigned int readUnsignedNumEntry (const string &pKey, unsigned int nDefault=0) const
 Reads an unsigned numerical value. More...

unsigned int readUnsignedNumEntry (const char *pKey, unsigned int nDefault=0) const
long readLongNumEntry (const string &pKey, long nDefault=0) const
 Reads a numerical value. More...

long readLongNumEntry (const char *pKey, long nDefault=0) const
unsigned long readUnsignedLongNumEntry (const string &pKey, unsigned long nDefault=0) const
 Read an unsigned numerical value. More...

unsigned long readUnsignedLongNumEntry (const char *pKey, unsigned long nDefault=0) const
double readDoubleNumEntry (const string &pKey, double nDefault=0.0) const
 Reads a floating point value. More...

double readDoubleNumEntry (const char *pKey, double nDefault=0.0) const
bool readBoolEntry (const string &pKey, const bool bDefault=false) const
 Reads a boolean entry. More...

bool readBoolEntry (const char *pKey, const bool bDefault=false) const
string readEntryUntranslated (const string &pKey, const string &aDefault="") const
 Reads the value of an entry specified by pKey in the current group. More...

string readEntryUntranslated (const char *pKey, const string &aDefault="") const
void writeEntry (const string &pKey, const string &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a key/value pair. More...

void writeEntry (const char *pKey, const string &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, const vector< string > &rValue, char sep=',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() overridden to accept a list of strings. More...

void writeEntry (const char *pKey, const vector< string > &rValue, char sep=',', bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, const vector< int > &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 writeEntry() overridden to accept a list of Integers. More...

void writeEntry (const char *pKey, const vector< int > &rValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Write a (key/value) pair. More...

void writeEntry (const char *pKey, const char *pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Write a (key/value) pair. More...

void writeEntry (const char *pKey, int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, unsigned int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair. More...

void writeEntry (const char *pKey, unsigned int nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair. More...

void writeEntry (const char *pKey, long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, unsigned long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair. More...

void writeEntry (const char *pKey, unsigned long nValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writeEntry (const string &pKey, double nValue, bool bPersistent=true, bool bGlobal=false, char format='g', int precision=6, bool bNLS=false)
 Writes a (key/value) pair. More...

void writeEntry (const char *pKey, double nValue, bool bPersistent=true, bool bGlobal=false, char format='g', int precision=6, bool bNLS=false)
void writeEntry (const string &pKey, bool bValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a (key/value) pair. More...

void writeEntry (const char *pKey, bool bValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void writePathEntry (const string &pKey, const string &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
 Writes a file path. More...

void writePathEntry (const char *pKey, const string &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
void deleteEntry (const string &pKey, bool bNLS=false, bool bGlobal=false)
 Deletes the entry specified by pKey in the current group. More...

void deleteEntry (const char *pKey, bool bNLS=false, bool bGlobal=false)
bool deleteGroup (const string &group, bool bDeep=true, bool bGlobal=false)
 Deletes a configuration entry group. More...

void setDollarExpansion (bool _bExpand=true)
 Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries. More...

bool isDollarExpansion () const
 Returns whether dollar expansion is on or off. More...

virtual void rollback (bool bDeep=true)
 Mark the config object as "clean," i.e. More...

virtual void sync ()
 Flushes all changes that currently reside only in memory back to disk / permanent storage. More...

bool isDirty () const
virtual void setReadOnly (bool _ro)
 Sets the config object's read-only status. More...

bool isReadOnly () const
 Returns the read-only status of the config object. More...

bool hasKey (const string &key) const
 Checks whether the key has an entry in the currently active group. More...

virtual map< string, string > entryMap (const string &group) const=0
 Returns a map (tree) of entries for all entries in a particular group. More...

virtual void reparseConfiguration ()=0
 Reparses all configuration files. More...

bool isImmutable () const
bool groupIsImmutable (const string &group) const
bool entryIsImmutable (const string &key) const
ConfigState getConfigState () const
 Returns the state of the app-config object. More...

bool hasGroup (const char *_pGroup) const
 Overloaded public methods:.

bool hasKey (const char *pKey) const

Protected Methods

void setLocale ()
 Reads the locale and put in the configuration data struct. More...

virtual void setDirty (bool _bDirty=true)
 Sets the global dirty flag of the config object. More...

virtual void parseConfigFiles ()
 Parses all configuration files for a configuration object. More...

virtual KEntryMap internalEntryMap (const string &pGroup) const=0
 Returns a map (tree) of the entries in the specified group. More...

virtual KEntryMap internalEntryMap () const=0
 Returns a map (tree) of the entries in the tree. More...

virtual void putData (const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true)=0
 Inserts a (key/value) pair into the internal storage mechanism of the configuration object. More...

virtual KEntry lookupData (const KEntryKey &_key) const=0
 Looks up an entry in the config object's internal structure. More...

virtual bool internalHasGroup (const string &group) const=0
string readEntryUtf8 (const char *pKey) const
virtual void virtual_hook (int id, void *data)

Protected Attributes

KConfigBackEndbackEnd
 A back end for loading/saving to disk in a particular format.

string mGroup
 The currently selected group.

string aLocaleString
 The locale to retrieve keys under if possible, i.e en_US or fr.

bool bDirty
 Indicates whether there are any dirty entries in the config object that need to be written back to disk.

bool bLocaleInitialized
bool bReadOnly
bool bExpand

Friends

class KConfigBackEnd
class KConfigINIBackEnd
class KConfigGroup

Detailed Description

Abstract base class for KDE configuration entries. KDE Configuration Management abstract base class.

This class forms the base for all KDE configuration. It is an abstract base class, meaning that you cannot directly instantiate objects of this class. Either use KConfig (for usual KDE configuration) or KSimpleConfig (for special needs as in ksamba), or even KSharedConfig (stores values in shared memory).

All configuration entries are key, value pairs. Each entry also belongs to a specific group of related entries. All configuration entries that do not explicitly specify which group they are in are in a special group called the default group.

If there is a $ character in an entry, KConfigBase tries to expand environment variable and uses its value instead of its name. You can avoid this feature by having two consecutive $ characters in your config file which get expanded to one.

Author:
Kalle Dalheimer <kalle@kde.org>, Preston Brown <pbrown@kde.org>
Version:
Id:
kconfigbase.h,v 1.1.1.1 2002/12/01 04:08:23 zl Exp
See also:
KGlobal::config() KConfig KSimpleConfig


Member Enumeration Documentation

enum config::KConfigBase::ConfigState
 

Possible return values for getConfigState().

See also:
getConfigState()


Member Function Documentation

void config::KConfigBase::deleteEntry const string &    pKey,
bool    bNLS = false,
bool    bGlobal = false
 

Deletes the entry specified by pKey in the current group.

Parameters:
pKey  The key to delete.
bGlobal  If bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the key with the locale tag is removed.

bool config::KConfigBase::deleteGroup const string &    group,
bool    bDeep = true,
bool    bGlobal = false
 

Deletes a configuration entry group.

If the group is not empty and bDeep is false, nothing gets deleted and false is returned. If this group is the current group and it is deleted, the current group is undefined and should be set with setGroup() before the next operation on the configuration object.

Parameters:
group  The name of the group
bDeep  Specify whether non-empty groups should be completely deleted (including their entries).
bGlobal  If bGlobal is true, the pair is not removed from the application specific config file, but to the global KDE config file.
Returns:
If the group is not empty and bDeep is false, deleteGroup returns false.

bool config::KConfigBase::entryIsImmutable const string &    key const
 

Returns:
whether the entry key may be changed in the current group in this configuration file.

virtual map<string, string> config::KConfigBase::entryMap const string &    group const [pure virtual]
 

Returns a map (tree) of entries for all entries in a particular group.

Only the actual entry string is returned, none of the other internal data should be included.

Parameters:
group  A group to get keys from.
Returns:
A map of entries in the group specified, indexed by key. The returned map may be empty if the group is not found.
See also:
map

Implemented in config::KConfig.

KConfigBase::ConfigState config::KConfigBase::getConfigState   const
 

Returns the state of the app-config object.

Possible return values are NoAccess (the application-specific config file could not be opened neither read-write nor read-only), ReadOnly (the application-specific config file is opened read-only, but not read-write) and ReadWrite (the application-specific config file is opened read-write).

See also:
ConfigState

string config::KConfigBase::group   const
 

Returns the name of the group in which we are searching for keys and from which we are retrieving entries.

Returns:
The current group.

bool config::KConfigBase::groupIsImmutable const string &    group const
 

Returns:
whether changes may be made to group in this configuration file.

virtual vector<string> config::KConfigBase::groupList   const [pure virtual]
 

Returns a list of groups that are known about.

Returns:
The list of groups.

Implemented in config::KConfig.

bool config::KConfigBase::hasGroup const string &    group const
 

Returns true if the specified group is known about.

Parameters:
group  The group to search for.
Returns:
Whether the group exists.

bool config::KConfigBase::hasKey const string &    key const
 

Checks whether the key has an entry in the currently active group.

Use this to determine whether a key is not specified for the current group (hasKey() returns false). Keys with null data are considered nonexistent.

Parameters:
pKey  The key to search for.
Returns:
If true, the key is available.

virtual KEntryMap config::KConfigBase::internalEntryMap   const [protected, pure virtual]
 

Returns a map (tree) of the entries in the tree.

Do not use this function, the implementation / return type are subject to change.

Returns:
A map of the entries in the tree.

Implemented in config::KConfig.

virtual KEntryMap config::KConfigBase::internalEntryMap const string &    pGroup const [protected, pure virtual]
 

Returns a map (tree) of the entries in the specified group.

This may or may not return all entries that belong to the config object. The only guarantee that you are given is that any entries that are dirty (i.e. modified and not yet written back to the disk) will be contained in the map. Some derivative classes may choose to return everything.

Do not use this function, the implementation / return type are subject to change.

Parameters:
pGroup  The group to provide a KEntryMap for.
Returns:
The map of the entries in the group.

Implemented in config::KConfig.

bool config::KConfigBase::isDirty   const [inline]
 

Returns:
true if the config file has any dirty (modified) entries.

bool config::KConfigBase::isDollarExpansion   const [inline]
 

Returns whether dollar expansion is on or off.

It is initially OFF.

Returns:
true if dollar expansion is on.

bool config::KConfigBase::isImmutable   const
 

Returns:
whether changes may be made to this configuration file.

bool config::KConfigBase::isReadOnly   const [inline]
 

Returns the read-only status of the config object.

Returns:
The read-only status.

string config::KConfigBase::locale   const
 

Returns a the current locale.

Returns:
A string representing the current locale.

virtual KEntry config::KConfigBase::lookupData const KEntryKey   _key const [protected, pure virtual]
 

Looks up an entry in the config object's internal structure.

Classes that derive from KConfigBase will need to implement this method in a storage-specific manner.

Do not use this function, the implementation and return type are subject to change.

Parameters:
_key  The key to look up It contains information both on the group of the key and the entry's key itself.
Returns:
The KEntry value (data) found for the key. KEntry.aValue will be the null string if nothing was located.

Implemented in config::KConfig.

void config::KConfigBase::parseConfigFiles   [protected, virtual]
 

Parses all configuration files for a configuration object.

The actual parsing is done by the associated KConfigBackEnd.

virtual void config::KConfigBase::putData const KEntryKey   _key,
const KEntry   _data,
bool    _checkGroup = true
[protected, pure virtual]
 

Inserts a (key/value) pair into the internal storage mechanism of the configuration object.

Classes that derive from KConfigBase will need to implement this method in a storage-specific manner.

Do not use this function, the implementation / return type are subject to change.

Parameters:
_key  The key to insert. It contains information both on the group of the key and the key itself. If the key already exists, the old value will be replaced.
_data  the KEntry that is to be stored.
_checkGroup  When false, assume that the group already exists.

Implemented in config::KConfig.

bool config::KConfigBase::readBoolEntry const string &    pKey,
const bool    bDefault = false
const
 

Reads a boolean entry.

Read the value of an entry specified by pKey in the current group and interpret it as a boolean value. Currently "on" and "true" are accepted as true, everything else if false.

Parameters:
pKey  The key to search for
bDefault  A default value returned if the key was not found.
Returns:
The value for this key.

double config::KConfigBase::readDoubleNumEntry const string &    pKey,
double    nDefault = 0.0
const
 

Reads a floating point value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKey  The key to search for.
nDefault  A default value returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

string config::KConfigBase::readEntry const string &    pKey,
const string &    aDefault = ""
const
 

Reads the value of an entry specified by pKey in the current group.

Parameters:
pKey  The key to search for.
aDefault  A default value returned if the key was not found.
Returns:
The value for this key.

string config::KConfigBase::readEntryUntranslated const string &    pKey,
const string &    aDefault = ""
const
 

Reads the value of an entry specified by pKey in the current group.

The untranslated entry is returned, you normally do not need this.

Parameters:
pKey  The key to search for.
aDefault  A default value returned if the key was not found.
Returns:
The value for this key.

vector< int > config::KConfigBase::readIntListEntry const string &    pKey const
 

Reads a list of Integers.

Parameters:
pKey  The key to search for.
Returns:
The list.

vector< string > config::KConfigBase::readListEntry const string &    pKey,
char    sep = ','
const
 

Reads a list of strings.

Parameters:
pKey  The key to search for.
sep  The list separator (default is ",").
Returns:
The list.

int config::KConfigBase::readListEntry const string &    pKey,
vector< string > &    list,
char    sep = ','
const
 

Reads a list of strings.

Deprecated:
Parameters:
pKey  The key to search for
list  In this object, the read list will be returned.
sep  The list separator (default ",")
Returns:
The number of entries in the list.

long config::KConfigBase::readLongNumEntry const string &    pKey,
long    nDefault = 0
const
 

Reads a numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKey  The key to search for.
nDefault  A default value returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

int config::KConfigBase::readNumEntry const string &    pKey,
int    nDefault = 0
const
 

Reads a numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKey  The key to search for.
nDefault  A default value returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

string config::KConfigBase::readPathEntry const string &    pKey,
const string &    aDefault = ""
const
 

Reads a path.

Read the value of an entry specified by pKey in the current group and interpret it as a path. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

Parameters:
pKey  The key to search for.
aDefault  A default value returned if the key was not found.
Returns:
The value for this key..

unsigned long config::KConfigBase::readUnsignedLongNumEntry const string &    pKey,
unsigned long    nDefault = 0
const
 

Read an unsigned numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKey  The key to search for.
nDefault  A default value returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

unsigned int config::KConfigBase::readUnsignedNumEntry const string &    pKey,
unsigned int    nDefault = 0
const
 

Reads an unsigned numerical value.

Read the value of an entry specified by pKey in the current group and interpret it numerically.

Parameters:
pKey  The key to search for.
nDefault  A default value returned if the key was not found or if the read value cannot be interpreted.
Returns:
The value for this key.

virtual void config::KConfigBase::reparseConfiguration   [pure virtual]
 

Reparses all configuration files.

This is useful for programs that use stand alone graphical configuration tools. The base method implemented here only clears the group list and then appends the default group.

Derivative classes should clear any internal data structures and then simply call parseConfigFiles() when implementing this method.

See also:
parseConfigFiles()

Implemented in config::KConfig.

void config::KConfigBase::rollback bool    bDeep = true [virtual]
 

Mark the config object as "clean," i.e.

don't write dirty entries at destruction time. If bDeep is false, only the global dirty flag of the KConfig object gets cleared. If you then call writeEntry() again, the global dirty flag is set again and all dirty entries will be written at a subsequent sync() call.

Classes that derive from KConfigBase should override this method and implement storage-specific behavior, as well as calling the KConfigBase::rollback() explicitly in the initializer.

Parameters:
bDeep  If true, the dirty flags of all entries are cleared, as well as the global dirty flag.

Reimplemented in config::KConfig.

virtual void config::KConfigBase::setDirty bool    _bDirty = true [inline, protected, virtual]
 

Sets the global dirty flag of the config object.

Parameters:
_bDirty  How to mark the object's dirty status

void config::KConfigBase::setDollarExpansion bool    _bExpand = true [inline]
 

Turns on or off "dollar expansion" (see KConfigBase introduction) when reading config entries.

Dollar sign expansion is initially OFF.

Parameters:
_bExpand  Tf true, dollar expansion is turned on.

void config::KConfigBase::setGroup const string &    group
 

Specifies the group in which keys will be read and written.

Subsequent calls to readEntry() and writeEntry() will be aplied only in the activated group.

Switch back to the default group by passing a null string.

Parameters:
group  The name of the new group.

void config::KConfigBase::setLocale   [protected]
 

Reads the locale and put in the configuration data struct.

Note that this should be done in the constructor, but this is not possible due to some mutual dependencies in KApplication::init()

virtual void config::KConfigBase::setReadOnly bool    _ro [inline, virtual]
 

Sets the config object's read-only status.

Parameters:
_ro  If true, the config object will not write out any changes to disk even if it is destroyed or sync() is called.

void config::KConfigBase::sync   [virtual]
 

Flushes all changes that currently reside only in memory back to disk / permanent storage.

Dirty configuration entries are written to the most specific file available.

Asks the back end to flush out all pending writes, and then calls rollback(). No changes are made if the object has readOnly status.

You should call this from your destructor in derivative classes.

See also:
rollback(), isReadOnly()

Reimplemented in config::KSimpleConfig.

void config::KConfigBase::writeEntry const string &    pKey,
bool    bValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a boolean value.

Parameters:
pKey  The key to write.
bValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writeEntry const string &    pKey,
double    nValue,
bool    bPersistent = true,
bool    bGlobal = false,
char    format = 'g',
int    precision = 6,
bool    bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes a floating-point value.

Parameters:
pKey  The key to write.
nValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
format  format determines the format to which the value is converted. Default is 'g'.
precision  precision sets the precision with which the value is converted. Default is 6 as in string.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writeEntry const string &    pKey,
unsigned long    nValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes an unsigned long numerical value.

Parameters:
pKey  The key to write.
nValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writeEntry const string &    pKey,
long    nValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

Writes a (key/value) pair.

Same as above, but write a long numerical value.

Parameters:
pKey  The key to write.
nValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writeEntry const string &    pKey,
unsigned int    nValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

Writes a (key/value) pair.

Same as above, but writes an unsigned numerical value.

Parameters:
pKey  The key to write.
nValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writeEntry const string &    pKey,
int    nValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

Write a (key/value) pair.

Same as above, but writes a numerical value.

Parameters:
pKey  The key to write.
nValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writeEntry const string &    pKey,
const char *    pValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
[inline]
 

Write a (key/value) pair.

This is stored to the most specific config file when destroying the config object or when calling sync().

Parameters:
pKey  The key to write.
pValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writeEntry const string &    pKey,
const vector< int > &    rValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

writeEntry() overridden to accept a list of Integers.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKey  The key to write
rValue  The list to write
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

void config::KConfigBase::writeEntry const string &    pKey,
const vector< string > &    rValue,
char    sep = ',',
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

writeEntry() overridden to accept a list of strings.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKey  The key to write
rValue  The list to write
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.
See also:
writeEntry()

void config::KConfigBase::writeEntry const string &    pKey,
const string &    pValue,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

Writes a key/value pair.

This is stored in the most specific config file when destroying the config object or when calling sync().

Parameters:
pKey  The key to write.
pValue  The value to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.

void config::KConfigBase::writePathEntry const string &    pKey,
const string &    path,
bool    bPersistent = true,
bool    bGlobal = false,
bool    bNLS = false
 

Writes a file path.

It is checked whether the path is located under $HOME. If so the path is written out with the user's home-directory replaced with $HOME. The path should be read back with readPathEntry()

Parameters:
pKey  The key to write.
path  The path to write.
bPersistent  If bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobal  If bGlobal is true, the pair is not saved to the application specific config file, but to the global KDE config file.
bNLS  If bNLS is true, the locale tag is added to the key when writing it back.


The documentation for this class was generated from the following files:
Generated on Sat Dec 14 20:05:53 2002 for libconfig by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002