//---------------------------------------------------------------------------
%{
- static wxString wxPyEmptyStr("");
-
static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) {
PyObject* ret = PyTuple_New(3);
if (ret) {
class wxConfigBase {
public:
-// wxConfigBase(const wxString& appName = wxPyEmptyStr, **** An ABC
-// const wxString& vendorName = wxPyEmptyStr,
-// const wxString& localFilename = wxPyEmptyStr,
-// const wxString& globalFilename = wxPyEmptyStr,
+// wxConfigBase(const wxString& appName = wxEmptyString, **** An ABC
+// const wxString& vendorName = wxEmptyString,
+// const wxString& localFilename = wxEmptyString,
+// const wxString& globalFilename = wxEmptyString,
// long style = 0);
~wxConfigBase();
bool IsExpandingEnvVars();
bool IsRecordingDefaults();
- wxString Read(const wxString& key, const wxString& defaultVal = wxPyEmptyStr);
- %name(ReadInt)long Read(const wxString& key, long defaultVal = 0);
- %name(ReadFloat)double Read(const wxString& key, double defaultVal = 0.0);
+ wxString Read(const wxString& key, const wxString& defaultVal = wxEmptyString);
+
+ %addmethods {
+ long ReadInt(const wxString& key, long defaultVal = 0) {
+ long rv;
+ self->Read(key, &rv, defaultVal);
+ return rv;
+ }
+ double ReadFloat(const wxString& key, double defaultVal = 0.0) {
+ double rv;
+ self->Read(key, &rv, defaultVal);
+ return rv;
+ }
+ bool ReadBool(const wxString& key, bool defaultVal = FALSE) {
+ bool rv;
+ self->Read(key, &rv, defaultVal);
+ return rv;
+ }
+ }
void SetExpandEnvVars (bool bDoIt = TRUE);
void SetPath(const wxString& strPath);
bool Write(const wxString& key, const wxString& value);
%name(WriteInt)bool Write(const wxString& key, long value);
%name(WriteFloat)bool Write(const wxString& key, double value);
+ %name(WriteBool)bool Write(const wxString& key, bool value);
EntryType GetEntryType(const wxString& name);
bool RenameEntry(const wxString& oldName,
};
+
//---------------------------------------------------------------------------
+// This will be a wxRegConfig on Win32 and wxFileConfig otherwise.
class wxConfig : public wxConfigBase {
public:
- wxConfig(const wxString& appName = wxPyEmptyStr,
- const wxString& vendorName = wxPyEmptyStr,
- const wxString& localFilename = wxPyEmptyStr,
- const wxString& globalFilename = wxPyEmptyStr,
+ wxConfig(const wxString& appName = wxEmptyString,
+ const wxString& vendorName = wxEmptyString,
+ const wxString& localFilename = wxEmptyString,
+ const wxString& globalFilename = wxEmptyString,
long style = 0);
~wxConfig();
};
+
+// Sometimes it's nice to explicitly have a wxFileConfig too.
class wxFileConfig : public wxConfigBase {
public:
- wxFileConfig(const wxString& appName = wxPyEmptyStr,
- const wxString& vendorName = wxPyEmptyStr,
- const wxString& localFilename = wxPyEmptyStr,
- const wxString& globalFilename = wxPyEmptyStr,
+ wxFileConfig(const wxString& appName = wxEmptyString,
+ const wxString& vendorName = wxEmptyString,
+ const wxString& localFilename = wxEmptyString,
+ const wxString& globalFilename = wxEmptyString,
long style = 0);
~wxFileConfig();
};
int n = 1,
Month month = Inv_Month,
int year = Inv_Year);
- wxDateTime GetWeekDay(WeekDay weekday,
- int n = 1,
- Month month = Inv_Month,
- int year = Inv_Year);
+// wxDateTime GetWeekDay(WeekDay weekday,
+// int n = 1,
+// Month month = Inv_Month,
+// int year = Inv_Year);
// sets to the last weekday in the given month, year
bool SetToLastWeekDay(WeekDay weekday,