X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16c1f7f345e1850f590cfbf67c3b00fbb6d2e62e..d4a23feeb2bb0f497cb2ce41bc54b8cb5d0528fe:/src/common/config.cpp diff --git a/src/common/config.cpp b/src/common/config.cpp index 9707475ac9..1510e939a7 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -179,6 +179,24 @@ bool wxConfigBase::Read(const wxString& key, bool* val, bool defVal) const } // 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; @@ -192,6 +210,15 @@ bool wxConfigBase::Write(const wxString& key, bool value) 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 @@ -382,5 +409,3 @@ void wxSplitPath(wxArrayString& aParts, const char *sz) pc++; } } - -