// helper macros
#define LogMessage(fmt, ...) { wxPrintf(fmt "\n", __VA_ARGS__); fflush(stdout); }
-#define LogWarning(fmt, ...) { wxPrintf("WARNING: " 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 wxPrint(str) { wxPrintf(str); fflush(stdout); }
public:
wxType() {}
wxType(const wxString& type)
- { SetFromString(type); }
+ { SetTypeFromString(type); }
- void SetFromString(const wxString& t);
+ void SetTypeFromString(const wxString& t);
wxString GetAsString() const
{ return m_strType; }
- wxString GetClean() const;
-
bool IsConst() const
{ return m_strType.Contains("const"); }
bool IsStatic() const
protected:
wxString m_strType;
+
+ // utility for doing comparisons
+ wxString GetClean() const;
};
extern wxType wxEmptyType;
WX_DECLARE_OBJARRAY(wxType, wxTypeArray);
+// ----------------------------------------------------------------------------
+// Represents a type used as argument for some wxMethod
+// ----------------------------------------------------------------------------
+class wxArgumentType : public wxType
+{
+public:
+ wxArgumentType() {}
+ wxArgumentType(const wxString& type, const wxString& defVal,
+ const wxString& argName = wxEmptyString)
+ { SetTypeFromString(type); SetDefaultValue(defVal); m_strArgName = argName; }
+
+ void SetArgumentName(const wxString& name)
+ { m_strArgName=name.Strip(wxString::both); }
+ wxString GetArgumentName() const
+ { return m_strArgName; }
+
+ void SetDefaultValue(const wxString& defval);
+ wxString GetDefaultValue() const
+ { return m_strDefaultValue; }
+
+ bool HasDefaultValue() const
+ { return !m_strDefaultValue.IsEmpty(); }
+
+ bool operator==(const wxArgumentType& m) const;
+ bool operator!=(const wxArgumentType& m) const
+ { return !(*this == m); }
+
+protected:
+ wxString m_strDefaultValue;
+ wxString m_strArgName; // this one only makes sense when this wxType is
+ // used as argument type (and not as return type)
+ // and can be empty.
+};
+
+extern wxArgumentType wxEmptyArgumentType;
+WX_DECLARE_OBJARRAY(wxArgumentType, wxArgumentTypeArray);
+
// ----------------------------------------------------------------------------
// Represents a single prototype of a class' member.
{
public:
wxMethod()
- { m_bConst=m_bVirtual=m_bStatic=m_bDeprecated=false; m_nLine=-1; }
+ { m_bConst=m_bVirtual=m_bPureVirtual=m_bStatic=m_bDeprecated=false; m_nLine=-1; }
wxMethod(const wxType& rettype, const wxString& name,
- const wxTypeArray& arguments, const wxArrayString& defaults,
+ const wxArgumentTypeArray& arguments,
bool isConst, bool isStatic, bool isVirtual)
: m_retType(rettype), m_strName(name.Strip(wxString::both)),
m_bConst(isConst), m_bStatic(isStatic), m_bVirtual(isVirtual)
- { SetArgumentTypes(arguments,defaults); m_nLine=-1; }
+ { SetArgumentTypes(arguments); m_nLine=-1; }
public: // getters
- //void SetFromString(const wxString& proto);
- wxString GetAsString() const;
+ wxString GetAsString(bool bWithArgumentNames = true) const;
// parser of the prototype:
// all these functions return strings with spaces stripped
{ return m_retType; }
wxString GetName() const
{ return m_strName; }
- wxTypeArray GetArgumentTypes() const
+ wxArgumentTypeArray GetArgumentTypes() const
{ return m_args; }
- wxArrayString GetArgumentDefaults() const
- { return m_argDefaults; }
int GetLocation() const
{ return m_nLine; }
{ return m_bStatic; }
bool IsVirtual() const
{ return m_bVirtual; }
+ bool IsPureVirtual() const
+ { return m_bPureVirtual; }
bool IsOk() const;
bool IsCtor() const
{ m_retType=t; }
void SetName(const wxString& name)
{ m_strName=name; }
- void SetArgumentTypes(const wxTypeArray& arr, const wxArrayString& defaults);
+ void SetArgumentTypes(const wxArgumentTypeArray& arr)
+ { m_args=arr; }
void SetConst(bool c = true)
{ m_bConst=c; }
void SetStatic(bool c = true)
{ m_bStatic=c; }
void SetVirtual(bool c = true)
{ m_bVirtual=c; }
+ void SetPureVirtual(bool c = true)
+ {
+ m_bPureVirtual=c;
+ if (c) m_bVirtual=c; // pure virtual => virtual
+ }
void SetDeprecated(bool c = true)
{ m_bDeprecated=c; }
void SetLocation(int lineNumber)
protected:
wxType m_retType;
wxString m_strName;
- wxTypeArray m_args;
- wxArrayString m_argDefaults;
+ wxArgumentTypeArray m_args;
bool m_bConst;
bool m_bStatic;
bool m_bVirtual;
+ bool m_bPureVirtual;
bool m_bDeprecated;
int m_nLine;
};
return methods;
}
+ // pass a full-path header filename:
+ wxClassPtrArray FindClassesDefinedIn(const wxString& headerfile) const;
+
void ShowProgress()
{ /*wxPrint(".");*/ }