\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=76pt]{classKConfigBackEnd__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KConfig\-Back\-End:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=159pt]{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)
\begin{CompactList}\small\item\em Constructs a configuration back end. \item\end{CompactList}\item 
virtual {\bf $\sim$KConfig\-Back\-End} ()
\begin{CompactList}\small\item\em Destructs the configuration backend. \item\end{CompactList}\item 
virtual bool {\bf parse\-Config\-Files} ()=0
\begin{CompactList}\small\item\em Parses all configuration files for a configuration object. \item\end{CompactList}\item 
virtual void {\bf sync} (bool b\-Merge=true)=0
\begin{CompactList}\small\item\em Writes configuration data to file(s). \item\end{CompactList}\item 
void {\bf change\-File\-Name} (const  {\bf QString} \&\_\-file\-Name, const  char $\ast$\_\-res\-Type, bool \_\-use\-KDEGlobals)
\begin{CompactList}\small\item\em Changes the filenames associated with this back end. \item\end{CompactList}\item 
virtual {\bf KConfig\-Base::Config\-State} {\bf get\-Config\-State} () const 
\begin{CompactList}\small\item\em Returns the state of the app-config object. \item\end{CompactList}\item 
{\bf QString} {\bf file\-Name} () const 
\begin{CompactList}\small\item\em Returns the filename as passed to the constructor. \item\end{CompactList}\item 
const  char $\ast$ {\bf resource} () const 
\begin{CompactList}\small\item\em Returns the resource type as passed to the constructor. \item\end{CompactList}\item 
void {\bf set\-Locale\-String} (const  {\bf QCString} \&\_\-locale\-String)
\begin{CompactList}\small\item\em Set the locale string that defines the current language. \item\end{CompactList}\item 
void {\bf set\-File\-Write\-Mode} (int mode)
\begin{CompactList}\small\item\em Set the file mode for newly created files. \item\end{CompactList}\item 
{\bf QString} {\bf filename} () const 
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} Use \item\end{CompactList}\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}

\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}
\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 46 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 184 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}virtual KConfig\-Back\-End::$\sim${\bf KConfig\-Back\-End} ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKConfigBackEnd_a1}


Destructs the configuration backend. 



Definition at line 70 of file kconfigbackend.h.

\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} = 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 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 163 of file kconfigbackend.cpp.

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

Referenced by 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_a106})} \end{Desc}


Definition at line 109 of file kconfigbackend.h.

References KConfig\-Base::Config\-State.

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 116 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 122 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 129 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 193 of file kconfigbackend.cpp.

Referenced by KConfig::set\-File\-Write\-Mode().\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::filename () const\hspace{0.3cm}{\tt  [inline]}}\label{classKConfigBackEnd_a10}


{\bf This class or method is obsolete, it is provided for compatibility only.} Use 

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


Definition at line 143 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}
