27 #include <qfileinfo.h>
30 #include <qstringlist.h>
49 const QCString &t=QCString())
282 void warn(
const char *fmt,
const char *s)
290 QString kind = attrib.value(
"kind");
291 QString isObjC = attrib.value(
"objc");
298 else if (kind==
"struct")
304 else if (kind==
"union")
310 else if (kind==
"interface")
316 else if (kind==
"enum")
322 else if (kind==
"exception")
328 else if (kind==
"protocol")
334 else if (kind==
"category")
340 else if (kind==
"service")
346 else if (kind==
"singleton")
352 else if (kind==
"file")
357 else if (kind==
"namespace")
362 else if (kind==
"group")
367 else if (kind==
"page")
372 else if (kind==
"package")
377 else if (kind==
"dir")
384 warn(
"Unknown compound attribute `%s' found!\n",kind.data());
412 warn(
"tag `compound' was not expected!\n");
420 QCString protStr = attrib.value(
"protection").utf8();
421 QCString virtStr = attrib.value(
"virtualness").utf8();
422 QCString staticStr = attrib.value(
"static").utf8();
423 if (protStr==
"protected")
427 else if (protStr==
"private")
431 if (virtStr==
"virtual")
435 else if (virtStr==
"pure")
439 if (staticStr==
"yes")
458 default:
warn(
"Unexpected tag `member' found\n");
break;
476 warn(
"Found enumvalue tag outside of member tag\n");
504 default:
warn(
"Unexpected tag `member' found\n");
break;
517 default:
warn(
"Unexpected tag `class' found\n");
break;
528 default:
warn(
"Unexpected tag `namespace' found\n");
break;
538 default:
warn(
"Unexpected tag `file' found\n");
break;
547 default:
warn(
"Unexpected tag `page' found\n");
break;
556 default:
warn(
"Unexpected tag `page' found\n");
break;
568 m_title = attrib.value(
"title").utf8();
580 warn(
"Unexpected tag `type' found\n");
596 default:
warn(
"Unexpected tag `name' found\n");
break;
605 QString protStr = attrib.value(
"protection");
606 QString virtStr = attrib.value(
"virtualness");
609 if (protStr==
"protected")
613 else if (protStr==
"private")
617 if (virtStr==
"virtual")
630 warn(
"Unexpected tag `base' found\n");
642 warn(
"Unexpected tag `base' found\n");
659 warn(
"Unexpected tag `includes' found\n");
682 warn(
"Unexpected tag `templarg' found\n");
697 default:
warn(
"Unexpected tag `filename' found\n");
break;
707 default:
warn(
"Unexpected tag `path' found\n");
break;
719 warn(
"Unexpected tag `anchor' found\n");
739 warn(
"warning: Unexpected tag `anchor' found\n");
753 warn(
"Unexpected tag `anchorfile' found\n");
765 warn(
"Unexpected tag `arglist' found\n");
774 default:
warn(
"Unexpected tag `title' found\n");
break;
786 warn(
"Unexpected tag `subgroup' found\n");
871 const QString&name,
const QXmlAttributes& attrib )
881 warn(
"Unknown tag `%s' found!\n",name.data());
886 bool endElement(
const QString&,
const QString&,
const QString& name )
896 warn(
"Unknown tag `%s' found!\n",name.data());
955 bool error(
const QXmlParseException & )
961 err(
"Fatal error at line %d column %d: %s\n",
962 exception.lineNumber(),exception.columnNumber(),
963 exception.message().data());
980 for (;(cd=lci.current());++lci)
982 msg(
"class `%s'\n",cd->
name.data());
986 QListIterator<BaseInfo> bii(*cd->
bases);
988 for ( bii.toFirst() ; (bi=bii.current()) ; ++bii)
990 msg(
" base: %s \n", bi->
name.data() );
994 QListIterator<TagMemberInfo> mci(cd->
members);
996 for (;(md=mci.current());++mci)
999 msg(
" kind: `%s'\n",md->
kind.data());
1000 msg(
" name: `%s'\n",md->
name.data());
1001 msg(
" anchor: `%s'\n",md->
anchor.data());
1008 for (;(nd=lni.current());++lni)
1010 msg(
"namespace `%s'\n",nd->
name.data());
1012 QStringList::Iterator it;
1016 msg(
" class: %s \n", (*it).latin1() );
1019 QListIterator<TagMemberInfo> mci(nd->
members);
1021 for (;(md=mci.current());++mci)
1024 msg(
" kind: `%s'\n",md->
kind.data());
1025 msg(
" name: `%s'\n",md->
name.data());
1026 msg(
" anchor: `%s'\n",md->
anchor.data());
1033 for (;(fd=lfi.current());++lfi)
1035 msg(
"file `%s'\n",fd->
name.data());
1037 QStringList::Iterator it;
1041 msg(
" namespace: %s \n", (*it).latin1() );
1046 msg(
" class: %s \n", (*it).latin1() );
1049 QListIterator<TagMemberInfo> mci(fd->
members);
1051 for (;(md=mci.current());++mci)
1054 msg(
" kind: `%s'\n",md->
kind.data());
1055 msg(
" name: `%s'\n",md->
name.data());
1056 msg(
" anchor: `%s'\n",md->
anchor.data());
1060 QListIterator<TagIncludeInfo> mii(fd->
includes);
1062 for (;(ii=mii.current());++mii)
1064 msg(
" includes id: %s name: %s\n",ii->
id.data(),ii->
name.data());
1071 for (;(gd=lgi.current());++lgi)
1073 msg(
"group `%s'\n",gd->
name.data());
1075 QStringList::Iterator it;
1079 msg(
" namespace: %s \n", (*it).latin1() );
1084 msg(
" class: %s \n", (*it).latin1() );
1089 msg(
" file: %s \n", (*it).latin1() );
1094 msg(
" subgroup: %s \n", (*it).latin1() );
1099 msg(
" page: %s \n", (*it).latin1() );
1102 QListIterator<TagMemberInfo> mci(gd->
members);
1104 for (;(md=mci.current());++mci)
1107 msg(
" kind: `%s'\n",md->
kind.data());
1108 msg(
" name: `%s'\n",md->
name.data());
1109 msg(
" anchor: `%s'\n",md->
anchor.data());
1116 for (;(pd=lpi.current());++lpi)
1118 msg(
"page `%s'\n",pd->
name.data());
1119 msg(
" title `%s'\n",pd->
title.data());
1125 for (;(dd=ldi.current());++ldi)
1127 msg(
"dir `%s'\n",dd->
name.data());
1128 msg(
" path `%s'\n",dd->
path.data());
1129 QStringList::Iterator it;
1133 msg(
" file: %s \n", (*it).latin1() );
1138 msg(
" subdir: %s \n", (*it).latin1() );
1145 QListIterator<TagAnchorInfo> tli(l);
1147 for (tli.toFirst();(ta=tli.current());++tli)
1160 warn(
"Duplicate anchor %s found\n",ta->
label.data());
1167 QListIterator<TagMemberInfo> mii(members);
1169 for (;(tmi=mii.current());++mii)
1175 if (!me->
args.isEmpty())
1184 QListIterator<TagEnumValueInfo> evii(tmi->
enumValues);
1186 for (evii.toFirst();(evi=evii.current());++evii)
1216 if (tmi->
kind==
"define")
1221 else if (tmi->
kind==
"enumvalue")
1226 else if (tmi->
kind==
"property")
1231 else if (tmi->
kind==
"event")
1236 else if (tmi->
kind==
"variable")
1241 else if (tmi->
kind==
"typedef")
1244 me->
type.prepend(
"typedef ");
1247 else if (tmi->
kind==
"enumeration")
1252 else if (tmi->
kind==
"function")
1257 else if (tmi->
kind==
"signal")
1262 else if (tmi->
kind==
"prototype")
1267 else if (tmi->
kind==
"friend")
1270 me->
type.prepend(
"friend ");
1273 else if (tmi->
kind==
"dcop")
1278 else if (tmi->
kind==
"slot")
1289 int i=s.findRev(
'/');
1292 return s.right(s.length()-i-1);
1309 for (cit.toFirst();(tci=cit.current());++cit)
1348 ce->
tArgLists =
new QList<ArgumentList>;
1356 for (;(argName=sli.current());++sli)
1372 for (fit.toFirst();(tfi=fit.current());++fit)
1409 for (nit.toFirst();(tni=nit.current());++nit)
1428 for (pit.toFirst();(tpgi=pit.current());++pit)
1446 for (git.toFirst();(tgi=git.current());++git)
1465 for (pgit.toFirst();(tpi=pgit.current());++pgit)
1484 for (fit.toFirst();(tfi=fit.current());++fit)
1493 for (;(fd=fni.current());++fni)
1499 QListIterator<TagIncludeInfo> mii(tfi->
includes);
1501 for (;(ii=mii.current());++mii)
1510 for (;(ifd=ifni.current());++ifni)
1529 QFileInfo fi(fullName);
1530 if (!fi.exists())
return;
1534 QFile xmlFile( fullName );
1535 QXmlInputSource source( xmlFile );
1536 QXmlSimpleReader reader;
1537 reader.setContentHandler( &handler );
1538 reader.setErrorHandler( &errorHandler );
1539 reader.parse( source );