KConfigINIBackEnd Class Reference

`#include <kconfigbackend.h>`

Inheritance diagram for KConfigINIBackEnd:

## Public Member Functions

| KConfigINIBackEnd (KConfigBase *_config, const QString &_fileName, const char *_resType, bool _useKDEGlobals=true)
virtual | ~KConfigINIBackEnd ()
bool | parseConfigFiles ()
virtual void | sync (bool bMerge=true)
Public Member Functions inherited from KConfigBackEnd
| KConfigBackEnd (KConfigBase *_config, const QString &_fileName, const char *_resType, bool _useKDEGlobals)
virtual | ~KConfigBackEnd ()
void | changeFileName (const QString &_fileName, const char *_resType, bool _useKDEGlobals)
virtual KConfigBase::ConfigState | getConfigState () const
QString | fileName () const
const char * | resource () const
void | setLocaleString (const QCString &_localeString)
void | setFileWriteMode (int mode)
bool | checkConfigFilesWritable (bool warnUser)
KLockFile::Ptr | lockFile (bool bGlobal=false)
KDE_DEPRECATED QString | filename () const

## Protected Member Functions

void | parseSingleConfigFile (QFile &rFile, KEntryMap *pWriteBackMap=0L, bool bGlobal=false, bool bDefault=false)
bool | writeConfigFile (QString filename, bool bGlobal=false, bool bMerge=true)
bool | getEntryMap (KEntryMap &map, bool bGlobal, QFile *mergeFile)
void | writeEntries (FILE *pStream, const KEntryMap &aTempMap)
virtual void | virtual_hook (int id, void *data)

## Additional Inherited Members

Protected Attributes inherited from KConfigBackEnd
KConfigBase * | pConfig
QString | mfileName
QCString | resType
bool | useKDEGlobals: 1
bool | bFileImmutable: 1
QCString | localeString
QString | mLocalFileName
QString | mGlobalFileName
KConfigBase::ConfigState | mConfigState
int | mFileMode
KConfigBackEndPrivate * | d

## Detailed Description

Class for KDE INI-style configuration file loading/saving.

Author
  Preston Brown pbrow.nosp@m.n@kd.nosp@m.e.org, Matthias Kalle Dalheimer kalle.nosp@m.@kde.nosp@m..org

Definition at line 190 of file kconfigbackend.h.

## Constructor & Destructor Documentation

KConfigINIBackEnd::KConfigINIBackEnd | ( | KConfigBase * | _config,
|  | const QString & | _fileName,
|  | const char * | _resType,
|  | bool | _useKDEGlobals = `true`
| ) |  |

inline

Constructs an ini-style 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 209 of file kconfigbackend.h.

virtual KConfigINIBackEnd::~KConfigINIBackEnd | ( |  | ) |

inline virtual

Destructs the configuration backend.

Definition at line 216 of file kconfigbackend.h.

## Member Function Documentation

bool KConfigINIBackEnd::getEntryMap | ( | KEntryMap & | map,
|  | bool | bGlobal,
|  | QFile * | mergeFile
| ) |  |

protected

Get the entry map.

Parameters

  map | the entries will be stored in this object.
  bGlobal | Specifies whether to get only entries which are marked as belonging to the global KDE config file. If this is false, it skips those entries.
  mergeFile | if not null, the dirty entries for this file will be merged.

Returns
  Whether there will be some entries left for writing to other files.

Definition at line 926 of file kconfigbackend.cpp.

bool KConfigINIBackEnd::parseConfigFiles | ( |  | ) |

virtual

Parses all INI-style configuration files for a config object.

Returns
  Whether or not parsing was successful.

Implements KConfigBackEnd.

Definition at line 316 of file kconfigbackend.cpp.

void KConfigINIBackEnd::parseSingleConfigFile | ( | QFile & | rFile,
|  | KEntryMap * | pWriteBackMap = `0L`,
|  | bool | bGlobal = `false`,
|  | bool | bDefault = `false`
| ) |  |

protected

Parses one configuration file.

Parameters

  rFile | The configuration file to parse
  pWriteBackMap | If specified, points to a KEntryMap where the data read from the file should be stored, instead of inserting them directly into the configuration object. Use this area as a "scratchpad" when you need to know what is on disk but don't want to effect the configuration object.
  bGlobal | Specifies whether entries should be marked as belonging to the global KDE configuration file rather than the application-specific KDE configuration file(s).
  bDefault | Specifies whether entries should be marked as being default values.

Definition at line 446 of file kconfigbackend.cpp.

void KConfigINIBackEnd::sync | ( | bool | bMerge = `true` | ) |

virtual

Writes configuration data to file(s).

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.

Implements KConfigBackEnd.

Definition at line 736 of file kconfigbackend.cpp.

bool KConfigINIBackEnd::writeConfigFile | ( | QString | filename,
|  | bool | bGlobal = `false`,
|  | bool | bMerge = `true`
| ) |  |

protected

Writes configuration file back.

Parameters

  filename | The name of the file to write.
  bGlobal | Specifies whether to write only entries which are marked as belonging to the global KDE config file. If this is false, it skips those entries.
  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.

Returns
  Whether some entries are left to be written to other files.

Definition at line 980 of file kconfigbackend.cpp.

void KConfigINIBackEnd::writeEntries | ( | FILE * | pStream,
|  | const KEntryMap & | aTempMap
| ) |  |

protected

Write the entries in aTempMap to the file stream.

Definition at line 1083 of file kconfigbackend.cpp.

The documentation for this class was generated from the following files:

- kconfigbackend.h
- kconfigbackend.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys