wxConfigBase class defines the basic interface of all config classes. It can
not be used by itself (it is an abstract base class) and you will always use one
wxConfigBase class defines the basic interface of all config classes. It can
not be used by itself (it is an abstract base class) and you will always use one
wxRegConfig or any other.
However, usually you don't even need to know the precise nature of the class
wxRegConfig or any other.
However, usually you don't even need to know the precise nature of the class
Windows 3.1 .INI files if you're really unlucky). To make writing the portable
code even easier, wxWidgets provides a typedef wxConfig
which is mapped onto the native wxConfigBase implementation on the given
Windows 3.1 .INI files if you're really unlucky). To make writing the portable
code even easier, wxWidgets provides a typedef wxConfig
which is mapped onto the native wxConfigBase implementation on the given
<wx/config.h> (to let wxWidgets choose a wxConfig class for your platform)\\
<wx/confbase.h> (base config class)\\
<wx/fileconf.h> (wxFileConfig class)\\
<wx/config.h> (to let wxWidgets choose a wxConfig class for your platform)\\
<wx/confbase.h> (base config class)\\
<wx/fileconf.h> (wxFileConfig class)\\
{\bf Note:} You should use either {\it Set()} or {\it Get()} because wxWidgets
library itself would take advantage of it and could save various information
in it. For example \helpref{wxFontMapper}{wxfontmapper} or Unix version
{\bf Note:} You should use either {\it Set()} or {\it Get()} because wxWidgets
library itself would take advantage of it and could save various information
in it. For example \helpref{wxFontMapper}{wxfontmapper} or Unix version
As explained in \helpref{config overview}{wxconfigoverview}, the config classes
support a file system-like hierarchy of keys (files) and groups (directories).
As explained in \helpref{config overview}{wxconfigoverview}, the config classes
support a file system-like hierarchy of keys (files) and groups (directories).
You must pass the same index to GetNext and GetFirst (don't modify it).
Please note that it is {\bf not} the index of the current item (you will have
You must pass the same index to GetNext and GetFirst (don't modify it).
Please note that it is {\bf not} the index of the current item (you will have
\helpref{GetAppName}{wxconfigbasegetappname}\\
\helpref{GetVendorName}{wxconfigbasegetvendorname}\\
\helpref{SetUmask}{wxfileconfigsetumask}
\helpref{GetAppName}{wxconfigbasegetappname}\\
\helpref{GetVendorName}{wxconfigbasegetvendorname}\\
\helpref{SetUmask}{wxfileconfigsetumask}
These function are the core of wxConfigBase class: they allow you to read and
write config file data. All {\it Read} function take a default value which
These function are the core of wxConfigBase class: they allow you to read and
write config file data. All {\it Read} function take a default value which
entry/group with the original name doesn't exist, because the entry/group with
the new name already exists or because the function is not supported in this
wxConfig implementation.
entry/group with the original name doesn't exist, because the entry/group with
the new name already exists or because the function is not supported in this
wxConfig implementation.
The functions in this section delete entries and/or groups of entries from the
config file. {\it DeleteAll()} is especially useful if you want to erase all
The functions in this section delete entries and/or groups of entries from the
config file. {\it DeleteAll()} is especially useful if you want to erase all
Some aspects of wxConfigBase behaviour can be changed during run-time. The
first of them is the expansion of environment variables in the string values
Some aspects of wxConfigBase behaviour can be changed during run-time. The
first of them is the expansion of environment variables in the string values
escaping for the values of entries stored in the config file: for example
a {\it foo} key with some backslash characters will be stored as {\tt foo=C:$\backslash$mydir} instead
of the usual storage of {\tt foo=C:$\backslash\backslash$mydir}.
escaping for the values of entries stored in the config file: for example
a {\it foo} key with some backslash characters will be stored as {\tt foo=C:$\backslash$mydir} instead
of the usual storage of {\tt foo=C:$\backslash\backslash$mydir}.
The wxCONFIG\_USE\_NO\_ESCAPE\_CHARACTERS style can be helpful if your config
file must be read or written to by a non-wxWidgets program (which might not
The wxCONFIG\_USE\_NO\_ESCAPE\_CHARACTERS style can be helpful if your config
file must be read or written to by a non-wxWidgets program (which might not
other illegal characters in a value, before writing that value to the file.}
\docparam{conv}{This parameter is only used by wxFileConfig when compiled
other illegal characters in a value, before writing that value to the file.}
\docparam{conv}{This parameter is only used by wxFileConfig when compiled
Calling this function will prevent {\it Get()} from automatically creating a
new config object if the current one is NULL. It might be useful to call it
Calling this function will prevent {\it Get()} from automatically creating a
new config object if the current one is NULL. It might be useful to call it
\func{bool}{DeleteAll}{\void}
Delete the whole underlying object (disk file, registry key, ...). Primarly
\func{bool}{DeleteAll}{\void}
Delete the whole underlying object (disk file, registry key, ...). Primarly
\membersection{wxConfigBase::HasGroup}\label{wxconfigbasehasgroup}
\constfunc{bool}{HasGroup}{\param{const wxString\& }{strName}}
\membersection{wxConfigBase::HasGroup}\label{wxconfigbasehasgroup}
\constfunc{bool}{HasGroup}{\param{const wxString\& }{strName}}
\membersection{wxConfigBase::IsExpandingEnvVars}\label{wxconfigbaseisexpandingenvvars}
\constfunc{bool}{IsExpandingEnvVars}{\void}
\membersection{wxConfigBase::IsExpandingEnvVars}\label{wxconfigbaseisexpandingenvvars}
\constfunc{bool}{IsExpandingEnvVars}{\void}
\membersection{wxConfigBase::IsRecordingDefaults}\label{wxconfigbaseisrecordingdefaults}
\constfunc{bool}{IsRecordingDefaults}{\void}
\membersection{wxConfigBase::IsRecordingDefaults}\label{wxconfigbaseisrecordingdefaults}
\constfunc{bool}{IsRecordingDefaults}{\void}
\membersection{wxConfigBase::Read}\label{wxconfigbaseread}
\constfunc{bool}{Read}{\param{const wxString\& }{key}, \param{wxString*}{ str}}
\membersection{wxConfigBase::Read}\label{wxconfigbaseread}
\constfunc{bool}{Read}{\param{const wxString\& }{key}, \param{wxString*}{ str}}
was not found, {\it str} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{key}, \param{wxString*}{ str}, \param{const wxString\& }{defaultVal}}
was not found, {\it str} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{key}, \param{wxString*}{ str}, \param{const wxString\& }{defaultVal}}
\constfunc{wxString}{Read}{\param{const wxString\& }{key}, \param{const
wxString\& }{defaultVal}}
\constfunc{wxString}{Read}{\param{const wxString\& }{key}, \param{const
wxString\& }{defaultVal}}
not found, {\it l} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{long*}{ l},
\param{long}{ defaultVal}}
not found, {\it l} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{long*}{ l},
\param{long}{ defaultVal}}
not found, {\it defaultVal} is used instead.
\constfunc{long }{Read}{\param{const wxString\& }{key}, \param{long}{ defaultVal}}
not found, {\it defaultVal} is used instead.
\constfunc{long }{Read}{\param{const wxString\& }{key}, \param{long}{ defaultVal}}
not found, {\it d} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{double*}{ d},
\param{double}{ defaultVal}}
not found, {\it d} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{double*}{ d},
\param{double}{ defaultVal}}
not found, {\it defaultVal} is used instead.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{bool*}{ b}}
not found, {\it defaultVal} is used instead.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{bool*}{ b}}
not found, {\it b} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{bool*}{ d},
\param{bool}{ defaultVal}}
not found, {\it b} is not changed.
\constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{bool*}{ d},
\param{bool}{ defaultVal}}
not found, {\it defaultVal} is used instead.
\pythonnote{In place of a single overloaded method name, wxPython
not found, {\it defaultVal} is used instead.
\pythonnote{In place of a single overloaded method name, wxPython
the new one) shouldn't contain backslashes, i.e. only simple names and not
arbitrary paths are accepted by this function.
the new one) shouldn't contain backslashes, i.e. only simple names and not
arbitrary paths are accepted by this function.
the new one) shouldn't contain backslashes, i.e. only simple names and not
arbitrary paths are accepted by this function.
the new one) shouldn't contain backslashes, i.e. only simple names and not
arbitrary paths are accepted by this function.
\func{void}{SetPath}{\param{const wxString\& }{strPath}}
Set current path: if the first character is '/', it is the absolute path,
\func{void}{SetPath}{\param{const wxString\& }{strPath}}
Set current path: if the first character is '/', it is the absolute path,
\func{void}{SetRecordDefaults}{\param{bool }{bDoIt = true}}
Sets whether defaults are recorded to the config file whenever an attempt to
\func{void}{SetRecordDefaults}{\param{bool }{bDoIt = true}}
Sets whether defaults are recorded to the config file whenever an attempt to
If on (default is off) all default values for the settings used by the program
are written back to the config file. This allows the user to see what config
If on (default is off) all default values for the settings used by the program
are written back to the config file. This allows the user to see what config
\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par
\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par