Macros | Functions
main.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <doxmlintf.h>
#include <qstring.h>

Go to the source code of this file.

Macros

#define InPrint(x)   printf("%s",indent.latin1()), printf x;
 

Functions

QString linkedTextToString (ILinkedTextIterator *ti)
 
void DumpDoc (IDoc *doc, int level)
 
void DumpGraph (IGraph *graph)
 
void DumpParamList (IParamIterator *pli, int indent)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

#define InPrint (   x)    printf("%s",indent.latin1()), printf x;

Macro for printing an indented message.

Definition at line 42 of file main.cpp.

Function Documentation

void DumpDoc ( IDoc doc,
int  level 
)

Dumps the contents of a documentation block to stdout.

Note
This function will call itself recursively.
Parameters
docThe root of the documentation tree.
levelThe indent level.

Definition at line 49 of file main.cpp.

50 {
51  if (doc==0) return;
53  indent.fill(' ',level);
54  //printf(" doc node kind=`%d'\n",doc->kind());
55  switch (doc->kind())
56  {
57  case IDoc::Para:
58  {
59  InPrint(("<para>\n"));
60  IDocPara *par = dynamic_cast<IDocPara*>(doc);
61  ASSERT(par!=0);
62  IDocIterator *di = par->contents();
63  IDoc *pdoc;
64  for (di->toFirst();(pdoc=di->current());di->toNext())
65  {
66  DumpDoc(pdoc,level+1);
67  }
68  di->release();
69  InPrint(("</para>\n"));
70  }
71  break;
72  case IDoc::Text:
73  {
74  IDocText *txt = dynamic_cast<IDocText*>(doc);
75  ASSERT(txt!=0);
76  InPrint(("<text value=`%s' markup=%d headingLevel=%d/>\n",
77  txt->text()->latin1(),txt->markup(),txt->headingLevel()));
78  }
79  break;
81  {
82  IDocMarkupModifier *md = dynamic_cast<IDocMarkupModifier*>(doc);
83  ASSERT(md!=0);
84  InPrint(("<markup modifier enabled=%d markup=%d headingLevel=%d/>\n",
85  md->enabled(),md->markup(),md->headingLevel()));
86  }
87  break;
88  case IDoc::ItemizedList:
89  {
90  InPrint(("<itemized list>\n"));
91  IDocItemizedList *list = dynamic_cast<IDocItemizedList*>(doc);
92  ASSERT(list!=0);
93  IDocIterator *di = list->elements();
94  IDoc *pdoc;
95  for (di->toFirst();(pdoc=di->current());di->toNext())
96  {
97  DumpDoc(pdoc,level+1);
98  }
99  di->release();
100  InPrint(("</itemized list>\n"));
101  }
102  break;
103  case IDoc::OrderedList:
104  {
105  InPrint(("<ordered list>\n"));
106  IDocOrderedList *list = dynamic_cast<IDocOrderedList*>(doc);
107  ASSERT(list!=0);
108  IDocIterator *di = list->elements();
109  IDoc *pdoc;
110  for (di->toFirst();(pdoc=di->current());di->toNext())
111  {
112  DumpDoc(pdoc,level+1);
113  }
114  di->release();
115  InPrint(("</ordered list>\n"));
116  }
117  break;
118  case IDoc::ListItem:
119  {
120  InPrint(("<list item>\n"));
121  IDocListItem *li = dynamic_cast<IDocListItem*>(doc);
122  ASSERT(li!=0);
123  IDocIterator *di = li->contents();
124  IDoc *pdoc;
125  for (di->toFirst();(pdoc=di->current());di->toNext())
126  {
127  DumpDoc(pdoc,level+1);
128  }
129  di->release();
130  InPrint(("</list item>\n"));
131  }
132  break;
133  case IDoc::ParameterItem:
134  {
135  IDocParameterItem *item = dynamic_cast<IDocParameterItem*>(doc);
136  InPrint(("<parameter item>\n"));
137  IDocIterator *di = item->paramNames();
138  IDoc *pdoc;
139  for (di->toFirst();(pdoc=di->current());di->toNext())
140  {
141  DumpDoc(pdoc,level+1);
142  }
143  di->release();
144  DumpDoc(item->description(),level+1);
145  InPrint(("</parameter item>\n"));
146  }
147  break;
148  case IDoc::ParameterList:
149  {
150  IDocParameterList *list = dynamic_cast<IDocParameterList*>(doc);
151  InPrint(("<parameter list type=%d>\n",list->sectType()));
152  IDocIterator *di = list->params();
153  IDoc *pdoc;
154  for (di->toFirst();(pdoc=di->current());di->toNext())
155  {
156  DumpDoc(pdoc,level+1);
157  }
158  di->release();
159  InPrint(("</parameter list>\n"));
160  ASSERT(list!=0);
161  }
162  break;
163  case IDoc::Parameter:
164  {
165  IDocParameter *par = dynamic_cast<IDocParameter*>(doc);
166  ASSERT(par!=0);
167  InPrint(("<parameter name=%s/>\n",par->name()->latin1()));
168  }
169  break;
170  case IDoc::SimpleSect:
171  {
172  IDocSimpleSect *ss = dynamic_cast<IDocSimpleSect*>(doc);
173  ASSERT(ss!=0);
174  InPrint(("<simplesect type=%s>\n",ss->typeString()->latin1()));
175  DumpDoc(ss->title(),level+1);
176  DumpDoc(ss->description(),level+1);
177  InPrint(("<simplesect/>\n"));
178  }
179  break;
180  case IDoc::Title:
181  {
182  InPrint(("<title>\n"));
183  IDocTitle *t = dynamic_cast<IDocTitle*>(doc);
184  ASSERT(t!=0);
185  IDocIterator *di = t->title();
186  IDoc *pdoc;
187  for (di->toFirst();(pdoc=di->current());di->toNext())
188  {
189  DumpDoc(pdoc,level+1);
190  }
191  InPrint(("<title/>\n"));
192  }
193  break;
194  case IDoc::Ref:
195  {
196  IDocRef *ref = dynamic_cast<IDocRef*>(doc);
197  ASSERT(ref!=0);
198  InPrint(("<ref id=%s text=%s/>\n",
199  ref->refId()->latin1(),ref->text()->latin1()));
200  }
201  break;
202  case IDoc::VariableList:
203  {
204  InPrint(("<variablelist>\n"));
205  IDocVariableList *vl = dynamic_cast<IDocVariableList*>(doc);
206  ASSERT(vl!=0);
207  IDocIterator *di = vl->entries();
208  IDoc *pdoc;
209  for (di->toFirst();(pdoc=di->current());di->toNext())
210  {
211  DumpDoc(pdoc,level+1);
212  }
213  di->release();
214  InPrint(("<variablelist/>\n"));
215  }
216  break;
218  {
219  IDocVariableListEntry *vle = dynamic_cast<IDocVariableListEntry*>(doc);
220  ASSERT(vle!=0);
221  ILinkedTextIterator *lti = vle->term();
222  QString term = linkedTextToString(lti);
223  lti->release();
224  InPrint(("<variablelistentry term=%s>\n",term.latin1()));
225  DumpDoc(vle->description(),level+1);
226  InPrint(("<variablelistentry/>\n"));
227  }
228  break;
229  case IDoc::HRuler:
230  {
231  IDocHRuler *hr = dynamic_cast<IDocHRuler*>(doc);
232  ASSERT(hr!=0);
233  InPrint(("<hruler/>\n"));
234  }
235  break;
236  case IDoc::LineBreak:
237  {
238  IDocLineBreak *lb = dynamic_cast<IDocLineBreak*>(doc);
239  ASSERT(lb!=0);
240  InPrint(("<linebreak/>\n"));
241  }
242  break;
243  case IDoc::ULink:
244  {
245  IDocULink *ul = dynamic_cast<IDocULink*>(doc);
246  ASSERT(ul!=0);
247  InPrint(("<ulink url=`%s' text=`%s'/>\n",ul->url()->latin1(),ul->text()->latin1()));
248  }
249  break;
250  case IDoc::EMail:
251  {
252  IDocEMail *em = dynamic_cast<IDocEMail*>(doc);
253  ASSERT(em!=0);
254  InPrint(("<email address=`%s'/>\n",em->address()->latin1()));
255  }
256  break;
257  case IDoc::Link:
258  {
259  IDocLink *lk = dynamic_cast<IDocLink*>(doc);
260  ASSERT(lk!=0);
261  InPrint(("<link refid=`%s' text=`%s'/>\n",lk->refId()->latin1(),lk->text()->latin1()));
262  }
263  break;
265  {
266  IDocProgramListing *pl = dynamic_cast<IDocProgramListing*>(doc);
267  ASSERT(pl!=0);
268  InPrint(("<programlisting>\n"));
269  IDocIterator *cli = pl->codeLines();
270  IDoc *cl;
271  for (cli->toFirst();(cl=cli->current());cli->toNext())
272  {
273  DumpDoc(cl,level+1);
274  }
275  cli->release();
276  InPrint(("</programlisting>\n"));
277  }
278  break;
279  case IDoc::CodeLine:
280  {
281  IDocCodeLine *cl = dynamic_cast<IDocCodeLine*>(doc);
282  ASSERT(cl!=0);
283  InPrint(("<codeline lineNumber=%d refId=`%s'>\n",cl->lineNumber(),cl->refId()->latin1()));
284  IDocIterator *cei = cl->codeElements();
285  IDoc *ce;
286  for (cei->toFirst();(ce=cei->current());cei->toNext())
287  {
288  DumpDoc(ce,level+1);
289  }
290  cei->release();
291  InPrint(("</codeline>\n"));
292  }
293  break;
294  case IDoc::Highlight:
295  {
296  IDocHighlight *hl = dynamic_cast<IDocHighlight*>(doc);
297  ASSERT(hl!=0);
298  InPrint(("<highlight kind=%d>\n",hl->kind()));
299  IDocIterator *cei = hl->codeElements();
300  IDoc *ce;
301  for (cei->toFirst();(ce=cei->current());cei->toNext())
302  {
303  DumpDoc(ce,level+1);
304  }
305  cei->release();
306  InPrint(("</highlight>\n"));
307  }
308  break;
309  case IDoc::Formula:
310  {
311  IDocFormula *fm = dynamic_cast<IDocFormula*>(doc);
312  ASSERT(fm!=0);
313  InPrint(("<formula id=`%s' text=`%s'/>\n",fm->id()->latin1(),fm->text()->latin1()));
314  }
315  break;
316  case IDoc::Image:
317  {
318  IDocImage *img = dynamic_cast<IDocImage*>(doc);
319  ASSERT(img!=0);
320  InPrint(("<image name=`%s' caption=`%s'/>\n",img->name()->latin1(),img->caption()->latin1()));
321  }
322  break;
323  case IDoc::DotFile:
324  {
325  IDocDotFile *df = dynamic_cast<IDocDotFile*>(doc);
326  ASSERT(df!=0);
327  InPrint(("<dotfile name=`%s' caption=`%s'/>\n",df->name()->latin1(),df->caption()->latin1()));
328  }
329  break;
330  case IDoc::IndexEntry:
331  {
332  IDocIndexEntry *ie = dynamic_cast<IDocIndexEntry*>(doc);
333  ASSERT(ie!=0);
334  InPrint(("<indexentry primary=`%s' secondary=`%s'/>\n",ie->primary()->latin1(),ie->secondary()->latin1()));
335  }
336  break;
337  case IDoc::Table:
338  {
339  IDocTable *tbl = dynamic_cast<IDocTable*>(doc);
340  ASSERT(tbl!=0);
341  InPrint(("<table numcols=%d caption=`%s'>\n",tbl->numColumns(),tbl->caption()->latin1()));
342  IDocIterator *ri = tbl->rows();
343  IDoc *row;
344  for (ri->toFirst();(row=ri->current());ri->toNext())
345  {
346  DumpDoc(row,level+1);
347  }
348  ri->release();
349  InPrint(("</table>\n"));
350  }
351  break;
352  case IDoc::Row:
353  {
354  IDocRow *row = dynamic_cast<IDocRow*>(doc);
355  ASSERT(row!=0);
356  InPrint(("<row>\n"));
357  IDocIterator *ei = row->entries();
358  IDoc *e;
359  for (ei->toFirst();(e=ei->current());ei->toNext())
360  {
361  DumpDoc(e,level+1);
362  }
363  ei->release();
364  InPrint(("</row>\n"));
365  }
366  break;
367  case IDoc::Entry:
368  {
369  IDocEntry *ent = dynamic_cast<IDocEntry*>(doc);
370  ASSERT(ent!=0);
371  InPrint(("<entry>\n"));
372  IDocIterator *di = ent->contents();
373  IDoc *pdoc;
374  for (di->toFirst();(pdoc=di->current());di->toNext())
375  {
376  DumpDoc(pdoc,level+1);
377  }
378  di->release();
379  InPrint(("</entry>\n"));
380  }
381  break;
382  case IDoc::Section:
383  {
384  IDocSection *sec = dynamic_cast<IDocSection*>(doc);
385  ASSERT(sec!=0);
386  InPrint(("<section id=`%s' level=%d>\n",
387  sec->id()->latin1(),sec->level()));
388  DumpDoc(sec->title(),level+1);
389  IDocIterator *di = sec->paragraphs();
390  IDoc *pdoc;
391  for (di->toFirst();(pdoc=di->current());di->toNext())
392  {
393  DumpDoc(pdoc,level+1);
394  }
395  di=sec->subSections();
396  for (di->toFirst();(pdoc=di->current());di->toNext())
397  {
398  DumpDoc(pdoc,level+1);
399  }
400  IDocInternal *intern = sec->internal();
401  if (intern)
402  {
403  DumpDoc(intern,level+1);
404  }
405  InPrint(("</section>\n"));
406  }
407  break;
408  case IDoc::Internal:
409  {
410  IDocInternal *intern = dynamic_cast<IDocInternal*>(doc);
411  ASSERT(intern!=0);
412  InPrint(("<internal>\n"));
413  IDocIterator *di = intern->paragraphs();
414  IDoc *pdoc;
415  for (di->toFirst();(pdoc=di->current());di->toNext())
416  {
417  DumpDoc(pdoc,level+1);
418  }
419  di=intern->subSections();
420  for (di->toFirst();(pdoc=di->current());di->toNext())
421  {
422  DumpDoc(pdoc,level+1);
423  }
424  InPrint(("</internal>\n"));
425  }
426  break;
427  case IDoc::Copy:
428  {
429  IDocCopy *cpy = dynamic_cast<IDocCopy*>(doc);
430  ASSERT(cpy!=0);
431  InPrint(("<copydoc>\n"));
432  IDocIterator *di = cpy->contents();
433  IDoc *pdoc;
434  for (di->toFirst();(pdoc=di->current());di->toNext())
435  {
436  DumpDoc(pdoc,level+1);
437  }
438  di->release();
439  InPrint(("<copydoc/>\n"));
440  }
441  break;
442  case IDoc::TocItem:
443  {
444  IDocTocItem *ti = dynamic_cast<IDocTocItem*>(doc);
445  ASSERT(ti!=0);
446  InPrint(("<tocitem id=\"%s\" title=\"%s\"/>\n",
447  ti->id()->latin1(),ti->title()->latin1()));
448  }
449  break;
450  case IDoc::TocList:
451  {
452  IDocTocList *tl = dynamic_cast<IDocTocList*>(doc);
453  ASSERT(tl!=0);
454  InPrint(("<toclist>\n"));
455  IDocIterator *di = tl->elements();
456  IDoc *pdoc;
457  for (di->toFirst();(pdoc=di->current());di->toNext())
458  {
459  DumpDoc(pdoc,level+1);
460  }
461  di->release();
462  InPrint(("<toclist/>\n"));
463  }
464  break;
465  case IDoc::Verbatim:
466  {
467  IDocVerbatim *vt = dynamic_cast<IDocVerbatim*>(doc);
468  ASSERT(vt!=0);
469  const char *s=0;
470  switch (vt->type())
471  {
472  case IDocVerbatim::Verbatim: s="verbatim"; break;
473  case IDocVerbatim::HtmlOnly: s="htmlonly"; break;
474  case IDocVerbatim::LatexOnly: s="latexonly"; break;
475  default:
476  printf("Invalid verbatim type!\n");
477  }
478  InPrint(("<verbatim %s>\n",s));
479  InPrint(("%s",vt->text()->latin1()));
480  InPrint(("</verbatim>\n"));
481  }
482  break;
483  case IDoc::Anchor:
484  {
485  IDocAnchor *anc = dynamic_cast<IDocAnchor*>(doc);
486  ASSERT(anc!=0);
487  InPrint(("<anchor id='%s'/>\n",anc->id()->latin1()));
488  }
489  break;
490  case IDoc::Symbol:
491  {
492  IDocSymbol *sym = dynamic_cast<IDocSymbol*>(doc);
493  ASSERT(sym!=0);
494  InPrint(("<symbol type=%s letter=%c/>\n",
495  sym->typeString()->latin1(),sym->letter()));
496  }
497  break;
498  case IDoc::Root:
499  {
500  InPrint(("<root>\n"));
501  IDocRoot *root = dynamic_cast<IDocRoot*>(doc);
502  ASSERT(root!=0);
503  IDocIterator *di = root->contents();
504  IDoc *pdoc;
505  for (di->toFirst();(pdoc=di->current());di->toNext())
506  {
507  DumpDoc(pdoc,level+1);
508  }
509  di->release();
510  InPrint(("</root>\n"));
511  }
512  break;
513 
514  default:
515  printf("Found unsupported node type %d!\n",doc->kind());
516  break;
517  }
518 }
virtual IDocIterator * paramNames() const =0
virtual IDocIterator * elements() const =0
virtual void release()=0
virtual IDocIterator * subSections() const =0
virtual IDocIterator * contents() const =0
virtual const IString * typeString() const =0
virtual IDocPara * description() const =0
virtual int headingLevel() const =0
virtual const IString * secondary() const =0
virtual IDocIterator * entries() const =0
virtual int numColumns() const =0
virtual IDocIterator * contents() const =0
virtual int level() const =0
virtual const IString * id() const =0
virtual const IString * title() const =0
virtual bool enabled() const =0
virtual const char * latin1() const =0
virtual IDoc * current() const =0
virtual const IString * refId() const =0
virtual const IString * text() const =0
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
virtual IDoc * toNext()=0
virtual const IString * caption() const =0
virtual const IString * refId() const =0
virtual const IString * id() const =0
void fill(QChar c, int len=-1)
Definition: qstring.cpp:12865
virtual const IString * text() const =0
QAsciiDict< Entry > cl
virtual IDocInternal * internal() const =0
virtual Types sectType() const =0
virtual IDocIterator * paragraphs() const =0
def cli(ctx)
Definition: main.py:7
virtual IDocPara * description() const =0
virtual IDocIterator * rows() const =0
const double e
virtual IDocIterator * contents() const =0
virtual const IString * text() const =0
virtual IDoc * toFirst()=0
QString linkedTextToString(ILinkedTextIterator *ti)
Definition: main.cpp:24
virtual IDocPara * description() const =0
virtual IDocTitle * title() const =0
virtual IDocIterator * title() const =0
#define InPrint(x)
Definition: main.cpp:42
virtual const IString * id() const =0
virtual int markup() const =0
virtual Kind kind() const =0
void DumpDoc(IDoc *doc, int level)
Definition: main.cpp:49
virtual const IString * typeString() const =0
virtual const IString * primary() const =0
virtual const IString * name() const =0
virtual void release()=0
virtual const IString * address() const =0
Iterates over a list of ILinkedText fragments.
Definition: doxmlintf.h:97
virtual IDocIterator * entries() const =0
virtual int markup() const =0
virtual char letter() const =0
virtual int lineNumber() const =0
virtual IDocIterator * elements() const =0
virtual IDocIterator * contents() const =0
virtual IDocIterator * params() const =0
virtual ILinkedTextIterator * term() const =0
QCString doc
virtual const IString * name() const =0
const char * latin1() const
Definition: qstring.cpp:14457
virtual IDocIterator * elements() const =0
virtual IDocIterator * subSections() const =0
static constexpr double fm
Definition: Units.h:75
virtual const IString * text() const =0
virtual const IString * caption() const =0
virtual const IString * caption() const =0
virtual IDocIterator * codeElements() const =0
virtual Types type() const =0
virtual IDocIterator * paragraphs() const =0
virtual IDocTitle * title() const =0
virtual IDocIterator * codeLines() const =0
virtual int headingLevel() const =0
virtual const IString * name() const =0
static QCString * s
Definition: config.cpp:1042
virtual IDocIterator * contents() const =0
virtual IDocIterator * codeElements() const =0
#define ASSERT(x)
Definition: qglobal.h:590
virtual const IString * id() const =0
void DumpGraph ( IGraph graph)

Definition at line 520 of file main.cpp.

521 {
522  if (graph==0) { printf(" --- no graph ---\n"); return; }
523  printf(" --- graph ----\n");
524  INodeIterator *ni = graph->nodes();
525  INode *node;
526  for (ni->toFirst();(node=ni->current());ni->toNext())
527  {
528  printf(" --- node id=%s label=%s linkId=%s\n",
529  node->id()->latin1(),
530  node->label()->latin1(),
531  node->linkId()->latin1()
532  );
533  IChildNodeIterator *cni = node->children();
534  IChildNode *cn;
535  for (cni->toFirst();(cn=cni->current());cni->toNext())
536  {
537  printf(" + child id=%s label=%s relation=%s\n",
538  cn->node()->id()->latin1(),
539  cn->node()->label()->latin1(),
540  cn->relationString()->latin1()
541  );
542  IEdgeLabelIterator *eli = cn->edgeLabels();
543  IEdgeLabel *el;
544  for (eli->toFirst();(el=eli->current());eli->toNext())
545  {
546  printf(" edgeLabel=%s\n",el->label()->latin1());
547  }
548  eli->release();
549  }
550  cni->release();
551  }
552  ni->release();
553  printf(" --- end graph ----\n");
554 
555 }
virtual INode * toNext()=0
virtual const IString * relationString() const =0
virtual const char * latin1() const =0
virtual const IString * id() const =0
virtual INodeIterator * nodes() const =0
virtual const IString * linkId() const =0
virtual INode * current() const =0
virtual INode * toFirst()=0
virtual void release()=0
virtual IEdgeLabelIterator * edgeLabels() const =0
virtual const IString * label() const =0
virtual IChildNodeIterator * children() const =0
virtual const IString * label() const =0
virtual INode * node() const =0
void DumpParamList ( IParamIterator pli,
int  indent 
)

Definition at line 557 of file main.cpp.

558 {
559  QString indentStr;
560  indentStr.fill(' ',indent);
561  IParam *par;
562  for (pli->toFirst();(par=pli->current());pli->toNext())
563  {
564  ILinkedTextIterator *lti = par->type();
565  QString parType = linkedTextToString(lti);
566  lti->release();
567  lti = par->defaultValue();
568  QString defVal = linkedTextToString(lti);
569  lti->release();
570  printf("%sParam type=%s decl_name=%s def_name=%s defvalue=%s\n",
571  indentStr.data(), parType.latin1(),
572  par->declarationName()->latin1(),
573  par->definitionName()->latin1(),
574  defVal.latin1());
575  }
576 }
virtual IParam * current() const =0
virtual const IString * declarationName() const =0
virtual void release()=0
virtual const char * latin1() const =0
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
void fill(QChar c, int len=-1)
Definition: qstring.cpp:12865
const char * data() const
Definition: qstring.h:542
QString linkedTextToString(ILinkedTextIterator *ti)
Definition: main.cpp:24
virtual IParam * toNext()=0
virtual ILinkedTextIterator * defaultValue() const =0
Iterates over a list of ILinkedText fragments.
Definition: doxmlintf.h:97
Representation of a parameter of a function.
Definition: doxmlintf.h:110
const char * latin1() const
Definition: qstring.cpp:14457
virtual ILinkedTextIterator * type() const =0
virtual IParam * toFirst()=0
virtual const IString * definitionName() const =0
QString linkedTextToString ( ILinkedTextIterator ti)

Dumps the contents of a hyperlinked text fragment as plain text to the output.

Definition at line 24 of file main.cpp.

25 {
27  ILinkedText *lt=0;
28  for (ti->toFirst();(lt=ti->current());ti->toNext())
29  {
30  switch (lt->kind())
31  {
32  case ILinkedText::Kind_Text: // plain text
33  result+=dynamic_cast<ILT_Text*>(lt)->text()->latin1(); break;
34  case ILinkedText::Kind_Ref: // a link
35  result+=dynamic_cast<ILT_Ref *>(lt)->text()->latin1(); break;
36  }
37  }
38  return result;
39 }
static QCString result
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
virtual ILinkedText * toNext()=0
Reference to an object.
Definition: doxmlintf.h:84
virtual ILinkedText * current() const =0
Base interface for hyperlinked text.
Definition: doxmlintf.h:65
Plain text fragment.
Definition: doxmlintf.h:75
virtual Kind kind() const =0
virtual ILinkedText * toFirst()=0
int main ( int  argc,
char **  argv 
)

Definition at line 578 of file main.cpp.

579 {
580  if (argc!=2)
581  {
582  printf("Usage: %s xmldir\n",argv[0]);
583  exit(1);
584  }
585 
586  IDoxygen *dox = createObjectModel();
587 
588  dox->setDebugLevel(4);
589 
590  if (!dox->readXMLDir(argv[1]))
591  {
592  printf("Error reading %s/index.xml\n",argv[1]);
593  exit(1);
594  }
595 
596  ICompoundIterator *cli = dox->compounds();
597  ICompound *comp;
598  printf("--- compound list ---------\n");
599  for (cli->toFirst();(comp=cli->current());cli->toNext())
600  {
601  printf("Compound name=%s id=%s kind=%s\n",
602  comp->name()->latin1(),comp->id()->latin1(),comp->kindString()->latin1());
603 
604  ISectionIterator *sli = comp->sections();
605  ISection *sec;
606  for (sli->toFirst();(sec=sli->current());sli->toNext())
607  {
608  printf(" Section kind=%s\n",sec->kindString()->latin1());
609  IMemberIterator *mli = sec->members();
610  IMember *mem;
611  if( sec->kind() == ISection::UserDefined )
612  {
613  IUserDefined *group = dynamic_cast<IUserDefined*>(sec);
614  printf(" Title=%s\n", group->header()->latin1() );
615  }
616  for (mli->toFirst();(mem=mli->current());mli->toNext())
617  {
618  ILinkedTextIterator *lti = mem->type();
619  printf(" Member type=%s name=%s\n",
620  linkedTextToString(lti).latin1(),mem->name()->latin1());
621  lti->release();
622 
623  IParamIterator *pli = mem->parameters();
624  DumpParamList(pli,6);
625  pli->release();
626  IMemberReferenceIterator *mri = mem->references();
627  IMemberReference *mr;
628  for (mri->toFirst();(mr=mri->current());mri->toNext())
629  {
630  IMember *memr = mr->member();
631  printf(" References %s at line %d\n",
632  mr->name()->latin1(),memr->bodyStart());
633  }
634 
635  mri->release();
636  mri = mem->referencedBy();
637  for (mri->toFirst();(mr=mri->current());mri->toNext())
638  {
639  IMember *memr = mr->member();
640  printf(" ReferencedBy %s at line %d\n",
641  mr->name()->latin1(),memr->bodyStart());
642  }
643  mri->release();
644 
645  if (mem->kind()==IMember::Enum) // we have found an enum
646  {
647  IEnum *e = dynamic_cast<IEnum*>(mem);
648  IMemberIterator *evi = e->enumValues(); // get the enum values
649  IMember *mev;
650  for (evi->toFirst();(mev=evi->current());evi->toNext())
651  {
652  IEnumValue *ev = dynamic_cast<IEnumValue*>(mev);
653  ILinkedTextIterator *lti = ev->initializer();
655  lti->release();
656  printf(" Enum value `%s' init=`%s'\n",
657  ev->name()->latin1(),init.latin1());
658  }
659  evi->release();
660  }
661 
662  pli = mem->templateParameters();
663  if (pli)
664  {
665  printf(" Template parameters\n");
666  DumpParamList(pli,8);
667  pli->release();
668  }
669 
670  IDoc *doc = mem->briefDescription();
671  if (doc)
672  {
673  printf("===== brief description ==== \n");
674  DumpDoc(doc,0);
675  }
676 
677  doc = mem->detailedDescription();
678  if (doc)
679  {
680  printf("===== detailed description ==== \n");
681  DumpDoc(doc,0);
682  }
683  }
684  mli->release();
685  }
686  sli->release();
687 
688  IDoc *doc = comp->briefDescription();
689  if (doc)
690  {
691  printf("===== brief description ==== \n");
692  DumpDoc(doc,0);
693  }
694 
695  doc = comp->detailedDescription();
696  if (doc)
697  {
698  printf("===== detailed description ==== \n");
699  DumpDoc(doc,0);
700  }
701 
702  if (comp->kind()==ICompound::Class)
703  {
704  IClass *cls = dynamic_cast<IClass*>(comp);
705  ASSERT(cls!=0);
706 
707  printf("==== inheritance graph ==== \n");
708  DumpGraph(cls->inheritanceGraph());
709 
710  printf("==== collabration graph ==== \n");
712 
713  printf("==== base classes ==== \n");
715  IRelatedCompound *bClass;
716  for (bcli->toFirst();(bClass=bcli->current());bcli->toNext())
717  {
718  ICompound *bc = bClass->compound();
719  printf(" + class %s\n",bc->name()->latin1());
720  bc->release();
721  }
722  bcli->release();
723 
724  printf("==== derived classes ==== \n");
726  IRelatedCompound *dClass;
727  for (dcli->toFirst();(dClass=dcli->current());dcli->toNext())
728  {
729  ICompound *dc = dClass->compound();
730  printf(" + class %s\n",dc->name()->latin1());
731  dc->release();
732  }
733  dcli->release();
734  }
735  else if (comp->kind()==ICompound::File)
736  {
737  IFile *file = dynamic_cast<IFile*>(comp);
738  ASSERT(file!=0);
739 
740  printf("==== include dependency graph ==== \n");
742 
743  printf("==== included by dependency graph ==== \n");
745 
746  printf("==== source ====\n");
747  DumpDoc(file->source(),0);
748  }
749 
750  comp->release();
751  }
752  cli->release();
753  printf("---------------------------\n");
754 
755  dox->release();
756 
757  return 0;
758 }
virtual IMember * current() const =0
The interface to a class in the object model.
Definition: doxmlintf.h:968
virtual IRelatedCompound * toNext()=0
virtual const IString * name() const =0
virtual const IString * header() const =0
virtual IMember * member() const =0
virtual void release()=0
virtual IDocRoot * briefDescription() const =0
virtual bool readXMLDir(const char *xmlDirName)=0
virtual IDocRoot * briefDescription() const =0
virtual IParamIterator * parameters() const =0
virtual IGraph * collaborationGraph() const =0
virtual IDocRoot * detailedDescription() const =0
virtual const IString * id() const =0
void DumpParamList(IParamIterator *pli, int indent)
Definition: main.cpp:557
virtual IMemberReference * toNext()=0
virtual IGraph * includeDependencyGraph() const =0
virtual const char * latin1() const =0
virtual void release()=0
virtual IParamIterator * templateParameters() const =0
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
virtual ILinkedTextIterator * initializer() const =0
virtual IMemberReferenceIterator * references() const =0
init
Definition: train.py:42
virtual IDocRoot * detailedDescription() const =0
virtual void release()=0
virtual IGraph * includedByDependencyGraph() const =0
virtual IMemberIterator * enumValues() const =0
virtual ICompound * current() const =0
virtual const IString * name() const =0
virtual IDocProgramListing * source() const =0
The interface to a file in the object model.
Definition: doxmlintf.h:1038
virtual IMemberReference * current() const =0
virtual SectionKind kind() const =0
virtual CompoundKind kind() const =0
virtual ICompound * compound() const =0
def cli(ctx)
Definition: main.py:7
virtual ICompoundIterator * compounds() const =0
virtual void release()=0
virtual void toFirst()=0
virtual ISectionIterator * sections() const =0
const double e
virtual ILinkedTextIterator * type() const =0
virtual IRelatedCompoundIterator * baseCompounds() const =0
QString linkedTextToString(ILinkedTextIterator *ti)
Definition: main.cpp:24
virtual void release()=0
virtual IMemberReference * toFirst()=0
virtual void release()=0
virtual const IString * name() const =0
virtual IMember * toFirst()=0
void DumpDoc(IDoc *doc, int level)
Definition: main.cpp:49
virtual void setDebugLevel(int level)=0
virtual void release()=0
The interface to a compound in the object model.
Definition: doxmlintf.h:868
virtual void toNext()=0
The interface to a section in the object model.
Definition: doxmlintf.h:747
void DumpGraph(IGraph *graph)
Definition: main.cpp:520
Iterates over a list of ILinkedText fragments.
Definition: doxmlintf.h:97
virtual IMemberIterator * members() const =0
virtual void release()=0
virtual IGraph * inheritanceGraph() const =0
IDoxygen * createObjectModel()
virtual const IString * name() const =0
virtual IRelatedCompoundIterator * derivedCompounds() const =0
A user defined member group.
Definition: doxmlintf.h:754
QCString doc
const char * latin1() const
Definition: qstring.cpp:14457
virtual IRelatedCompound * toFirst()=0
virtual const IString * kindString() const =0
virtual int bodyStart() const =0
virtual IRelatedCompound * current() const =0
virtual IMember * toNext()=0
virtual MemberKind kind() const =0
#define ASSERT(x)
Definition: qglobal.h:590
virtual const IString * kindString() const =0
virtual IMemberReferenceIterator * referencedBy() const =0