.TH "KConfig" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KConfig \- Access \fBKDE\fP Configuration entries. \fBKDE\fP Configuration Management class.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kconfig.h>\fP
.PP
Inherits \fBKConfigBase\fP.
.PP
Inherited by \fBKDesktopFile\fP, and \fBKSimpleConfig\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKConfig\fP (const  \fBQString\fP &fileName=QString::null, bool bReadOnly=false, bool bUseKDEGlobals=true, const  char *resType='config')"
.br
.RI "\fIConstructs a KConfig object. \fP"
.ti -1c
.RI "virtual \fB~KConfig\fP ()"
.br
.RI "\fIDestructs the KConfig object. \fP"
.ti -1c
.RI "virtual void \fBrollback\fP (bool bDeep=true)"
.br
.RI "\fIClears all entries out of the \fCdirtyEntryMap\fP, so the values will not be written to disk on a later call to \fBsync\fP(). \fP"
.ti -1c
.RI "virtual \fBQStringList\fP \fBgroupList\fP () const "
.br
.RI "\fIReturns a list of groups that are known. \fP"
.ti -1c
.RI "virtual \fBQMap\fP< \fBQString\fP, \fBQString\fP > \fBentryMap\fP (const  \fBQString\fP &pGroup) const "
.br
.RI "\fIReturns a map (tree) of entries for all entries in a particular group. \fP"
.ti -1c
.RI "virtual void \fBreparseConfiguration\fP ()"
.br
.RI "\fIClears all internal data structures and then reread configuration information from disk. \fP"
.ti -1c
.RI "void \fBsetFileWriteMode\fP (int mode)"
.br
.RI "\fISet the file mode for newly created files. \fP"
.ti -1c
.RI "void \fBsetForceGlobal\fP (bool force)"
.br
.RI "\fIForces all following write-operations being performed on kdeglobals, independent of the bGlobal flag in \fBwriteEntry()\fP. \fP"
.ti -1c
.RI "bool \fBforceGlobal\fP () const "
.br
.RI "\fIReturns true if all entries are being written into kdeglobals. \fP"
.ti -1c
.RI "void \fBcheckUpdate\fP (const  \fBQString\fP &id, const  \fBQString\fP &updateFile)"
.br
.RI "\fIChecks whether the config file contains the update \fCid\fP as contained in \fCupdateFile\fP. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBinternalHasGroup\fP (const  \fBQCString\fP &group) const "
.br
.RI "\fIReturns true if the specified group is known. \fP"
.ti -1c
.RI "virtual \fBKEntryMap\fP \fBinternalEntryMap\fP (const  \fBQString\fP &pGroup) const "
.br
.RI "\fIReturns a map (tree) of the entries in the specified group. \fP"
.ti -1c
.RI "virtual \fBKEntryMap\fP \fBinternalEntryMap\fP () const "
.br
.RI "\fIReturns a copy of the internal map used to hold all entries. \fP"
.ti -1c
.RI "virtual void \fBputData\fP (const  \fBKEntryKey\fP &_key, const  \fBKEntry\fP &_data, bool _checkGroup=true)"
.br
.RI "\fIInserts a (key, value) pair into the internal storage mechanism of the configuration object. \fP"
.ti -1c
.RI "virtual \fBKEntry\fP \fBlookupData\fP (const  \fBKEntryKey\fP &_key) const "
.br
.RI "\fILooks up an entry in the config object's internal structure. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBKEntryMap\fP \fBaEntryMap\fP"
.br
.RI "\fIContains all key,value entries, as well as some 'special' keys which indicate the start of a group of entries. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Access \fBKDE\fP Configuration entries. \fBKDE\fP Configuration Management class. 

This class implements KDE's default configuration system.
.PP
\fBAuthor:\fP
.RS 4
Kalle Dalheimer <kalle@kde.org>, Preston Brown <pbrown@kde.org> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkconfig.h\fP,v 1.51 2002/09/28 12:28:47 tjansen Exp 
.RE
.PP
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKGlobal::config()\fP, \fBKConfigBase\fP, \fBKSimpleConfig\fP 
.RE
.PP

.PP
Definition at line 43 of file kconfig.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KConfig::KConfig (const \fBQString\fP & fileName = QString::null, bool bReadOnly = false, bool bUseKDEGlobals = true, const char * resType = 'config')"
.PP
Constructs a KConfig object. \fBParameters:\fP
.RS 4
\fIfileName\fP A file to parse in addition to the system-wide file(s). If it is not provided, only global \fBKDE\fP configuration data will be read (depending on the value of \fCbUseKDEGlobals\fP). 
.br
\fIbReadOnly\fP Set the config object's read-only status. Note that the object will automatically become read-only if either the user does not have write permission to \fCfileName\fP or if no file was specified. 
.br
\fIbUseKDEGlobals\fP Toggle reading the global \fBKDE\fP configuration file. 
.br
\fIresType\fP the place to look in (config, data, etc) See \fBKStandardDirs\fP. 
.RE
.PP
Definition at line 43 of file kconfig.cpp.
.PP
References KStandardDirs::addCustomized(), KConfigBase::backEnd, KGlobal::dirs(), reparseConfiguration(), and KConfigBase::setReadOnly().
.SS "KConfig::~\fBKConfig\fP ()\fC [virtual]\fP"
.PP
Destructs the KConfig object. Writes back any dirty configuration entries, and destroys dynamically created objects. Definition at line 76 of file kconfig.cpp.
.PP
References KConfigBase::backEnd, and KConfigBase::sync().
.SH "Member Function Documentation"
.PP 
.SS "void KConfig::rollback (bool bDeep = true)\fC [virtual]\fP"
.PP
Clears all entries out of the \fCdirtyEntryMap\fP, so the values will not be written to disk on a later call to \fBsync\fP(). \fBParameters:\fP
.RS 4
\fIbDeep\fP 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.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKConfigBase::rollback\fP 
.RE
.PP
Reimplemented from \fBKConfigBase\fP.
.PP
Definition at line 83 of file kconfig.cpp.
.PP
References aEntryMap, QMap::begin(), QMap::end(), and KConfigBase::rollback().
.PP
Referenced by KSimpleConfig::sync().
.SS "\fBQStringList\fP KConfig::groupList () const\fC [virtual]\fP"
.PP
Returns a list of groups that are known. \fBReturns:\fP
.RS 4
a list of of groups 
.RE
.PP
Implements \fBKConfigBase\fP.
.PP
Definition at line 96 of file kconfig.cpp.
.PP
References aEntryMap, QMap::begin(), QMap::end(), QString::fromUtf8(), KConfigBase::group(), and QMap::isEmpty().
.SS "\fBQMap\fP< \fBQString\fP, \fBQString\fP > KConfig::entryMap (const \fBQString\fP & pGroup) const\fC [virtual]\fP"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIpGroup\fP A group to get keys from. 
.RE
.PP
\fBReturns:\fP
.RS 4
A map of entries in the group specified, indexed by key. The returned map may be empty if the group is not found. 
.RE
.PP
Implements \fBKConfigBase\fP.
.PP
Definition at line 130 of file kconfig.cpp.
.PP
References aEntryMap, QMap::end(), QMap::find(), QString::fromUtf8(), QMap::insert(), and QString::utf8().
.PP
Referenced by KStandardDirs::addCustomized().
.SS "void KConfig::reparseConfiguration ()\fC [virtual]\fP"
.PP
Clears all internal data structures and then reread configuration information from disk. Implements \fBKConfigBase\fP.
.PP
Definition at line 150 of file kconfig.cpp.
.PP
References aEntryMap, QMap::clear(), QMap::insert(), and KConfigBase::parseConfigFiles().
.PP
Referenced by checkUpdate(), KInstance::config(), KInstance::dirs(), KConfig(), KDesktopFile::KDesktopFile(), and KSimpleConfig::KSimpleConfig().
.SS "void KConfig::setFileWriteMode (int mode)"
.PP
Set the file mode for newly created files. \fBParameters:\fP
.RS 4
\fImode\fP the mode for new files as described in chmod(2) 
.RE
.PP
\fBSee also:\fP
.RS 4
man:chmod(2) for a description of \fCmode\fP 
.RE
.PP
Definition at line 259 of file kconfig.cpp.
.PP
References KConfigBase::backEnd, and KConfigBackEnd::setFileWriteMode().
.SS "void KConfig::setForceGlobal (bool force)\fC [inline]\fP"
.PP
Forces all following write-operations being performed on kdeglobals, independent of the bGlobal flag in \fBwriteEntry()\fP. \fBParameters:\fP
.RS 4
\fIforce\fP true to force writing in kdeglobals 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBforceGlobal\fP 
.RE
.PP
Definition at line 126 of file kconfig.h.
.SS "bool KConfig::forceGlobal () const\fC [inline]\fP"
.PP
Returns true if all entries are being written into kdeglobals. \fBReturns:\fP
.RS 4
true if all entries are being written into kdeglobals 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetForceGlobal\fP 
.RE
.PP
Definition at line 133 of file kconfig.h.
.SS "void KConfig::checkUpdate (const \fBQString\fP & id, const \fBQString\fP & updateFile)"
.PP
Checks whether the config file contains the update \fCid\fP as contained in \fCupdateFile\fP. If not, it runs kconf_update to update the config file.
.PP
If you install config update files with critical fixes you may wish to use this method to verify that a critical update has indeed been performed to catch the case where a user restores an old config file from backup that has not been updated yet. 
.PP
\fBParameters:\fP
.RS 4
\fIid\fP the update to check 
.br
\fIupdateFile\fP the file containing the update 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 264 of file kconfig.cpp.
.PP
References KConfigBase::group(), KApplication::kdeinitExecWait(), KConfigBase::readListEntry(), reparseConfiguration(), and KConfigBase::setGroup().
.SS "bool KConfig::internalHasGroup (const \fBQCString\fP & group) const\fC [protected, virtual]\fP"
.PP
Returns true if the specified group is known. \fBParameters:\fP
.RS 4
\fIgroup\fP The group to search for. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the group exists. 
.RE
.PP
Implements \fBKConfigBase\fP.
.PP
Definition at line 238 of file kconfig.cpp.
.PP
References aEntryMap, QMap::end(), QMap::find(), and QMap::isEmpty().
.SS "\fBKEntryMap\fP KConfig::internalEntryMap (const \fBQString\fP & pGroup) const\fC [protected, virtual]\fP"
.PP
Returns a map (tree) of the entries in the specified group. Do not use this function, the implementation / return type are subject to change.
.PP
\fBParameters:\fP
.RS 4
\fIpGroup\fP the group to provide a KEntryMap for. 
.RE
.PP
\fBReturns:\fP
.RS 4
The map of the entries in the group. 
.RE
.PP
Implements \fBKConfigBase\fP.
.PP
Definition at line 163 of file kconfig.cpp.
.PP
References aEntryMap, QMap::end(), QMap::find(), QMap::insert(), and QString::utf8().
.SS "virtual \fBKEntryMap\fP KConfig::internalEntryMap () const\fC [inline, protected, virtual]\fP"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIpGroup\fP the group to provide a KEntryMap for. 
.RE
.PP
\fBReturns:\fP
.RS 4
The map of the entries in the group. 
.RE
.PP
Implements \fBKConfigBase\fP.
.PP
Definition at line 183 of file kconfig.h.
.PP
References aEntryMap.
.SS "void KConfig::putData (const \fBKEntryKey\fP & _key, const \fBKEntry\fP & _data, bool _checkGroup = true)\fC [protected, virtual]\fP"
.PP
Inserts a (key, value) pair into the internal storage mechanism of the configuration object. \fBParameters:\fP
.RS 4
\fI_key\fP 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. 
.br
\fI_data\fP the \fBKEntry\fP that is to be stored. 
.br
\fI_checkGroup\fP When false, assume that the group already exists. 
.RE
.PP
Implements \fBKConfigBase\fP.
.PP
Definition at line 187 of file kconfig.cpp.
.PP
References aEntryMap, KEntryKey::bDefault, KEntry::bGlobal, KEntry::bImmutable, KStdAccel::key(), and KEntryKey::mGroup.
.SS "\fBKEntry\fP KConfig::lookupData (const \fBKEntryKey\fP & _key) const\fC [protected, virtual]\fP"
.PP
Looks up an entry in the config object's internal structure. \fBParameters:\fP
.RS 4
\fI_key\fP The key to look up It contains information both on the group of the key and the entry's key itself. 
.RE
.PP
\fBReturns:\fP
.RS 4
the \fBKEntry\fP value (data) found for the key. KEntry.aValue will be the null string if nothing was located. 
.RE
.PP
Implements \fBKConfigBase\fP.
.PP
Definition at line 222 of file kconfig.cpp.
.PP
References aEntryMap, KEntry::bDeleted, QMap::end(), and QMap::find().
.SH "Member Data Documentation"
.PP 
.SS "\fBKEntryMap\fP \fBKConfig::aEntryMap\fP\fC [protected]\fP"
.PP
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 \fBKEntryKey\fP set to QString::null. Definition at line 214 of file kconfig.h.
.PP
Referenced by entryMap(), groupList(), internalEntryMap(), internalHasGroup(), lookupData(), putData(), reparseConfiguration(), and rollback().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
