X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e04487ebe8375d5dae8f61800569fbbb94d2139a..159960c0e711edd4b2fbba4b9e41e81333868d62:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 5c7c706d6e..a90cad6a76 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -46,6 +46,10 @@ #include "wx/utils.h" // for wxGetHomeDir +#if defined(__WXMAC__) + #include "wx/mac/private.h" // includes mac headers +#endif + // _WINDOWS_ is defined when windows.h is included, // __WXMSW__ is defined for MS Windows compilation #if defined(__WXMSW__) && !defined(_WINDOWS_) @@ -819,8 +823,7 @@ bool wxFileConfig::HasEntry(const wxString& strName) const // read/write values // ---------------------------------------------------------------------------- -bool wxFileConfig::Read(const wxString& key, - wxString* pStr) const +bool wxFileConfig::DoReadString(const wxString& key, wxString* pStr) const { wxConfigPathChanger path(this, key); @@ -829,32 +832,12 @@ bool wxFileConfig::Read(const wxString& key, return FALSE; } - *pStr = ExpandEnvVars(pEntry->Value()); - return TRUE; -} - -bool wxFileConfig::Read(const wxString& key, - wxString* pStr, const wxString& defVal) const -{ - wxConfigPathChanger path(this, key); - - wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(path.Name()); - bool ok; - if (pEntry == NULL) { - if( IsRecordingDefaults() ) - ((wxFileConfig *)this)->Write(key,defVal); - *pStr = ExpandEnvVars(defVal); - ok = FALSE; - } - else { - *pStr = ExpandEnvVars(pEntry->Value()); - ok = TRUE; - } + *pStr = pEntry->Value(); - return ok; + return TRUE; } -bool wxFileConfig::Read(const wxString& key, long *pl) const +bool wxFileConfig::DoReadLong(const wxString& key, long *pl) const { wxString str; if ( !Read(key, & str) ) @@ -862,11 +845,10 @@ bool wxFileConfig::Read(const wxString& key, long *pl) const return FALSE; } - *pl = wxAtol(str); - return TRUE; + return str.ToLong(pl); } -bool wxFileConfig::Write(const wxString& key, const wxString& szValue) +bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) { wxConfigPathChanger path(this, key); @@ -901,12 +883,9 @@ bool wxFileConfig::Write(const wxString& key, const wxString& szValue) return TRUE; } -bool wxFileConfig::Write(const wxString& key, long lValue) +bool wxFileConfig::DoWriteLong(const wxString& key, long lValue) { - // ltoa() is not ANSI :-( - wxString buf; - buf.Printf(wxT("%ld"), lValue); - return Write(key, buf); + return Write(key, wxString::Format(_T("%ld"), lValue)); } bool wxFileConfig::Flush(bool /* bCurrentOnly */)