]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/ifacecheck/src/xmlparser.cpp
added wxLog::IsLevelEnabled() helper; document it and a few related functions which...
[wxWidgets.git] / utils / ifacecheck / src / xmlparser.cpp
index b5c752d48fe070255d87a8defef4f53b4f79941d..1f0fce4847de96a187d8e4413acf914db73f18c3 100644 (file)
@@ -68,6 +68,7 @@ void wxType::SetTypeFromString(const wxString& t)
     m_strType.Replace("[]", "*");
     m_strType.Replace("long int", "long");      // in wx typically we never write "long int", just "long"
     m_strType.Replace("long unsigned int", "unsigned long");
+    m_strType.Replace("short unsigned int", "unsigned short");
 
     // make sure the * and & operator always use the same spacing rules
     // (to make sure GetAsString() output is always consistent)
@@ -83,6 +84,7 @@ void wxType::SetTypeFromString(const wxString& t)
 
     // ADHOC-FIX
     m_strType.Replace("_wxArraywxArrayStringBase", "wxString");
+    m_strType.Replace("ExitCode", "void*");     // used in wxThread stuff
 
     m_strType = m_strType.Strip(wxString::both);
 
@@ -163,13 +165,13 @@ void wxArgumentType::SetDefaultValue(const wxString& defval, const wxString& def
     // Note: we adjust the aesthetic form of the m_strDefaultValue string for the "modify mode"
     //       of ifacecheck: we may need to write it out in an interface header
 
-    wxString *p;
+    wxString *p = NULL;
     for (int i=0; i<2; i++)     // to avoid copying&pasting the code!
     {
         if (i == 0) p = &m_strDefaultValue;
         if (i == 1) p = &m_strDefaultValueForCmp;
 
-        if (*p == "0u") *p = "0";
+        if (*p == "0u" || *p == "0l") *p = "0";
 
         p->Replace("0x000000001", "1");
         p->Replace("\\000\\000\\000", "");    // fix for unicode strings:
@@ -1493,18 +1495,23 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
             wxXmlNode *subchild = child->GetChildren();
             while (subchild)
             {
-                wxString kind = subchild->GetAttribute("kind");
-
-                // parse only public&protected functions:
-                if (subchild->GetName() == "sectiondef" &&
-                    (kind == "public-func" || kind == "protected-func"))
+                // NOTE: when documenting functions using the //@{ and //@}
+                //       tags to create function groups, doxygen puts the
+                //       contained methods into a "user-defined" section
+                //       so we _must_ use the "prot" attribute to distinguish
+                //       public/protected methods from private ones and cannot
+                //       rely on the kind="public" attribute of <sectiondef>
+                if (subchild->GetName() == "sectiondef")
                 {
-
                     wxXmlNode *membernode = subchild->GetChildren();
                     while (membernode)
                     {
+                        const wxString& accessSpec = membernode->GetAttribute("prot");
+
+                        // parse only public&protected functions:
                         if (membernode->GetName() == "memberdef" &&
-                            membernode->GetAttribute("kind") == "function")
+                            membernode->GetAttribute("kind") == "function" &&
+                            (accessSpec == "public" || accessSpec == "protected"))
                         {
 
                             wxMethod m;
@@ -1514,11 +1521,11 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
                                 return false;
                             }
 
-                            if (kind == "public-func")
+                            if (accessSpec == "public")
                                 m.SetAccessSpecifier(wxMAS_PUBLIC);
-                            else if (kind == "protected-func")
+                            else if (accessSpec == "protected")
                                 m.SetAccessSpecifier(wxMAS_PROTECTED);
-                            else if (kind == "private-func")
+                            else if (accessSpec == "private")
                                 m.SetAccessSpecifier(wxMAS_PRIVATE);
 
                             if (absoluteFile.IsEmpty())