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

tdecore

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

#include <tdeconfigbackend.h>

Inheritance diagram for TDEConfigBackEnd:
TDEConfigINIBackEnd

Public Member Functions

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

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Protected Attributes

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

Friends

class TDEConfig
 
class TDESharedConfig
 

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 tdeconfigbackend.h.

Constructor & Destructor Documentation

◆ TDEConfigBackEnd()

TDEConfigBackEnd::TDEConfigBackEnd ( TDEConfigBase *  _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.
_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 tdeconfigbackend.cpp.

◆ ~TDEConfigBackEnd()

TDEConfigBackEnd::~TDEConfigBackEnd ( )
virtual

Destructs the configuration backend.

Definition at line 310 of file tdeconfigbackend.cpp.

Member Function Documentation

◆ changeFileName()

void TDEConfigBackEnd::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
_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 tdeconfigbackend.cpp.

◆ checkConfigFilesWritable()

bool TDEConfigBackEnd::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 tdeconfigbackend.cpp.

◆ fileName()

TQString TDEConfigBackEnd::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 tdeconfigbackend.h.

◆ filename()

TDE_DEPRECATED TQString TDEConfigBackEnd::filename ( ) const
inline
Deprecated:
Use fileName() instead

Definition at line 162 of file tdeconfigbackend.h.

◆ getConfigState()

virtual TDEConfigBase::ConfigState TDEConfigBackEnd::getConfigState ( ) const
inlinevirtual

Returns the state of the app-config object.

See also
TDEConfig::getConfigState

Definition at line 113 of file tdeconfigbackend.h.

◆ lockFile()

TDELockFile::Ptr TDEConfigBackEnd::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 tdeconfigbackend.cpp.

◆ parseConfigFiles()

virtual bool TDEConfigBackEnd::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 TDEConfigINIBackEnd.

◆ resource()

const char * TDEConfigBackEnd::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 tdeconfigbackend.h.

◆ setFileWriteMode()

void TDEConfigBackEnd::setFileWriteMode ( int  mode)

Set the file mode for newly created files.

Parameters
modethe filemode (as in chmod)

Definition at line 315 of file tdeconfigbackend.cpp.

◆ setLocaleString()

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

Set the locale string that defines the current language.

Parameters
_localeStringthe identifier of the language
See also
TDELocale

Definition at line 133 of file tdeconfigbackend.h.

◆ sync()

virtual void TDEConfigBackEnd::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 TDEConfigINIBackEnd.

◆ virtual_hook()

void TDEConfigBackEnd::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 1149 of file tdeconfigbackend.cpp.

Friends And Related Function Documentation

◆ TDEConfig

friend class TDEConfig
friend

Definition at line 50 of file tdeconfigbackend.h.

◆ TDESharedConfig

friend class TDESharedConfig
friend

Definition at line 51 of file tdeconfigbackend.h.

Member Data Documentation

◆ bFileImmutable

bool TDEConfigBackEnd::bFileImmutable
protected

Definition at line 170 of file tdeconfigbackend.h.

◆ d

TDEConfigBackEndPrivate* TDEConfigBackEnd::d
protected

Definition at line 181 of file tdeconfigbackend.h.

◆ localeString

TQCString TDEConfigBackEnd::localeString
protected

Definition at line 171 of file tdeconfigbackend.h.

◆ mConfigState

TDEConfigBase::ConfigState TDEConfigBackEnd::mConfigState
protected

Definition at line 174 of file tdeconfigbackend.h.

◆ mFileMode

int TDEConfigBackEnd::mFileMode
protected

Definition at line 175 of file tdeconfigbackend.h.

◆ mfileName

TQString TDEConfigBackEnd::mfileName
protected

Definition at line 167 of file tdeconfigbackend.h.

◆ mGlobalFileName

TQString TDEConfigBackEnd::mGlobalFileName
protected

Definition at line 173 of file tdeconfigbackend.h.

◆ mLocalFileName

TQString TDEConfigBackEnd::mLocalFileName
protected

Definition at line 172 of file tdeconfigbackend.h.

◆ pConfig

TDEConfigBase* TDEConfigBackEnd::pConfig
protected

Definition at line 165 of file tdeconfigbackend.h.

◆ resType

TQCString TDEConfigBackEnd::resType
protected

Definition at line 168 of file tdeconfigbackend.h.

◆ useKDEGlobals

bool TDEConfigBackEnd::useKDEGlobals
protected

Definition at line 169 of file tdeconfigbackend.h.


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

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.