From: Vadim Zeitlin Date: Sat, 10 Mar 2007 18:16:10 +0000 (+0000) Subject: derive wxConfig classes from wxObject and add wxRTTI macros to them (patch 1587607) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c4ec0ce8205de4659f1e52d16480b5c025ebc41e derive wxConfig classes from wxObject and add wxRTTI macros to them (patch 1587607) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44737 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/config.tex b/docs/latex/wx/config.tex index d944febb1d..89254cf773 100644 --- a/docs/latex/wx/config.tex +++ b/docs/latex/wx/config.tex @@ -23,7 +23,7 @@ so please have a \helpref{look at them.}{wxconfigstaticfunctions} \wxheading{Derived from} -No base class +\helpref{wxObject}{wxobject} \wxheading{Include files} diff --git a/include/wx/fileconf.h b/include/wx/fileconf.h index 0c42cfe4cf..1a3a073041 100644 --- a/include/wx/fileconf.h +++ b/include/wx/fileconf.h @@ -236,6 +236,7 @@ private: bool m_isDirty; // if true, we have unsaved changes DECLARE_NO_COPY_CLASS(wxFileConfig) + DECLARE_ABSTRACT_CLASS(wxFileConfig) }; #endif diff --git a/include/wx/msw/iniconf.h b/include/wx/msw/iniconf.h index 81872a9290..948825de34 100644 --- a/include/wx/msw/iniconf.h +++ b/include/wx/msw/iniconf.h @@ -90,6 +90,9 @@ private: wxString m_strLocalFilename; // name of the private INI file wxString m_strGroup, // current group in appname.ini file m_strPath; // the rest of the path (no trailing '_'!) + + DECLARE_NO_COPY_CLASS(wxIniConfig) + DECLARE_ABSTRACT_CLASS(wxIniConfig) }; #endif //_INICONF_H diff --git a/include/wx/msw/regconf.h b/include/wx/msw/regconf.h index ff886d1796..82ab6d14a3 100644 --- a/include/wx/msw/regconf.h +++ b/include/wx/msw/regconf.h @@ -95,16 +95,15 @@ protected: virtual bool DoWriteLong(const wxString& key, long lValue); private: - // no copy ctor/assignment operator - wxRegConfig(const wxRegConfig&); - wxRegConfig& operator=(const wxRegConfig&); - // these keys are opened during all lifetime of wxRegConfig object wxRegKey m_keyLocalRoot, m_keyLocal, m_keyGlobalRoot, m_keyGlobal; // current path (not '/' terminated) wxString m_strPath; + + DECLARE_NO_COPY_CLASS(wxRegConfig) + DECLARE_ABSTRACT_CLASS(wxRegConfig) }; #endif //_REGCONF_H diff --git a/include/wx/palmos/prefconf.h b/include/wx/palmos/prefconf.h index e5f7f4104a..ba756045c2 100644 --- a/include/wx/palmos/prefconf.h +++ b/include/wx/palmos/prefconf.h @@ -72,10 +72,6 @@ protected: virtual bool DoWriteLong(const wxString& key, long lValue); private: - // no copy ctor/assignment operator - wxPrefConfig(const wxPrefConfig&); - wxPrefConfig& operator=(const wxPrefConfig&); - // current path (not '/' terminated) wxString m_strPath; @@ -84,6 +80,9 @@ private: // current group modified ? bool m_modGroup; + + DECLARE_NO_COPY_CLASS(wxPrefConfig) + DECLARE_ABSTRACT_CLASS(wxPrefConfig) }; #endif // _PREFCONF_H_ diff --git a/src/common/config.cpp b/src/common/config.cpp index 16cc86d8f2..dadcf71c56 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -57,6 +57,7 @@ bool wxConfigBase::ms_bAutoCreate = true; // ---------------------------------------------------------------------------- // wxConfigBase // ---------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxConfigBase, wxObject) // Not all args will always be used by derived classes, but including them all // in each class ensures compatibility. diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 09731e4194..f0ce4ed3ac 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -377,6 +377,7 @@ wxString wxFileConfig::GetLocalFileName(const wxString& file) // ---------------------------------------------------------------------------- // ctor // ---------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxFileConfig, wxConfigBase) void wxFileConfig::Init() { diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index cce629bbc2..020746e828 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -50,6 +50,7 @@ // ---------------------------------------------------------------------------- // ctor & dtor // ---------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxIniConfig, wxConfigBase) wxIniConfig::wxIniConfig(const wxString& strAppName, const wxString& strVendor, diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 71b62aeb95..19481f6b37 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -60,6 +60,7 @@ bool TryGetValue(const wxRegKey& key, const wxString& str, long *plVal) // ---------------------------------------------------------------------------- // ctor/dtor // ---------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxRegConfig, wxConfigBase) // create the config object which stores its data under HKCU\vendor\app and, if // style & wxCONFIG_USE_GLOBAL_FILE, under HKLM\vendor\app diff --git a/src/palmos/prefconf.cpp b/src/palmos/prefconf.cpp index b8a029f7b3..288e91f178 100644 --- a/src/palmos/prefconf.cpp +++ b/src/palmos/prefconf.cpp @@ -82,6 +82,7 @@ know structures of Preferences of other non wxW applications. // ---------------------------------------------------------------------------- // ctor/dtor // ---------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxPrefConfig, wxConfigBase) wxPrefConfig::wxPrefConfig(const wxString& appName, const wxString& vendorName, const wxString& strLocal, const wxString& strGlobal,