\section{KConfig\-INIBack\-End Class Reference}
\label{classKConfigINIBackEnd}\index{KConfigINIBackEnd@{KConfigINIBackEnd}}
Class for {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} INI-style configuration file loading/saving.  


{\tt \#include $<$kconfigbackend.h$>$}

Inheritance diagram for KConfig\-INIBack\-End:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=76pt]{classKConfigINIBackEnd__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KConfig\-INIBack\-End:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=224pt]{classKConfigINIBackEnd__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KConfig\-INIBack\-End} ({\bf KConfig\-Base} $\ast$\_\-config, const  {\bf QString} \&\_\-file\-Name, const  char $\ast$\_\-res\-Type, bool \_\-use\-KDEGlobals=true)
\begin{CompactList}\small\item\em Constructs an ini-style configuration back end. \item\end{CompactList}\item 
virtual {\bf $\sim$KConfig\-INIBack\-End} ()
\begin{CompactList}\small\item\em Destructs the configuration backend. \item\end{CompactList}\item 
bool {\bf parse\-Config\-Files} ()
\begin{CompactList}\small\item\em Parses all INI-style configuration files for a config object. \item\end{CompactList}\item 
virtual void {\bf sync} (bool b\-Merge=true)
\begin{CompactList}\small\item\em Writes configuration data to file(s). \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf parse\-Single\-Config\-File} ({\bf QFile} \&r\-File, {\bf KEntry\-Map} $\ast$p\-Write\-Back\-Map=0L, bool b\-Global=false, bool b\-Default=false)
\begin{CompactList}\small\item\em Parses one configuration file. \item\end{CompactList}\item 
bool {\bf write\-Config\-File} ({\bf QString} filename, bool b\-Global=false, bool b\-Merge=true)
\begin{CompactList}\small\item\em Writes configuration file back. \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKConfigINIBackEnd_b2}

\end{CompactItemize}


\subsection{Detailed Description}
Class for {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} INI-style configuration file loading/saving. 

\begin{Desc}
\item[Author:]Preston Brown $<${\tt pbrown@kde.org}$>$, Matthias Kalle Dalheimer $<${\tt kalle@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kconfigbackend.h}{\rm (p.\,\pageref{kconfigbackend_8h})},v 1.22 2002/09/17 21:24:43 tjansen Exp \end{Desc}
\end{Desc}




Definition at line 174 of file kconfigbackend.h.

\subsection{Constructor \& Destructor Documentation}
\index{KConfigINIBackEnd@{KConfig\-INIBack\-End}!KConfigINIBackEnd@{KConfigINIBackEnd}}
\index{KConfigINIBackEnd@{KConfigINIBackEnd}!KConfigINIBackEnd@{KConfig\-INIBack\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KConfig\-INIBack\-End::KConfig\-INIBack\-End ({\bf KConfig\-Base} $\ast$ {\em \_\-config}, const {\bf QString} \& {\em \_\-file\-Name}, const char $\ast$ {\em \_\-res\-Type}, bool {\em \_\-use\-KDEGlobals} = true)\hspace{0.3cm}{\tt  [inline]}}\label{classKConfigINIBackEnd_a0}


Constructs an ini-style configuration back end. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-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. \item[{\em \_\-file\-Name}]The name of the file in which config data is stored. All registered configuration directories will be looked in in order of decreasing relevance. \item[{\em \_\-res\-Type}]the resource type of the file\-Name specified, \_\-if\_\- it is not an absolute path (otherwise this parameter is ignored). \item[{\em \_\-use\-KDEGlobals}]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. \end{description}
\end{Desc}


Definition at line 193 of file kconfigbackend.h.\index{KConfigINIBackEnd@{KConfig\-INIBack\-End}!~KConfigINIBackEnd@{$\sim$KConfigINIBackEnd}}
\index{~KConfigINIBackEnd@{$\sim$KConfigINIBackEnd}!KConfigINIBackEnd@{KConfig\-INIBack\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual KConfig\-INIBack\-End::$\sim${\bf KConfig\-INIBack\-End} ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKConfigINIBackEnd_a1}


Destructs the configuration backend. 



Definition at line 200 of file kconfigbackend.h.

\subsection{Member Function Documentation}
\index{KConfigINIBackEnd@{KConfig\-INIBack\-End}!parseConfigFiles@{parseConfigFiles}}
\index{parseConfigFiles@{parseConfigFiles}!KConfigINIBackEnd@{KConfig\-INIBack\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KConfig\-INIBack\-End::parse\-Config\-Files ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKConfigINIBackEnd_a2}


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

\begin{Desc}
\item[Returns:]Whether or not parsing was successful. \end{Desc}


Implements {\bf KConfig\-Back\-End} {\rm (p.\,\pageref{classKConfigBackEnd_a2})}.

Definition at line 198 of file kconfigbackend.cpp.

References QFile::close(), KURL::directory(), KGlobal::dirs(), QString::from\-Latin1(), QCString::is\-Empty(), QString::is\-Empty(), KConfig\-Base::is\-Read\-Only(), KStandard\-Dirs::is\-Restricted\-Resource(), KStandard\-Dirs::make\-Dir(), QFile::open(), parse\-Single\-Config\-File(), KConfig\-Back\-End::set\-Locale\-String(), KURL::set\-Path(), and QString::utf8().\index{KConfigINIBackEnd@{KConfig\-INIBack\-End}!sync@{sync}}
\index{sync@{sync}!KConfigINIBackEnd@{KConfig\-INIBack\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-INIBack\-End::sync (bool {\em b\-Merge} = true)\hspace{0.3cm}{\tt  [virtual]}}\label{classKConfigINIBackEnd_a3}


Writes configuration data to file(s). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em b\-Merge}]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. \end{description}
\end{Desc}


Implements {\bf KConfig\-Back\-End} {\rm (p.\,\pageref{classKConfigBackEnd_a3})}.

Definition at line 575 of file kconfigbackend.cpp.

References KURL::directory(), KConfig\-Base::is\-Dirty(), QString::is\-Empty(), KStandard\-Dirs::make\-Dir(), KURL::set\-Path(), and write\-Config\-File().\index{KConfigINIBackEnd@{KConfig\-INIBack\-End}!parseSingleConfigFile@{parseSingleConfigFile}}
\index{parseSingleConfigFile@{parseSingleConfigFile}!KConfigINIBackEnd@{KConfig\-INIBack\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-INIBack\-End::parse\-Single\-Config\-File ({\bf QFile} \& {\em r\-File}, {\bf KEntry\-Map} $\ast$ {\em p\-Write\-Back\-Map} = 0L, bool {\em b\-Global} = false, bool {\em b\-Default} = false)\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigINIBackEnd_b0}


Parses one configuration file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-File}]The configuration file to parse \item[{\em p\-Write\-Back\-Map}]If specified, points to a KEntry\-Map where the data read from the file should be stored, instead of inserting them directly into the configuration object. Use this area as a \char`\"{}scratchpad\char`\"{} when you need to know what is on disk but don't want to effect the configuration object. \item[{\em b\-Global}]Specifies whether entries should be marked as belonging to the global {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} configuration file rather than the application-specific {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} configuration file(s). \item[{\em b\-Default}]Specifies whether entries should be marked as being default values. \end{description}
\end{Desc}


Definition at line 313 of file kconfigbackend.cpp.

References KEntry\-Key::b\-Default, KEntry::b\-Deleted, KEntry::b\-Expand, KEntry::b\-Global, KEntry::b\-Immutable, KEntry\-Key::b\-Local, KEntry::b\-NLS, QFile::handle(), QMap::insert(), KStd\-Accel::key(), QCString::length(), KConfig\-Base::lookup\-Data(), KEntry::m\-Value, QFile::name(), KConfig\-Base::put\-Data(), QFile::read\-All(), and QFile::size().

Referenced by parse\-Config\-Files(), and write\-Config\-File().\index{KConfigINIBackEnd@{KConfig\-INIBack\-End}!writeConfigFile@{writeConfigFile}}
\index{writeConfigFile@{writeConfigFile}!KConfigINIBackEnd@{KConfig\-INIBack\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KConfig\-INIBack\-End::write\-Config\-File ({\bf QString} {\em filename}, bool {\em b\-Global} = false, bool {\em b\-Merge} = true)\hspace{0.3cm}{\tt  [protected]}}\label{classKConfigINIBackEnd_b1}


Writes configuration file back. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filename}]The name of the file to write. \item[{\em b\-Global}]Specifies whether to write only entries which are marked as belonging to the global {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} config file. If this is false, it skips those entries. \item[{\em b\-Merge}]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. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Whether some entries are left to be written to other files. \end{Desc}


Definition at line 709 of file kconfigbackend.cpp.

References KEntry::b\-Dirty, QMap::begin(), KEntry::b\-Global, KSave\-File::close(), KStd\-Action::close(), QFile::close(), QFile::encode\-Name(), QMap::end(), QMap::find(), KSave\-File::fstream(), KSave\-File::handle(), QMap::insert(), KConfig\-Base::internal\-Entry\-Map(), KConfig\-Base::is\-Read\-Only(), KStd\-Action::open(), QFile::open(), parse\-Single\-Config\-File(), QMap::replace(), and KSave\-File::status().

Referenced by sync().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kconfigbackend.h\item 
kconfigbackend.cpp\end{CompactItemize}
