#include <tdeconfigbackend.h>

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.
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
-
_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.
Definition at line 300 of file tdeconfigbackend.cpp.
◆ ~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
-
_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.
Definition at line 243 of file tdeconfigbackend.cpp.
◆ checkConfigFilesWritable()
bool TDEConfigBackEnd::checkConfigFilesWritable | ( | bool | warnUser | ) |
Check whether the config files are writable.
- Parameters
-
warnUser Warn 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()
|
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()
|
inline |
- Deprecated:
- Use fileName() instead
Definition at line 162 of file tdeconfigbackend.h.
◆ getConfigState()
|
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
-
bGlobal If true, returns a lock file object for kdeglobals
- Since
- 3.3
Definition at line 273 of file tdeconfigbackend.cpp.
◆ 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()
|
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
-
mode the filemode (as in chmod)
Definition at line 315 of file tdeconfigbackend.cpp.
◆ setLocaleString()
|
inline |
Set the locale string that defines the current language.
- Parameters
-
_localeString the identifier of the language
- See also
- TDELocale
Definition at line 133 of file tdeconfigbackend.h.
◆ sync()
|
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 TDEConfigINIBackEnd.
◆ virtual_hook()
|
protectedvirtual |
Definition at line 1149 of file tdeconfigbackend.cpp.
Friends And Related Function Documentation
◆ TDEConfig
|
friend |
Definition at line 50 of file tdeconfigbackend.h.
◆ TDESharedConfig
|
friend |
Definition at line 51 of file tdeconfigbackend.h.
Member Data Documentation
◆ bFileImmutable
|
protected |
Definition at line 170 of file tdeconfigbackend.h.
◆ d
|
protected |
Definition at line 181 of file tdeconfigbackend.h.
◆ localeString
|
protected |
Definition at line 171 of file tdeconfigbackend.h.
◆ mConfigState
|
protected |
Definition at line 174 of file tdeconfigbackend.h.
◆ mFileMode
|
protected |
Definition at line 175 of file tdeconfigbackend.h.
◆ mfileName
|
protected |
Definition at line 167 of file tdeconfigbackend.h.
◆ mGlobalFileName
|
protected |
Definition at line 173 of file tdeconfigbackend.h.
◆ mLocalFileName
|
protected |
Definition at line 172 of file tdeconfigbackend.h.
◆ pConfig
|
protected |
Definition at line 165 of file tdeconfigbackend.h.
◆ resType
|
protected |
Definition at line 168 of file tdeconfigbackend.h.
◆ useKDEGlobals
|
protected |
Definition at line 169 of file tdeconfigbackend.h.
The documentation for this class was generated from the following files: