|
Packit |
1c1d7e |
/******************************************************************************
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* $Id$
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* Copyright (C) 1997-2006 by Dimitri van Heesch.
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* Permission to use, copy, modify, and distribute this software and its
|
|
Packit |
1c1d7e |
* documentation under the terms of the GNU General Public License is hereby
|
|
Packit |
1c1d7e |
* granted. No representations are made about the suitability of this software
|
|
Packit |
1c1d7e |
* for any purpose. It is provided "as is" without express or implied warranty.
|
|
Packit |
1c1d7e |
* See the GNU General Public License for more details.
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#include <stdio.h>
|
|
Packit |
1c1d7e |
#include <stdlib.h>
|
|
Packit |
1c1d7e |
#include <doxmlintf.h>
|
|
Packit |
1c1d7e |
#include <qstring.h>
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/*! Dumps the contents of a hyperlinked text fragment as plain text to the
|
|
Packit |
1c1d7e |
* output.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
QString linkedTextToString(ILinkedTextIterator *ti)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
QString result;
|
|
Packit |
1c1d7e |
ILinkedText *lt=0;
|
|
Packit |
1c1d7e |
for (ti->toFirst();(lt=ti->current());ti->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
switch (lt->kind())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
case ILinkedText::Kind_Text: // plain text
|
|
Packit |
1c1d7e |
result+=dynamic_cast<ILT_Text*>(lt)->text()->latin1(); break;
|
|
Packit |
1c1d7e |
case ILinkedText::Kind_Ref: // a link
|
|
Packit |
1c1d7e |
result+=dynamic_cast<ILT_Ref *>(lt)->text()->latin1(); break;
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
return result;
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/*! Macro for printing an indented message. */
|
|
Packit |
1c1d7e |
#define InPrint(x) printf("%s",indent.latin1()), printf x;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/*! Dumps the contents of a documentation block to stdout.
|
|
Packit |
1c1d7e |
* @note This function will call itself recursively.
|
|
Packit |
1c1d7e |
* @param doc The root of the documentation tree.
|
|
Packit |
1c1d7e |
* @param level The indent level.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
void DumpDoc(IDoc *doc,int level)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
if (doc==0) return;
|
|
Packit |
1c1d7e |
QString indent;
|
|
Packit |
1c1d7e |
indent.fill(' ',level);
|
|
Packit |
1c1d7e |
//printf(" doc node kind=`%d'\n",doc->kind());
|
|
Packit |
1c1d7e |
switch (doc->kind())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
case IDoc::Para:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
InPrint(("<para>\n"));
|
|
Packit |
1c1d7e |
IDocPara *par = dynamic_cast<IDocPara*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(par!=0);
|
|
Packit |
1c1d7e |
IDocIterator *di = par->contents();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("</para>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Text:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocText *txt = dynamic_cast<IDocText*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(txt!=0);
|
|
Packit |
1c1d7e |
InPrint(("<text value=`%s' markup=%d headingLevel=%d/>\n",
|
|
Packit |
1c1d7e |
txt->text()->latin1(),txt->markup(),txt->headingLevel()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::MarkupModifier:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocMarkupModifier *md = dynamic_cast<IDocMarkupModifier*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(md!=0);
|
|
Packit |
1c1d7e |
InPrint(("<markup modifier enabled=%d markup=%d headingLevel=%d/>\n",
|
|
Packit |
1c1d7e |
md->enabled(),md->markup(),md->headingLevel()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::ItemizedList:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
InPrint(("<itemized list>\n"));
|
|
Packit |
1c1d7e |
IDocItemizedList *list = dynamic_cast<IDocItemizedList*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(list!=0);
|
|
Packit |
1c1d7e |
IDocIterator *di = list->elements();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("</itemized list>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::OrderedList:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
InPrint(("<ordered list>\n"));
|
|
Packit |
1c1d7e |
IDocOrderedList *list = dynamic_cast<IDocOrderedList*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(list!=0);
|
|
Packit |
1c1d7e |
IDocIterator *di = list->elements();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("</ordered list>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::ListItem:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
InPrint(("<list item>\n"));
|
|
Packit |
1c1d7e |
IDocListItem *li = dynamic_cast<IDocListItem*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(li!=0);
|
|
Packit |
1c1d7e |
IDocIterator *di = li->contents();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("</list item>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::ParameterItem:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocParameterItem *item = dynamic_cast<IDocParameterItem*>(doc);
|
|
Packit |
1c1d7e |
InPrint(("<parameter item>\n"));
|
|
Packit |
1c1d7e |
IDocIterator *di = item->paramNames();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
DumpDoc(item->description(),level+1);
|
|
Packit |
1c1d7e |
InPrint(("</parameter item>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::ParameterList:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocParameterList *list = dynamic_cast<IDocParameterList*>(doc);
|
|
Packit |
1c1d7e |
InPrint(("<parameter list type=%d>\n",list->sectType()));
|
|
Packit |
1c1d7e |
IDocIterator *di = list->params();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("</parameter list>\n"));
|
|
Packit |
1c1d7e |
ASSERT(list!=0);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Parameter:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocParameter *par = dynamic_cast<IDocParameter*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(par!=0);
|
|
Packit |
1c1d7e |
InPrint(("<parameter name=%s/>\n",par->name()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::SimpleSect:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocSimpleSect *ss = dynamic_cast<IDocSimpleSect*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(ss!=0);
|
|
Packit |
1c1d7e |
InPrint(("<simplesect type=%s>\n",ss->typeString()->latin1()));
|
|
Packit |
1c1d7e |
DumpDoc(ss->title(),level+1);
|
|
Packit |
1c1d7e |
DumpDoc(ss->description(),level+1);
|
|
Packit |
1c1d7e |
InPrint(("<simplesect/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Title:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
InPrint(("<title>\n"));
|
|
Packit |
1c1d7e |
IDocTitle *t = dynamic_cast<IDocTitle*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(t!=0);
|
|
Packit |
1c1d7e |
IDocIterator *di = t->title();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
InPrint(("<title/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Ref:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocRef *ref = dynamic_cast<IDocRef*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(ref!=0);
|
|
Packit |
1c1d7e |
InPrint(("<ref id=%s text=%s/>\n",
|
|
Packit |
1c1d7e |
ref->refId()->latin1(),ref->text()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::VariableList:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
InPrint(("<variablelist>\n"));
|
|
Packit |
1c1d7e |
IDocVariableList *vl = dynamic_cast<IDocVariableList*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(vl!=0);
|
|
Packit |
1c1d7e |
IDocIterator *di = vl->entries();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("<variablelist/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::VariableListEntry:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocVariableListEntry *vle = dynamic_cast<IDocVariableListEntry*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(vle!=0);
|
|
Packit |
1c1d7e |
ILinkedTextIterator *lti = vle->term();
|
|
Packit |
1c1d7e |
QString term = linkedTextToString(lti);
|
|
Packit |
1c1d7e |
lti->release();
|
|
Packit |
1c1d7e |
InPrint(("<variablelistentry term=%s>\n",term.latin1()));
|
|
Packit |
1c1d7e |
DumpDoc(vle->description(),level+1);
|
|
Packit |
1c1d7e |
InPrint(("<variablelistentry/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::HRuler:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocHRuler *hr = dynamic_cast<IDocHRuler*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(hr!=0);
|
|
Packit |
1c1d7e |
InPrint(("<hruler/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::LineBreak:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocLineBreak *lb = dynamic_cast<IDocLineBreak*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(lb!=0);
|
|
Packit |
1c1d7e |
InPrint(("<linebreak/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::ULink:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocULink *ul = dynamic_cast<IDocULink*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(ul!=0);
|
|
Packit |
1c1d7e |
InPrint(("<ulink url=`%s' text=`%s'/>\n",ul->url()->latin1(),ul->text()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::EMail:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocEMail *em = dynamic_cast<IDocEMail*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(em!=0);
|
|
Packit |
1c1d7e |
InPrint(("<email address=`%s'/>\n",em->address()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Link:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocLink *lk = dynamic_cast<IDocLink*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(lk!=0);
|
|
Packit |
1c1d7e |
InPrint(("<link refid=`%s' text=`%s'/>\n",lk->refId()->latin1(),lk->text()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::ProgramListing:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocProgramListing *pl = dynamic_cast<IDocProgramListing*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(pl!=0);
|
|
Packit |
1c1d7e |
InPrint(("<programlisting>\n"));
|
|
Packit |
1c1d7e |
IDocIterator *cli = pl->codeLines();
|
|
Packit |
1c1d7e |
IDoc *cl;
|
|
Packit |
1c1d7e |
for (cli->toFirst();(cl=cli->current());cli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(cl,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
cli->release();
|
|
Packit |
1c1d7e |
InPrint(("</programlisting>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::CodeLine:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocCodeLine *cl = dynamic_cast<IDocCodeLine*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(cl!=0);
|
|
Packit |
1c1d7e |
InPrint(("<codeline lineNumber=%d refId=`%s'>\n",cl->lineNumber(),cl->refId()->latin1()));
|
|
Packit |
1c1d7e |
IDocIterator *cei = cl->codeElements();
|
|
Packit |
1c1d7e |
IDoc *ce;
|
|
Packit |
1c1d7e |
for (cei->toFirst();(ce=cei->current());cei->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(ce,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
cei->release();
|
|
Packit |
1c1d7e |
InPrint(("</codeline>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Highlight:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocHighlight *hl = dynamic_cast<IDocHighlight*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(hl!=0);
|
|
Packit |
1c1d7e |
InPrint(("<highlight kind=%d>\n",hl->kind()));
|
|
Packit |
1c1d7e |
IDocIterator *cei = hl->codeElements();
|
|
Packit |
1c1d7e |
IDoc *ce;
|
|
Packit |
1c1d7e |
for (cei->toFirst();(ce=cei->current());cei->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(ce,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
cei->release();
|
|
Packit |
1c1d7e |
InPrint(("</highlight>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Formula:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocFormula *fm = dynamic_cast<IDocFormula*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(fm!=0);
|
|
Packit |
1c1d7e |
InPrint(("<formula id=`%s' text=`%s'/>\n",fm->id()->latin1(),fm->text()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Image:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocImage *img = dynamic_cast<IDocImage*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(img!=0);
|
|
Packit |
1c1d7e |
InPrint(("<image name=`%s' caption=`%s'/>\n",img->name()->latin1(),img->caption()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::DotFile:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocDotFile *df = dynamic_cast<IDocDotFile*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(df!=0);
|
|
Packit |
1c1d7e |
InPrint(("<dotfile name=`%s' caption=`%s'/>\n",df->name()->latin1(),df->caption()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::IndexEntry:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocIndexEntry *ie = dynamic_cast<IDocIndexEntry*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(ie!=0);
|
|
Packit |
1c1d7e |
InPrint(("<indexentry primary=`%s' secondary=`%s'/>\n",ie->primary()->latin1(),ie->secondary()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Table:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocTable *tbl = dynamic_cast<IDocTable*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(tbl!=0);
|
|
Packit |
1c1d7e |
InPrint(("\n",tbl->numColumns(),tbl->caption()->latin1()));
|
|
Packit |
1c1d7e |
IDocIterator *ri = tbl->rows();
|
|
Packit |
1c1d7e |
IDoc *row;
|
|
Packit |
1c1d7e |
for (ri->toFirst();(row=ri->current());ri->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(row,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
ri->release();
|
|
Packit |
1c1d7e |
InPrint(("\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Row:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocRow *row = dynamic_cast<IDocRow*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(row!=0);
|
|
Packit |
1c1d7e |
InPrint(("<row>\n"));
|
|
Packit |
1c1d7e |
IDocIterator *ei = row->entries();
|
|
Packit |
1c1d7e |
IDoc *e;
|
|
Packit |
1c1d7e |
for (ei->toFirst();(e=ei->current());ei->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(e,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
ei->release();
|
|
Packit |
1c1d7e |
InPrint(("</row>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Entry:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocEntry *ent = dynamic_cast<IDocEntry*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(ent!=0);
|
|
Packit |
1c1d7e |
InPrint(("<entry>\n"));
|
|
Packit |
1c1d7e |
IDocIterator *di = ent->contents();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("</entry>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Section:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocSection *sec = dynamic_cast<IDocSection*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(sec!=0);
|
|
Packit |
1c1d7e |
InPrint(("<section id=`%s' level=%d>\n",
|
|
Packit |
1c1d7e |
sec->id()->latin1(),sec->level()));
|
|
Packit |
1c1d7e |
DumpDoc(sec->title(),level+1);
|
|
Packit |
1c1d7e |
IDocIterator *di = sec->paragraphs();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di=sec->subSections();
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
IDocInternal *intern = sec->internal();
|
|
Packit |
1c1d7e |
if (intern)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(intern,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
InPrint(("</section>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Internal:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocInternal *intern = dynamic_cast<IDocInternal*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(intern!=0);
|
|
Packit |
1c1d7e |
InPrint(("<internal>\n"));
|
|
Packit |
1c1d7e |
IDocIterator *di = intern->paragraphs();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di=intern->subSections();
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
InPrint(("</internal>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Copy:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocCopy *cpy = dynamic_cast<IDocCopy*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(cpy!=0);
|
|
Packit |
1c1d7e |
InPrint(("<copydoc>\n"));
|
|
Packit |
1c1d7e |
IDocIterator *di = cpy->contents();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("<copydoc/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::TocItem:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocTocItem *ti = dynamic_cast<IDocTocItem*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(ti!=0);
|
|
Packit |
1c1d7e |
InPrint(("<tocitem id=\"%s\" title=\"%s\"/>\n",
|
|
Packit |
1c1d7e |
ti->id()->latin1(),ti->title()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::TocList:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocTocList *tl = dynamic_cast<IDocTocList*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(tl!=0);
|
|
Packit |
1c1d7e |
InPrint(("<toclist>\n"));
|
|
Packit |
1c1d7e |
IDocIterator *di = tl->elements();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("<toclist/>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Verbatim:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocVerbatim *vt = dynamic_cast<IDocVerbatim*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(vt!=0);
|
|
Packit |
1c1d7e |
const char *s=0;
|
|
Packit |
1c1d7e |
switch (vt->type())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
case IDocVerbatim::Verbatim: s="verbatim"; break;
|
|
Packit |
1c1d7e |
case IDocVerbatim::HtmlOnly: s="htmlonly"; break;
|
|
Packit |
1c1d7e |
case IDocVerbatim::LatexOnly: s="latexonly"; break;
|
|
Packit |
1c1d7e |
default:
|
|
Packit |
1c1d7e |
printf("Invalid verbatim type!\n");
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
InPrint(("<verbatim %s>\n",s));
|
|
Packit |
1c1d7e |
InPrint(("%s",vt->text()->latin1()));
|
|
Packit |
1c1d7e |
InPrint(("</verbatim>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Anchor:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocAnchor *anc = dynamic_cast<IDocAnchor*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(anc!=0);
|
|
Packit |
1c1d7e |
InPrint(("<anchor id='%s'/>\n",anc->id()->latin1()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Symbol:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IDocSymbol *sym = dynamic_cast<IDocSymbol*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(sym!=0);
|
|
Packit |
1c1d7e |
InPrint(("<symbol type=%s letter=%c/>\n",
|
|
Packit |
1c1d7e |
sym->typeString()->latin1(),sym->letter()));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
case IDoc::Root:
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
InPrint(("<root>\n"));
|
|
Packit |
1c1d7e |
IDocRoot *root = dynamic_cast<IDocRoot*>(doc);
|
|
Packit |
1c1d7e |
ASSERT(root!=0);
|
|
Packit |
1c1d7e |
IDocIterator *di = root->contents();
|
|
Packit |
1c1d7e |
IDoc *pdoc;
|
|
Packit |
1c1d7e |
for (di->toFirst();(pdoc=di->current());di->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
DumpDoc(pdoc,level+1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
di->release();
|
|
Packit |
1c1d7e |
InPrint(("</root>\n"));
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
default:
|
|
Packit |
1c1d7e |
printf("Found unsupported node type %d!\n",doc->kind());
|
|
Packit |
1c1d7e |
break;
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
void DumpGraph(IGraph *graph)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
if (graph==0) { printf(" --- no graph ---\n"); return; }
|
|
Packit |
1c1d7e |
printf(" --- graph ----\n");
|
|
Packit |
1c1d7e |
INodeIterator *ni = graph->nodes();
|
|
Packit |
1c1d7e |
INode *node;
|
|
Packit |
1c1d7e |
for (ni->toFirst();(node=ni->current());ni->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf(" --- node id=%s label=%s linkId=%s\n",
|
|
Packit |
1c1d7e |
node->id()->latin1(),
|
|
Packit |
1c1d7e |
node->label()->latin1(),
|
|
Packit |
1c1d7e |
node->linkId()->latin1()
|
|
Packit |
1c1d7e |
);
|
|
Packit |
1c1d7e |
IChildNodeIterator *cni = node->children();
|
|
Packit |
1c1d7e |
IChildNode *cn;
|
|
Packit |
1c1d7e |
for (cni->toFirst();(cn=cni->current());cni->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf(" + child id=%s label=%s relation=%s\n",
|
|
Packit |
1c1d7e |
cn->node()->id()->latin1(),
|
|
Packit |
1c1d7e |
cn->node()->label()->latin1(),
|
|
Packit |
1c1d7e |
cn->relationString()->latin1()
|
|
Packit |
1c1d7e |
);
|
|
Packit |
1c1d7e |
IEdgeLabelIterator *eli = cn->edgeLabels();
|
|
Packit |
1c1d7e |
IEdgeLabel *el;
|
|
Packit |
1c1d7e |
for (eli->toFirst();(el=eli->current());eli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf(" edgeLabel=%s\n",el->label()->latin1());
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
eli->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
cni->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
ni->release();
|
|
Packit |
1c1d7e |
printf(" --- end graph ----\n");
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
void DumpParamList(IParamIterator *pli,int indent)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
QString indentStr;
|
|
Packit |
1c1d7e |
indentStr.fill(' ',indent);
|
|
Packit |
1c1d7e |
IParam *par;
|
|
Packit |
1c1d7e |
for (pli->toFirst();(par=pli->current());pli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
ILinkedTextIterator *lti = par->type();
|
|
Packit |
1c1d7e |
QString parType = linkedTextToString(lti);
|
|
Packit |
1c1d7e |
lti->release();
|
|
Packit |
1c1d7e |
lti = par->defaultValue();
|
|
Packit |
1c1d7e |
QString defVal = linkedTextToString(lti);
|
|
Packit |
1c1d7e |
lti->release();
|
|
Packit |
1c1d7e |
printf("%sParam type=%s decl_name=%s def_name=%s defvalue=%s\n",
|
|
Packit |
1c1d7e |
indentStr.data(), parType.latin1(),
|
|
Packit |
1c1d7e |
par->declarationName()->latin1(),
|
|
Packit |
1c1d7e |
par->definitionName()->latin1(),
|
|
Packit |
1c1d7e |
defVal.latin1());
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
int main(int argc,char **argv)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
if (argc!=2)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf("Usage: %s xmldir\n",argv[0]);
|
|
Packit |
1c1d7e |
exit(1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
IDoxygen *dox = createObjectModel();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
dox->setDebugLevel(4);
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
if (!dox->readXMLDir(argv[1]))
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf("Error reading %s/index.xml\n",argv[1]);
|
|
Packit |
1c1d7e |
exit(1);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
ICompoundIterator *cli = dox->compounds();
|
|
Packit |
1c1d7e |
ICompound *comp;
|
|
Packit |
1c1d7e |
printf("--- compound list ---------\n");
|
|
Packit |
1c1d7e |
for (cli->toFirst();(comp=cli->current());cli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf("Compound name=%s id=%s kind=%s\n",
|
|
Packit |
1c1d7e |
comp->name()->latin1(),comp->id()->latin1(),comp->kindString()->latin1());
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
ISectionIterator *sli = comp->sections();
|
|
Packit |
1c1d7e |
ISection *sec;
|
|
Packit |
1c1d7e |
for (sli->toFirst();(sec=sli->current());sli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf(" Section kind=%s\n",sec->kindString()->latin1());
|
|
Packit |
1c1d7e |
IMemberIterator *mli = sec->members();
|
|
Packit |
1c1d7e |
IMember *mem;
|
|
Packit |
1c1d7e |
if( sec->kind() == ISection::UserDefined )
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IUserDefined *group = dynamic_cast<IUserDefined*>(sec);
|
|
Packit |
1c1d7e |
printf(" Title=%s\n", group->header()->latin1() );
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
for (mli->toFirst();(mem=mli->current());mli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
ILinkedTextIterator *lti = mem->type();
|
|
Packit |
1c1d7e |
printf(" Member type=%s name=%s\n",
|
|
Packit |
1c1d7e |
linkedTextToString(lti).latin1(),mem->name()->latin1());
|
|
Packit |
1c1d7e |
lti->release();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
IParamIterator *pli = mem->parameters();
|
|
Packit |
1c1d7e |
DumpParamList(pli,6);
|
|
Packit |
1c1d7e |
pli->release();
|
|
Packit |
1c1d7e |
IMemberReferenceIterator *mri = mem->references();
|
|
Packit |
1c1d7e |
IMemberReference *mr;
|
|
Packit |
1c1d7e |
for (mri->toFirst();(mr=mri->current());mri->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IMember *memr = mr->member();
|
|
Packit |
1c1d7e |
printf(" References %s at line %d\n",
|
|
Packit |
1c1d7e |
mr->name()->latin1(),memr->bodyStart());
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
mri->release();
|
|
Packit |
1c1d7e |
mri = mem->referencedBy();
|
|
Packit |
1c1d7e |
for (mri->toFirst();(mr=mri->current());mri->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IMember *memr = mr->member();
|
|
Packit |
1c1d7e |
printf(" ReferencedBy %s at line %d\n",
|
|
Packit |
1c1d7e |
mr->name()->latin1(),memr->bodyStart());
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
mri->release();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
if (mem->kind()==IMember::Enum) // we have found an enum
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IEnum *e = dynamic_cast<IEnum*>(mem);
|
|
Packit |
1c1d7e |
IMemberIterator *evi = e->enumValues(); // get the enum values
|
|
Packit |
1c1d7e |
IMember *mev;
|
|
Packit |
1c1d7e |
for (evi->toFirst();(mev=evi->current());evi->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IEnumValue *ev = dynamic_cast<IEnumValue*>(mev);
|
|
Packit |
1c1d7e |
ILinkedTextIterator *lti = ev->initializer();
|
|
Packit |
1c1d7e |
QString init = linkedTextToString(lti);
|
|
Packit |
1c1d7e |
lti->release();
|
|
Packit |
1c1d7e |
printf(" Enum value `%s' init=`%s'\n",
|
|
Packit |
1c1d7e |
ev->name()->latin1(),init.latin1());
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
evi->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
pli = mem->templateParameters();
|
|
Packit |
1c1d7e |
if (pli)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf(" Template parameters\n");
|
|
Packit |
1c1d7e |
DumpParamList(pli,8);
|
|
Packit |
1c1d7e |
pli->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
IDoc *doc = mem->briefDescription();
|
|
Packit |
1c1d7e |
if (doc)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf("===== brief description ==== \n");
|
|
Packit |
1c1d7e |
DumpDoc(doc,0);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
doc = mem->detailedDescription();
|
|
Packit |
1c1d7e |
if (doc)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf("===== detailed description ==== \n");
|
|
Packit |
1c1d7e |
DumpDoc(doc,0);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
mli->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
sli->release();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
IDoc *doc = comp->briefDescription();
|
|
Packit |
1c1d7e |
if (doc)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf("===== brief description ==== \n");
|
|
Packit |
1c1d7e |
DumpDoc(doc,0);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
doc = comp->detailedDescription();
|
|
Packit |
1c1d7e |
if (doc)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
printf("===== detailed description ==== \n");
|
|
Packit |
1c1d7e |
DumpDoc(doc,0);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
if (comp->kind()==ICompound::Class)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IClass *cls = dynamic_cast<IClass*>(comp);
|
|
Packit |
1c1d7e |
ASSERT(cls!=0);
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
printf("==== inheritance graph ==== \n");
|
|
Packit |
1c1d7e |
DumpGraph(cls->inheritanceGraph());
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
printf("==== collabration graph ==== \n");
|
|
Packit |
1c1d7e |
DumpGraph(cls->collaborationGraph());
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
printf("==== base classes ==== \n");
|
|
Packit |
1c1d7e |
IRelatedCompoundIterator *bcli = cls->baseCompounds();
|
|
Packit |
1c1d7e |
IRelatedCompound *bClass;
|
|
Packit |
1c1d7e |
for (bcli->toFirst();(bClass=bcli->current());bcli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
ICompound *bc = bClass->compound();
|
|
Packit |
1c1d7e |
printf(" + class %s\n",bc->name()->latin1());
|
|
Packit |
1c1d7e |
bc->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
bcli->release();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
printf("==== derived classes ==== \n");
|
|
Packit |
1c1d7e |
IRelatedCompoundIterator *dcli = cls->derivedCompounds();
|
|
Packit |
1c1d7e |
IRelatedCompound *dClass;
|
|
Packit |
1c1d7e |
for (dcli->toFirst();(dClass=dcli->current());dcli->toNext())
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
ICompound *dc = dClass->compound();
|
|
Packit |
1c1d7e |
printf(" + class %s\n",dc->name()->latin1());
|
|
Packit |
1c1d7e |
dc->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
dcli->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
else if (comp->kind()==ICompound::File)
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
IFile *file = dynamic_cast<IFile*>(comp);
|
|
Packit |
1c1d7e |
ASSERT(file!=0);
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
printf("==== include dependency graph ==== \n");
|
|
Packit |
1c1d7e |
DumpGraph(file->includeDependencyGraph());
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
printf("==== included by dependency graph ==== \n");
|
|
Packit |
1c1d7e |
DumpGraph(file->includedByDependencyGraph());
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
printf("==== source ====\n");
|
|
Packit |
1c1d7e |
DumpDoc(file->source(),0);
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
comp->release();
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
cli->release();
|
|
Packit |
1c1d7e |
printf("---------------------------\n");
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
dox->release();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
return 0;
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|