git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52807
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if (overloads.GetCount()==0)
{
if (overloads.GetCount()==0)
{
+ /*
+ TODO: sometimes the interface headers re-document a method
+ inherited from a base class even if the real header does
+ not actually re-implement it.
+ To avoid false positives, we'd need to search in the base classes
+ of api[] classes and search for a matching method.
+ */
LogMessage("%s: real '%s' class has no method '%s'",
header, searchedclasses, m.GetAsString());
// we've found no overloads
LogMessage("%s: real '%s' class has no method '%s'",
header, searchedclasses, m.GetAsString());
// we've found no overloads
void wxArgumentType::SetDefaultValue(const wxString& defval)
{
void wxArgumentType::SetDefaultValue(const wxString& defval)
{
- m_strDefaultValue=defval;
+ m_strDefaultValue=defval.Strip(wxString::both);
// in order to make valid&simple comparison on argument defaults,
// we reduce some of the multiple forms in which the same things may appear
// in order to make valid&simple comparison on argument defaults,
// we reduce some of the multiple forms in which the same things may appear
if (m_strDefaultValue.Contains("wxGetTranslation"))
if (m_strDefaultValue.Contains("wxGetTranslation"))
- m_strDefaultValue = wxEmptyString; // TODO: wxGetTranslation gives problems to gccxml
+ m_strDefaultValue = "_(TOFIX)"; // TODO: wxGetTranslation gives problems to gccxml
}
bool wxArgumentType::operator==(const wxArgumentType& m) const
}
bool wxArgumentType::operator==(const wxArgumentType& m) const
for (unsigned int i=0; i<m_args.GetCount(); i++)
if (!m_args[i].IsOk()) {
LogError("'%s' method has invalid %d-th argument type: %s",
for (unsigned int i=0; i<m_args.GetCount(); i++)
if (!m_args[i].IsOk()) {
LogError("'%s' method has invalid %d-th argument type: %s",
- m_strName, i, m_args[i].GetAsString());
+ m_strName, i+1, m_args[i].GetAsString());
return false;
}
// NB: the default value of the arguments can contain pretty much everything
// (think to e.g. wxPoint(3+4/2,0) or *wxBLACK or someClass<type>)
return false;
}
// NB: the default value of the arguments can contain pretty much everything
// (think to e.g. wxPoint(3+4/2,0) or *wxBLACK or someClass<type>)
- // so we don't do any test on them.
+ // so we don't do any test on their contents
+ if (m_args.GetCount()>0)
+ {
+ bool previousArgHasDefault = m_args[0].HasDefaultValue();
+ for (unsigned int i=1; i<m_args.GetCount(); i++)
+ {
+ if (previousArgHasDefault && !m_args[i].HasDefaultValue()) {
+ LogError("'%s' method has %d-th argument which has no default value "
+ "(while the previous one had one!)",
+ m_strName, i+1);
+ return false;
+ }
+
+ previousArgHasDefault = m_args[i].HasDefaultValue();
+ }
+ }
// this <Method> node is a method of the i-th class!
wxMethod newfunc;
// this <Method> node is a method of the i-th class!
wxMethod newfunc;
- if (!ParseMethod(child, types, newfunc))
+ if (!ParseMethod(child, types, newfunc)) {
+ LogError("The method '%s' could not be added to class '%s'",
+ child->GetAttribute("demangled"), p->GetName());
if (newfunc.IsCtor() && !p->IsValidCtorForThisClass(newfunc)) {
LogError("The method '%s' does not seem to be a ctor for '%s'",
if (newfunc.IsCtor() && !p->IsValidCtorForThisClass(newfunc)) {
LogError("The method '%s' does not seem to be a ctor for '%s'",
if ((++nodes%PROGRESS_RATE)==0) ShowProgress();
}
if ((++nodes%PROGRESS_RATE)==0) ShowProgress();
}
if (!CheckParseResults())
return false;
if (!CheckParseResults())
return false;
- if (ParseMethod(membernode, m, header))
+ if (!ParseMethod(membernode, m, header)) {
+ LogError("The method '%s' could not be added to class '%s'",
+ m.GetName(), klass.GetName());
+ return false;
+ }
+
+ if (absoluteFile.IsEmpty())
+ absoluteFile = header;
+ else if (header != absoluteFile)
- if (absoluteFile.IsEmpty())
- absoluteFile = header;
- else if (header != absoluteFile)
- {
- LogError("The method '%s' is documented in a different "
- "file from others (which belong to '%s') ?",
- header, absoluteFile);
- return false;
- }
-
- klass.AddMethod(m);
+ LogError("The method '%s' is documented in a different "
+ "file from others (which belong to '%s') ?",
+ header, absoluteFile);
+ return false;
}
membernode = membernode->GetNext();
}
membernode = membernode->GetNext();
wxString GetDefaultValue() const
{ return m_strDefaultValue; }
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); }
bool operator==(const wxArgumentType& m) const;
bool operator!=(const wxArgumentType& m) const
{ return !(*this == m); }