X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0d3a2cc93915912ba879ec94d813043d7d60a36..f54e5c1a4f6952c62ed4480f7d26feddc20f98ba:/include/wx/confbase.h?ds=sidebyside diff --git a/include/wx/confbase.h b/include/wx/confbase.h index 5192df40db..32ecdde962 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -52,6 +52,14 @@ class WXDLLIMPEXP_FWD_BASE wxArrayString; #define wxUSE_CONFIG_NATIVE 1 #endif +// not all compilers can deal with template Read/Write() methods, define this +// symbol if the template functions are available +#if (!defined(__VISUALC__) || __VISUALC__ > 1200) && \ + !defined( __VMS ) && \ + !defined (__DMC__) + #define wxHAS_CONFIG_TEMPLATE_RW +#endif + // Style flags for constructor style parameter enum { @@ -185,8 +193,7 @@ 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__)) +#ifdef wxHAS_CONFIG_TEMPLATE_RW // read other types, for which wxFromString is defined template bool Read(const wxString& key, T* value) const @@ -209,7 +216,7 @@ public: } return found; } -#endif +#endif // wxHAS_CONFIG_TEMPLATE_RW // convenience functions returning directly the value wxString Read(const wxString& key, @@ -276,6 +283,12 @@ public: // we also have to provide specializations for other types which we want to // handle using the specialized DoWriteXXX() instead of the generic template // version below + bool Write(const wxString& key, char value) + { return DoWriteLong(key, value); } + + bool Write(const wxString& key, unsigned char value) + { return DoWriteLong(key, value); } + bool Write(const wxString& key, short value) { return DoWriteLong(key, value); }