+
+ // update the other method's locations for those methods which belong to the modified header
+ // and are placed _below_ the modified method
+ wxClassPtrArray cToUpdate = m_doxyInterface.FindClassesDefinedIn(header);
+ for (i=0; i < cToUpdate.GetCount(); i++)
+ {
+ for (j=0; j < cToUpdate[i]->GetMethodCount(); j++)
+ {
+ wxMethod& m = cToUpdate[i]->GetMethod(j);
+ if (m.GetLocation() > iface->GetLocation())
+ {
+ // update the location of this method
+ m.SetLocation(m.GetLocation()+nOffset);
+ }
+ }
+ }
+
+ return true;
+}
+
+bool IfaceCheckApp::ParsePreprocessorOutput(const wxString& filename)
+{
+ wxTextFile tf;
+ if (!tf.Open(filename)) {
+ wxLogError("can't open the '%s' preprocessor output file.", filename);
+ return false;
+ }
+
+ size_t useful = 0;
+ for (unsigned int i=0; i < tf.GetLineCount(); i++)
+ {
+ const wxString& line = tf.GetLine(i);
+ wxString defnameval = line.Mid(8); // what follows the "#define " string
+
+ // the format of this line should be:
+ // #define DEFNAME DEFVALUE
+ if (!line.StartsWith("#define ")) {
+ wxLogError("unexpected content in '%s' at line %d.", filename, i+1);
+ return false;
+ }
+
+ if (defnameval.Contains(" "))
+ {
+ // get DEFNAME
+ wxString defname = defnameval.BeforeFirst(' ');
+ if (defname.Contains("("))
+ continue; // this is a macro, skip it!
+
+ // get DEFVAL
+ wxString defval = defnameval.AfterFirst(' ').Strip(wxString::both);
+ if (defval.StartsWith("(") && defval.EndsWith(")"))
+ defval = defval.Mid(1, defval.Len()-2);
+
+ // store this pair in the doxygen interface, where it can be useful
+ m_doxyInterface.AddPreprocessorValue(defname, defval);
+ useful++;
+ }
+ else
+ {
+ // it looks like the format of this line is:
+ // #define DEFNAME
+ // we are not interested to symbols #defined to nothing,
+ // so we just ignore this line.
+ }
+ }
+
+ wxLogMessage("Parsed %d preprocessor #defines from '%s' which will be used later...",
+ useful, filename);
+
+ return true;