+/* CheckTypeRef()
+
+ should be called at of argument which usually is
+ type declaration which propably contains name of
+ documented class
+
+ examples:
+ HTMLOnArgument
+ - ltFUNC,
+ - ltPARAM
+ - ltCPARAM
+
+ checks: GetArgData() if contains Type Declaration
+ and can be referenced to some file
+ prints:
+ before<a href="xxx&yyy">type</a>after
+
+ returns:
+ false - if no reference was found
+ true - if reference was found and HREF printed
+*/
+static bool CheckTypeRef()
+{
+ wxString typeDecl = GetArgData();
+ if( !typeDecl.empty() ) {
+ typeDecl.Replace(wxT("\\"),wxT(""));
+ wxString label = typeDecl;
+ label.Replace(wxT("const"),wxT(""));
+ label.Replace(wxT("virtual"),wxT(""));
+ label.Replace(wxT("static"),wxT(""));
+ label.Replace(wxT("extern"),wxT(""));
+ label = label.BeforeFirst('&');
+ label = label.BeforeFirst(wxT('*'));
+ label = label.BeforeFirst(wxT('\\'));
+ label.Trim(true); label.Trim(false);
+ wxString typeName = label;
+ label.MakeLower();
+ TexRef *texRef = FindReference((wxChar*)label.c_str());
+
+ if (texRef && texRef->refFile && wxStrcmp(texRef->refFile, _T("??")) != 0) {
+ int a = typeDecl.Find(typeName);
+ wxString before = typeDecl.Mid( 0, a );
+ wxString after = typeDecl.Mid( a+typeName.Length() );
+ //wxFprintf(stderr,wxT("%s <%s> %s to ... %s#%s !!!!\n"),
+ // before.c_str(),
+ // typeName.c_str(),
+ // after.c_str(),
+ // texRef->refFile,label.c_str());
+ TexOutput(before);
+ TexOutput(_T("<A HREF=\""));
+ TexOutput(texRef->refFile);
+ TexOutput(_T("#"));
+ TexOutput(label);
+ TexOutput(wxT("\">"));
+ TexOutput(typeName);
+ TexOutput(wxT("</A>"));
+ TexOutput(after);
+ return true;
+ } else {
+ //wxFprintf(stderr,wxT("'%s' from (%s) -> label %s NOT FOUND\n"),
+ // typeName.c_str(),
+ // typeDecl.c_str(),
+ // label.c_str());
+ return false;
+ }
+ }
+ return false;
+}