• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
KConfigBackEnd Class Referenceabstract

#include <kconfigbackend.h>

Inheritance diagram for KConfigBackEnd:
KConfigINIBackEnd

Public Member Functions

 KConfigBackEnd (KConfigBase *_config, const TQString &_fileName, const char *_resType, bool _useKDEGlobals)
 
virtual ~KConfigBackEnd ()
 
virtual bool parseConfigFiles ()=0
 
virtual void sync (bool bMerge=true)=0
 
void changeFileName (const TQString &_fileName, const char *_resType, bool _useKDEGlobals)
 
virtual KConfigBase::ConfigState getConfigState () const
 
TQString fileName () const
 
const char * resource () const
 
void setLocaleString (const TQCString &_localeString)
 
void setFileWriteMode (int mode)
 
bool checkConfigFilesWritable (bool warnUser)
 
KLockFile::Ptr lockFile (bool bGlobal=false)
 
KDE_DEPRECATED TQString filename () const
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Protected Attributes

KConfigBase * pConfig
 
TQString mfileName
 
TQCString resType
 
bool useKDEGlobals: 1
 
bool bFileImmutable: 1
 
TQCString localeString
 
TQString mLocalFileName
 
TQString mGlobalFileName
 
KConfigBase::ConfigState mConfigState
 
int mFileMode
 
KConfigBackEndPrivate * d
 

Friends

class KConfig
 
class KSharedConfig
 

Detailed Description

Abstract base class for KDE configuration file loading/saving.

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 pbrow.nosp@m.n@kd.nosp@m.e.org, Matthias Kalle Dalheimer kalle.nosp@m.@kde.nosp@m..org KDE Configuration file loading/saving abstract base class

Definition at line 48 of file kconfigbackend.h.

Constructor & Destructor Documentation

KConfigBackEnd::KConfigBackEnd ( KConfigBase *  _config,
const TQString &  _fileName,
const char *  _resType,
bool  _useKDEGlobals 
)

Constructs a configuration back end.

Parameters
_configSpecifies 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.
_fileNameThe name of the file in which config data is stored. All registered configuration directories will be looked in in order of decreasing relevance.
<em>resTypethe resource type of the fileName specified, _if it is not an absolute path (otherwise this parameter is ignored).
_useKDEGlobalsIf 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.

Definition at line 300 of file kconfigbackend.cpp.

KConfigBackEnd::~KConfigBackEnd ( )
virtual

Destructs the configuration backend.

Definition at line 310 of file kconfigbackend.cpp.

Member Function Documentation

void KConfigBackEnd::changeFileName ( const TQString &  _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
_fileNamethe new filename to use
<em>resTypethe resource type of the fileName specified, _if it is not an absolute path (otherwise this parameter is ignored).
_useKDEGlobalsspecifies whether or not to also parse the global KDE configuration files.

Definition at line 243 of file kconfigbackend.cpp.

bool KConfigBackEnd::checkConfigFilesWritable ( bool  warnUser)

Check whether the config files are writable.

Parameters
warnUserWarn the user if the configuration files are not writable.
Returns
Indicates that all of the configuration files used are writable.
Since
3.2

Definition at line 1155 of file kconfigbackend.cpp.

TQString KConfigBackEnd::fileName ( ) const
inline

Returns the filename as passed to the constructor.

Returns
the filename as passed to the constructor.

Definition at line 120 of file kconfigbackend.h.

KDE_DEPRECATED TQString KConfigBackEnd::filename ( ) const
inline
Deprecated:
Use fileName() instead

Definition at line 162 of file kconfigbackend.h.

virtual KConfigBase::ConfigState KConfigBackEnd::getConfigState ( ) const
inlinevirtual

Returns the state of the app-config object.

See also
KConfig::getConfigState

Definition at line 113 of file kconfigbackend.h.

KLockFile::Ptr KConfigBackEnd::lockFile ( bool  bGlobal = false)

Returns a lock file object for the configuration file.

Parameters
bGlobalIf true, returns a lock file object for kdeglobals
Since
3.3

Definition at line 273 of file kconfigbackend.cpp.

virtual bool 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 KConfigINIBackEnd.

const char* KConfigBackEnd::resource ( ) const
inline

Returns the resource type as passed to the constructor.

Returns
the resource type as passed to the constructor.

Definition at line 126 of file kconfigbackend.h.

void KConfigBackEnd::setFileWriteMode ( int  mode)

Set the file mode for newly created files.

Parameters
modethe filemode (as in chmod)

Definition at line 315 of file kconfigbackend.cpp.

void KConfigBackEnd::setLocaleString ( const TQCString &  _localeString)
inline

Set the locale string that defines the current language.

Parameters
_localeStringthe identifier of the language
See also
KLocale

Definition at line 133 of file kconfigbackend.h.

virtual void KConfigBackEnd::sync ( bool  bMerge = true)
pure virtual

Writes configuration data to file(s).

This method must be reimplemented by the derived classes.

Parameters
bMergeSpecifies 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 KConfigINIBackEnd.


The documentation for this class was generated from the following files:
  • kconfigbackend.h
  • kconfigbackend.cpp

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |