\section{KConfig\-Back\-End Class Reference}
\label{classKConfigBackEnd}\index{KConfigBackEnd@{KConfigBackEnd}}
Abstract base class for {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} configuration file loading/saving. {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} Configuration file loading/saving abstract base class.  


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

Inheritance diagram for KConfig\-Back\-End:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=70pt]{classKConfigBackEnd__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KConfig\-Back\-End:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=148pt]{classKConfigBackEnd__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KConfig\-Back\-End} ({\bf KConfig\-Base} $\ast$\_\-config, const {\bf QString} \&\_\-file\-Name, const char $\ast$\_\-res\-Type, bool \_\-use\-KDEGlobals)
\item 
virtual {\bf $\sim$KConfig\-Back\-End} ()
\item 
virtual bool {\bf parse\-Config\-Files} ()=0
\item 
virtual void {\bf sync} (bool b\-Merge=true)=0
\item 
void {\bf change\-File\-Name} (const {\bf QString} \&\_\-file\-Name, const char $\ast$\_\-res\-Type, bool \_\-use\-KDEGlobals)
\item 
virtual {\bf KConfig\-Base::Config\-State} {\bf get\-Config\-State} () const 
\item 
{\bf QString} {\bf file\-Name} () const 
\item 
const char $\ast$ {\bf resource} () const 
\item 
void {\bf set\-Locale\-String} (const {\bf QCString} \&\_\-locale\-String)
\item 
void {\bf set\-File\-Write\-Mode} (int mode)
\item 
bool {\bf check\-Config\-Files\-Writable} (bool warn\-User)
\item 
{\bf KLock\-File::Ptr} {\bf lock\-File} (bool b\-Global=false)
\item 
KDE\_\-DEPRECATED {\bf QString} {\bf filename} () const 
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKConfigBackEnd_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KConfig\-Base} $\ast$ {\bf p\-Config}\label{classKConfigBackEnd_p0}

\item 
{\bf QString} {\bf mfile\-Name}\label{classKConfigBackEnd_p1}

\item 
{\bf QCString} {\bf res\-Type}\label{classKConfigBackEnd_p2}

\item 
bool {\bf use\-KDEGlobals}: 1\label{classKConfigBackEnd_p3}

\item 
bool {\bf b\-File\-Immutable}: 1\label{classKConfigBackEnd_p4}

\item 
{\bf QCString} {\bf locale\-String}\label{classKConfigBackEnd_p5}

\item 
{\bf QString} {\bf m\-Local\-File\-Name}\label{classKConfigBackEnd_p6}

\item 
{\bf QString} {\bf m\-Global\-File\-Name}\label{classKConfigBackEnd_p7}

\item 
{\bf KConfig\-Base::Config\-State} {\bf m\-Config\-State}\label{classKConfigBackEnd_p8}

\item 
int {\bf m\-File\-Mode}\label{classKConfigBackEnd_p9}

\item 
KConfig\-Back\-End\-Private $\ast$ {\bf d}\label{classKConfigBackEnd_p10}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KConfig}\label{classKConfigBackEnd_n0}

\item 
class {\bf KShared\-Config}\label{classKConfigBackEnd_n1}

\end{CompactItemize}


\subsection{Detailed Description}
Abstract base class for {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} configuration file loading/saving. {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} Configuration file loading/saving abstract base class. 

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.

\begin{Desc}
\item[Author:]Preston Brown $<${\tt pbrown@kde.org}$>$, Matthias Kalle Dalheimer $<${\tt kalle@kde.org}$>$ \end{Desc}




Definition at line 47 of file kconfigbackend.h.

\subsection{Constructor \& Destructor Documentation}
\index{KConfigBackEnd@{KConfig\-Back\-End}!KConfigBackEnd@{KConfigBackEnd}}
\index{KConfigBackEnd@{KConfigBackEnd}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KConfig\-Back\-End::KConfig\-Back\-End ({\bf KConfig\-Base} $\ast$ {\em \_\-config}, const {\bf QString} \& {\em \_\-file\-Name}, const char $\ast$ {\em \_\-res\-Type}, bool {\em \_\-use\-KDEGlobals})}\label{classKConfigBackEnd_a0}


Constructs a 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 276 of file kconfigbackend.cpp.

References change\-File\-Name().\index{KConfigBackEnd@{KConfig\-Back\-End}!~KConfigBackEnd@{$\sim$KConfigBackEnd}}
\index{~KConfigBackEnd@{$\sim$KConfigBackEnd}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KConfig\-Back\-End::$\sim${\bf KConfig\-Back\-End} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKConfigBackEnd_a1}


Destructs the configuration backend. 



Definition at line 286 of file kconfigbackend.cpp.

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


Parses all configuration files for a configuration object. 

This method must be reimplemented by the derived classes.

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


Implemented in {\bf KConfig\-INIBack\-End} {\rm (p.\,\pageref{classKConfigINIBackEnd_a2})}.

Referenced by KConfig\-Base::parse\-Config\-Files().\index{KConfigBackEnd@{KConfig\-Back\-End}!sync@{sync}}
\index{sync@{sync}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KConfig\-Back\-End::sync (bool {\em b\-Merge} = {\tt true})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKConfigBackEnd_a3}


Writes configuration data to file(s). 

This method must be reimplemented by the derived classes.

\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}


Implemented in {\bf KConfig\-INIBack\-End} {\rm (p.\,\pageref{classKConfigINIBackEnd_a3})}.

Referenced by KConfig::reparse\-Configuration(), KSimple\-Config::sync(), and KConfig\-Base::sync().\index{KConfigBackEnd@{KConfig\-Back\-End}!changeFileName@{changeFileName}}
\index{changeFileName@{changeFileName}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Back\-End::change\-File\-Name (const {\bf QString} \& {\em \_\-file\-Name}, const char $\ast$ {\em \_\-res\-Type}, bool {\em \_\-use\-KDEGlobals})}\label{classKConfigBackEnd_a4}


Changes the filenames associated with this back end. 

You should probably reparse your config info after doing this.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-file\-Name}]the new filename to use \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}]specifies whether or not to also parse the global {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} configuration files. \end{description}
\end{Desc}


Definition at line 223 of file kconfigbackend.cpp.

References KGlobal::dirs(), QString::from\-Latin1(), QString::is\-Empty(), and KStandard\-Dirs::save\-Location().

Referenced by KConfig::copy\-To(), KConfig\-Back\-End(), KDesktop\-File::KDesktop\-File(), and KSimple\-Config::KSimple\-Config().\index{KConfigBackEnd@{KConfig\-Back\-End}!getConfigState@{getConfigState}}
\index{getConfigState@{getConfigState}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf KConfig\-Base::Config\-State} KConfig\-Back\-End::get\-Config\-State () const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKConfigBackEnd_a5}


Returns the state of the app-config object. 

\begin{Desc}
\item[See also:]{\bf KConfig::get\-Config\-State}{\rm (p.\,\pageref{classKConfigBase_a115})} \end{Desc}


Definition at line 112 of file kconfigbackend.h.

Referenced by KConfig\-Base::get\-Config\-State(), and KConfig\-Base::parse\-Config\-Files().\index{KConfigBackEnd@{KConfig\-Back\-End}!fileName@{fileName}}
\index{fileName@{fileName}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KConfig\-Back\-End::file\-Name () const\hspace{0.3cm}{\tt  [inline]}}\label{classKConfigBackEnd_a6}


Returns the filename as passed to the constructor. 

\begin{Desc}
\item[Returns:]the filename as passed to the constructor. \end{Desc}


Definition at line 119 of file kconfigbackend.h.

Referenced by KDesktop\-File::file\-Name().\index{KConfigBackEnd@{KConfig\-Back\-End}!resource@{resource}}
\index{resource@{resource}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ KConfig\-Back\-End::resource () const\hspace{0.3cm}{\tt  [inline]}}\label{classKConfigBackEnd_a7}


Returns the resource type as passed to the constructor. 

\begin{Desc}
\item[Returns:]the resource type as passed to the constructor. \end{Desc}


Definition at line 125 of file kconfigbackend.h.

Referenced by KDesktop\-File::resource().\index{KConfigBackEnd@{KConfig\-Back\-End}!setLocaleString@{setLocaleString}}
\index{setLocaleString@{setLocaleString}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Back\-End::set\-Locale\-String (const {\bf QCString} \& {\em \_\-locale\-String})\hspace{0.3cm}{\tt  [inline]}}\label{classKConfigBackEnd_a8}


Set the locale string that defines the current language. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-locale\-String}]the identifier of the language \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KLocale}{\rm (p.\,\pageref{classKLocale})} \end{Desc}


Definition at line 132 of file kconfigbackend.h.

Referenced by KConfig\-INIBack\-End::parse\-Config\-Files(), and KConfig\-Base::set\-Locale().\index{KConfigBackEnd@{KConfig\-Back\-End}!setFileWriteMode@{setFileWriteMode}}
\index{setFileWriteMode@{setFileWriteMode}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KConfig\-Back\-End::set\-File\-Write\-Mode (int {\em mode})}\label{classKConfigBackEnd_a9}


Set the file mode for newly created files. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]the filemode (as in chmod) \end{description}
\end{Desc}


Definition at line 291 of file kconfigbackend.cpp.

Referenced by KConfig::set\-File\-Write\-Mode().\index{KConfigBackEnd@{KConfig\-Back\-End}!checkConfigFilesWritable@{checkConfigFilesWritable}}
\index{checkConfigFilesWritable@{checkConfigFilesWritable}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KConfig\-Back\-End::check\-Config\-Files\-Writable (bool {\em warn\-User})}\label{classKConfigBackEnd_a10}


Check whether the config files are writable. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em warn\-User}]Warn the user if the configuration files are not writable. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Indicates that all of the configuration files used are writable. \end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 1080 of file kconfigbackend.cpp.

References QString::arg(), KStandard\-Dirs::find\-Exe(), KInstance::instance\-Name(), QString::is\-Empty(), QString::local8Bit(), and KProcess::start().

Referenced by KConfig\-Base::check\-Config\-Files\-Writable().\index{KConfigBackEnd@{KConfig\-Back\-End}!lockFile@{lockFile}}
\index{lockFile@{lockFile}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KLock\-File::Ptr} KConfig\-Back\-End::lock\-File (bool {\em b\-Global} = {\tt false})}\label{classKConfigBackEnd_a11}


Returns a lock file object for the configuration file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em b\-Global}]If true, returns a lock file object for kdeglobals \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}


Definition at line 249 of file kconfigbackend.cpp.

References QString::is\-Empty().

Referenced by KConfig::lock\-File(), and KConfig\-INIBack\-End::sync().\index{KConfigBackEnd@{KConfig\-Back\-End}!filename@{filename}}
\index{filename@{filename}!KConfigBackEnd@{KConfig\-Back\-End}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDE\_\-DEPRECATED {\bf QString} KConfig\-Back\-End::filename () const\hspace{0.3cm}{\tt  [inline]}}\label{classKConfigBackEnd_a12}


\begin{Desc}
\item[{\bf Deprecated}]Use\end{Desc}
\begin{Desc}
\item[See also:]{\bf file\-Name()}{\rm (p.\,\pageref{classKConfigBackEnd_a6})} instead \end{Desc}


Definition at line 161 of file kconfigbackend.h.

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