// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
-// ============================================================================
-// declarations
-// ============================================================================
-
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include <wx/confbase.h>
+
+#ifdef wxUSE_CONFIG
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
-#ifndef WX_PRECOMP
- #include <wx/string.h>
- #include <wx/intl.h>
-#endif //WX_PRECOMP
-
#include <wx/app.h>
#include <wx/file.h>
#include <wx/log.h>
#include <wx/textfile.h>
-#include <wx/confbase.h>
+#include <wx/utils.h>
// we must include (one of) these files for wxConfigBase::Create
#if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE)
bool wxConfigBase::Read(const wxString& key, double* val) const
{
wxString str;
- if (Read(key, str))
+ if (Read(key, & str))
{
*val = atof(str);
return TRUE;
}
// Convenience functions
+
+bool wxConfigBase::Read(const wxString& key, int *pi) const
+{
+ long l;
+ bool ret = Read(key, &l);
+ if (ret)
+ *pi = (int) l;
+ return ret;
+}
+
+bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const
+{
+ long l;
+ bool ret = Read(key, &l, (long) defVal);
+ *pi = (int) l;
+ return ret;
+}
+
bool wxConfigBase::Write(const wxString& key, double val)
{
wxString str;
return Write(key, l);
}
+wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
+{
+ wxString tmp; // Required for BC++
+ if (IsExpandingEnvVars())
+ tmp = wxExpandEnvVars(str);
+ else
+ tmp = str;
+ return tmp;
+}
// ----------------------------------------------------------------------------
// wxConfigPathChanger
{
Bracket_None,
Bracket_Normal = ')',
- Bracket_Curly = '}',
+ Bracket_Curly = '}'
#ifdef __WXMSW__
- Bracket_Windows = '%' // yeah, Windows people are a bit strange ;-)
+ ,Bracket_Windows = '%' // yeah, Windows people are a bit strange ;-)
#endif
};
}
}
+#endif
+
+ // wxUSE_CONFIG