X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3e1512cdfecd2c531567e6603083d9c3968216c7..859588540321276b8e813f479dbedbd53f23a0c5:/include/wx/confbase.h diff --git a/include/wx/confbase.h b/include/wx/confbase.h index bcba0a1eea..9bff8dedb5 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -185,7 +185,8 @@ public: // no default version since it does not make sense for binary data #endif // wxUSE_BASE64 - + // Causes ambiguities in VC++ 6 and OpenVMS (at least) +#if ( (!defined(__VISUALC__) || __VISUALC__ > 1200) && !defined( __VMS ) && !defined (__DMC__)) // read other types, for which wxFromString is defined template bool Read(const wxString& key, T* value) const @@ -208,9 +209,9 @@ public: } return found; } +#endif - // convenience functions returning directly the value (we don't have them for - // int/double/bool as there would be ambiguities with the long one then) + // convenience functions returning directly the value wxString Read(const wxString& key, const wxString& defVal = wxEmptyString) const { wxString s; (void)Read(key, &s, defVal); return s; } @@ -224,10 +225,25 @@ public: { return Read(key, wxString(defVal)); } #endif - long Read(const wxString& key, long defVal) const + long ReadLong(const wxString& key, long defVal) const { long l; (void)Read(key, &l, defVal); return l; } - // write the value (return true on success) + double ReadDouble(const wxString& key, double defVal) const + { double d; (void)Read(key, &d, defVal); return d; } + + bool ReadBool(const wxString& key, bool defVal) const + { bool b; (void)Read(key, &b, defVal); return b; } + + template + T ReadObject(const wxString& key, T const& defVal) const + { T t; (void)Read(key, &t, defVal); return t; } + + // for compatibility with wx 2.8 + long Read(const wxString& key, long defVal) const + { return ReadLong(key, defVal); } + + + // write the value (return true on success) bool Write(const wxString& key, const wxString& value) { return DoWriteString(key, value); } @@ -278,11 +294,13 @@ public: bool Write(const wxString& key, float value) { return DoWriteDouble(key, value); } - + // Causes ambiguities in VC++ 6 and OpenVMS (at least) +#if ( (!defined(__VISUALC__) || __VISUALC__ > 1200) && !defined( __VMS ) && !defined (__DMC__)) // for other types, use wxToString() template bool Write(const wxString& key, T const& value) { return Write(key, wxToString(value)); } +#endif // permanently writes all changes virtual bool Flush(bool bCurrentOnly = false) = 0;