Main Page   Class Hierarchy   Compound List   File List   Compound Members  

config::KConfigBackEnd Class Reference

Abstract base class for KDE configuration file loading/saving. KDE Configuration file loading/saving abstract base class. More...

#include <kconfigbackend.h>

Inheritance diagram for config::KConfigBackEnd:

config::KConfigINIBackEnd List of all members.

Public Methods

 KConfigBackEnd (KConfigBase *_config, const string &_fileName, const char *_resType, bool _useKDEGlobals)
 Constructs a configuration back end. More...

virtual ~KConfigBackEnd ()
 Destructs the configuration backend.

virtual bool parseConfigFiles ()=0
 Parses all configuration files for a configuration object. More...

virtual void sync (bool bMerge=true)=0
 Writes configuration data to file(s). More...

void changeFileName (const string &_fileName, const char *_resType, bool _useKDEGlobals)
 Changes the filenames associated with this back end. More...

virtual KConfigBase::ConfigState getConfigState () const
 Returns the state of the app-config object. More...

string fileName () const
const char * resource () const
void setLocaleString (const string &_localeString)
void setFileWriteMode (int mode)
 Set the file mode for newly created files.

string filename () const

Protected Methods

virtual void virtual_hook (int id, void *data)

Protected Attributes

KConfigBasepConfig
string mfileName
string resType
bool useKDEGlobals: 1
bool bFileImmutable: 1
string localeString
string mLocalFileName
string mGlobalFileName
KConfigBase::ConfigState mConfigState
int mFileMode

Detailed Description

Abstract base class for KDE configuration file loading/saving. KDE Configuration file loading/saving abstract base class.

This class forms the base for all classes that implement some manner of loading/saving to configuration files. It is an abstract base class, meaning that you cannot directly instantiate objects of this class. As of right now, the only back end available is one to read/write to INI-style files, but in the future, other formats may be available, such as XML or a database.

Author:
Preston Brown <pbrown@kde.org>, Matthias Kalle Dalheimer <kalle@kde.org>
Version:
Id:
kconfigbackend.h,v 1.1.1.1 2002/12/01 04:08:23 zl Exp


Constructor & Destructor Documentation

config::KConfigBackEnd::KConfigBackEnd KConfigBase   _config,
const string &    _fileName,
const char *    _resType,
bool    _useKDEGlobals
 

Constructs a configuration back end.

Parameters:
_config  Specifies the configuration object which values will be passed to as they are read, or from where values to be written to will be obtained from.
_fileName  The name of the file in which config data is stored. All registered configuration directories will be looked in in order of decreasing relevance.
_resType  the resource type of the fileName specified, _if_ it is not an absolute path (otherwise this parameter is ignored).
_useKDEGlobals  If true, the user's system-wide kdeglobals file will be imported into the config object. If false, only the filename specified will be dealt with.


Member Function Documentation

void config::KConfigBackEnd::changeFileName const string &    _fileName,
const char *    _resType,
bool    _useKDEGlobals
 

Changes the filenames associated with this back end.

You should probably reparse your config info after doing this.

Parameters:
_fileName  the new filename to use
_resType  the resource type of the fileName specified, _if_ it is not an absolute path (otherwise this parameter is ignored).
_useKDEGlobals  specifies whether or not to also parse the global KDE configuration files.

string config::KConfigBackEnd::filename   const [inline]
 

Deprecated:
Use
See also:
fileName() instead

string config::KConfigBackEnd::fileName   const [inline]
 

Returns:
the filename as passed to the constructor.

virtual KConfigBase::ConfigState config::KConfigBackEnd::getConfigState   const [inline, virtual]
 

Returns the state of the app-config object.

See also:
KConfig::getConfigState

virtual bool config::KConfigBackEnd::parseConfigFiles   [pure virtual]
 

Parses all configuration files for a configuration object.

This method must be reimplemented by the derived classes.

Returns:
Whether or not parsing was successful.

Implemented in config::KConfigINIBackEnd.

const char* config::KConfigBackEnd::resource   const [inline]
 

Returns:
the resource type as passed to the constructor.

virtual void config::KConfigBackEnd::sync bool    bMerge = true [pure virtual]
 

Writes configuration data to file(s).

This method must be reimplemented by the derived classes.

Parameters:
bMerge  Specifies whether the old config file already on disk should be merged in with the data in memory. If true, data is read off the disk and merged. If false, the on-disk file is removed and only in-memory data is written out.

Implemented in config::KConfigINIBackEnd.


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