#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. <em>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 <em>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.
The documentation for this class was generated from the following files: