Main Page   Class Hierarchy   Compound List   File List   Compound Members  

config::KConfig Class Reference

Access KDE Configuration entries. KDE Configuration Management class. More...

#include <kconfig.h>

Inheritance diagram for config::KConfig:

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

Public Methods

 KConfig (const string &fileName="", bool bReadOnly=false, bool bUseKDEGlobals=true, const char *resType="config")
 Constructs a KConfig object. More...

virtual ~KConfig ()
 Destructs the KConfig object. More...

virtual void rollback (bool bDeep=true)
 Clears all entries out of the dirtyEntryMap, so the values will not be written to disk on a later call to sync(). More...

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

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

virtual void reparseConfiguration ()
 Clears all internal data structures and then reread configuration information from disk.

void setFileWriteMode (int mode)
 Set the file mode for newly created files. More...

void setForceGlobal (bool force)
 Forces all following write-operations being performed on kdeglobals, independent of the bGlobal flag in writeEntry(). More...

bool forceGlobal () const
 Returns true if all entries are being written into kdeglobals. More...


Protected Methods

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

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

virtual KEntryMap internalEntryMap () const
 Returns a copy of the internal map used to hold all entries. More...

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

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

virtual void virtual_hook (int id, void *data)

Protected Attributes

KEntryMap aEntryMap
 Contains all key,value entries, as well as some "special" keys which indicate the start of a group of entries. More...


Detailed Description

Access KDE Configuration entries. KDE Configuration Management class.

This class implements KDE's default configuration system.

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


Constructor & Destructor Documentation

config::KConfig::KConfig const string &    fileName = "",
bool    bReadOnly = false,
bool    bUseKDEGlobals = true,
const char *    resType = "config"
 

Constructs a KConfig object.

Parameters:
fileName  A file to parse in addition to the system-wide file(s). If it is not provided, only global KDE configuration data will be read (depending on the value of bUseKDEGlobals).
bReadOnly  Set the config object's read-only status.
bUseKDEGlobals  Toggle reading the global KDE configuration file.
resType  the place to look in (config, data, etc) See KStandardDirs.

config::KConfig::~KConfig   [virtual]
 

Destructs the KConfig object.

Writes back any dirty configuration entries, and destroys dynamically created objects.


Member Function Documentation

map< string, string > config::KConfig::entryMap const string &    pGroup const [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:
pGroup  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.

Implements config::KConfigBase.

bool config::KConfig::forceGlobal   const [inline]
 

Returns true if all entries are being written into kdeglobals.

See also:
setForceGlobal

virtual KEntryMap config::KConfig::internalEntryMap   const [inline, protected, virtual]
 

Returns a copy of the internal map used to hold all entries.

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.

Implements config::KConfigBase.

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

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

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.

Implements config::KConfigBase.

bool config::KConfig::internalHasGroup const string &    group const [protected, virtual]
 

Returns true if the specified group is known.

Parameters:
group  The group to search for.
Returns:
true if the group exists.

Implements config::KConfigBase.

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

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

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.

Implements config::KConfigBase.

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

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

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.

Implements config::KConfigBase.

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

Clears all entries out of the dirtyEntryMap, so the values will not be written to disk on a later call to sync().

Parameters:
bDeep  If true, the dirty map is actually emptied. otherwise, the config object's global dirty flag is set to false, but the dirty entries remain in the dirty entry map.
See also:
KConfigBase::rollback

Reimplemented from config::KConfigBase.

void config::KConfig::setFileWriteMode int    mode
 

Set the file mode for newly created files.

See also:
man:chmod(2) for a description of mode

void config::KConfig::setForceGlobal bool    force [inline]
 

Forces all following write-operations being performed on kdeglobals, independent of the bGlobal flag in writeEntry().

See also:
forceGlobal


Member Data Documentation

KEntryMap config::KConfig::aEntryMap [protected]
 

Contains all key,value entries, as well as some "special" keys which indicate the start of a group of entries.

These special keys will have the .key portion of their KEntryKey set to string::null.


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