-bool wxConfigBase::Read(const wxString& key, wxString *str, const wxString& defVal) const
-{
- if (!Read(key, str))
- {
- *str = ExpandEnvVars(defVal);
- return FALSE;
+// implement both Read() overloads for the given type in terms of DoRead()
+#define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \
+ bool wxConfigBase::Read(const wxString& key, type *val) const \
+ { \
+ wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \
+ \
+ return DoRead##name(key, val); \
+ } \
+ \
+ bool wxConfigBase::Read(const wxString& key, \
+ type *val, \
+ deftype defVal) const \
+ { \
+ wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \
+ \
+ if ( DoRead##name(key, val) ) \
+ return TRUE; \
+ \
+ if ( IsRecordingDefaults() ) \
+ { \
+ ((wxConfigBase *)this)->DoWrite##name(key, defVal); \
+ } \
+ \
+ *val = extra(defVal); \
+ \
+ return FALSE; \