BIG CHANGES:

- removed fix from the rungccxml.sh.in; not only it was unnecessary
  but it's also better to keep all references to specific wxWidgets
  classes in a single place: the ifacecheck sources;
- added g_bLogEnabled and LogNull class;
- added an HACK_TO_AUTO_CORRECT_ONLY_VIRTUAL_AND_CONST_ATTRIBUTES
  mode for fixing virtualness and constness of interface headers
  in an automated way
- added options to wxMethod::GetAsString to provide an easier way
  to debug ifacecheck comparisons between wxMethods
- fixed wxMethod::FixMethod for single-line prototypes and added
  a boolean return value from it


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-09-22 21:55:38 +00:00
parent b7e94bd7eb
commit 97f0dbd6f8
4 changed files with 187 additions and 53 deletions

View File

@@ -17,12 +17,38 @@
#include <wx/xml/xml.h>
#include <wx/platinfo.h>
/*
IMPORTANT
=========
Any fix aimed to reduce "false positives" which involves
references to a specific wxWidgets class is marked in
ifacecheck sources with the string:
// ADHOC-FIX:
*/
// helper macros
#define LogMessage(fmt, ...) { wxPrintf(fmt "\n", __VA_ARGS__); fflush(stdout); }
#define LogWarning(fmt, ...) { wxPrintf(fmt "\n", __VA_ARGS__); fflush(stdout); }
#define LogError(fmt, ...) { wxPrintf("ERROR: " fmt "\n", __VA_ARGS__); fflush(stdout); }
#define LogMessage(fmt, ...) { if (g_bLogEnabled) { wxPrintf(fmt "\n", __VA_ARGS__); fflush(stdout); }}
#define LogWarning(fmt, ...) { if (g_bLogEnabled) { wxPrintf(fmt "\n", __VA_ARGS__); fflush(stdout); }}
#define LogError(fmt, ...) { if (g_bLogEnabled) { wxPrintf("ERROR: " fmt "\n", __VA_ARGS__); fflush(stdout); }}
#define wxPrint(str) { wxPrintf(str); fflush(stdout); }
// enable/disable logging
extern bool g_bLogEnabled;
class LogNull
{
public:
LogNull() { g_bLogEnabled = false; }
~LogNull() { g_bLogEnabled = true; }
};
// ----------------------------------------------------------------------------
// Represents a type with or without const/static/ qualifier
@@ -38,6 +64,8 @@ public:
void SetTypeFromString(const wxString& t);
wxString GetAsString() const
{ return m_strType; }
wxString GetAsCleanString() const
{ return m_strTypeClean; }
bool IsConst() const
{ return m_strType.Contains("const"); }
@@ -83,6 +111,8 @@ public:
void SetDefaultValue(const wxString& defval, const wxString& defvalForCmp = wxEmptyString);
wxString GetDefaultValue() const
{ return m_strDefaultValue; }
wxString GetDefaultCleanValue() const
{ return m_strDefaultValueForCmp.IsEmpty() ? m_strDefaultValue : m_strDefaultValueForCmp; }
bool HasDefaultValue() const
{ return !m_strDefaultValue.IsEmpty(); }
@@ -127,7 +157,12 @@ public:
public: // getters
wxString GetAsString(bool bWithArgumentNames = true) const;
// bWithArgumentNames = output argument names?
// bClean = output type names or type _clean_ names (see wxType::GetAsCleanString)
// bDeprecated = output [deprecated] next to deprecated methods?
wxString GetAsString(bool bWithArgumentNames = true,
bool bClean = false,
bool bDeprecated = false) const;
// parser of the prototype:
// all these functions return strings with spaces stripped
@@ -193,6 +228,13 @@ public: // misc
bool operator!=(const wxMethod& m) const
{ return !(*this == m); }
// this function works like operator== but tests everything:
// - method name
// - return type
// - argument types
// except for the method attributes (const,static,virtual,pureVirtual,deprecated)
bool MatchesExceptForAttributes(const wxMethod& m) const;
void Dump(wxTextOutputStream& stream) const;
protected: