47 #define PERLOUTPUT_MAX_INDENTATION 40 59 void add(
const char *
s);
62 void add(
unsigned int n);
112 : m_pretty(pretty), m_stream(0), m_indentation(false), m_blockstart(true)
127 m_blockstart =
false;
146 m_stream->
add(m_spaces);
157 iaddFieldQuotedChar(field, content);
return *
this;
161 iaddFieldQuotedString(field, content);
return *
this;
165 return addFieldQuotedString(field, content ?
"yes" :
"no");
180 void iaddQuoted(
const char *);
181 void iaddFieldQuotedChar(
const char *,
char);
182 void iaddFieldQuotedString(
const char *,
const char *);
183 void iaddField(
const char *);
185 void iopen(
char,
const char *);
200 m_saved.push(m_stream);
208 m_stream = m_saved.pop();
215 char *
s = &m_spaces[m_indentation * 2];
216 *s++ =
' '; *s++ =
' '; *s = 0;
225 m_spaces[m_indentation * 2] = 0;
231 while ((c = *s++) != 0) {
232 if ((c ==
'\'') || (c ==
'\\'))
242 m_stream->add(m_pretty ?
" => " :
"=>");
249 if ((content ==
'\'') || (content ==
'\\'))
251 m_stream->add(content);
282 m_blockstart =
false;
412 void openItem(
const char *);
414 void singleItem(
const char *);
415 void openSubBlock(
const char * = 0);
416 void closeSubBlock();
447 (link +=
"_1") += anchor;
546 const char *accent=0;
625 const char *style = 0;
648 const char *
type = 0;
684 const char *
type = 0;
690 m_t <<
"<div class=\"fragment\"><pre>";
692 FileDef fd( cfi.dirPath(), cfi.fileName() );
694 m_t <<
"</pre></div>";
757 "<secondaryie></secondaryie>" 831 const char *
type = 0;
852 err(
"unknown simple section found\n");
1094 if ((i=baseName.
findRev(
'/'))!=-1 || (i=baseName.
findRev(
'\\'))!=-1)
1099 if (!
img->width().isEmpty())
1105 else if (!
img->height().isEmpty())
1231 const char *
type = 0;
1239 err(
"unknown parameter section found\n");
1261 for (li.toFirst();(param=li.
current());++li)
1266 s = ((
DocWord*)param)->word();
1376 output.
openList(
"template_parameters");
1398 const char *cname = cd ? cd->
name().
data() : 0;
1436 case Public:
return "public";
1438 case Private:
return "private";
1439 case Package:
return "package";
1448 case Normal:
return "non_virtual";
1449 case Virtual:
return "virtual";
1450 case Pure:
return "pure_virtual";
1487 const char *
name,
const char *header=0);
1488 void addListOfAllMembers(
ClassDef *cd);
1489 void generatePerlModForClass(
ClassDef *cd);
1491 void generatePerlModForFile(
FileDef *fd);
1492 void generatePerlModForGroup(
GroupDef *gd);
1493 void generatePerlModForPage(
PageDef *
pi);
1495 bool createOutputFile(
QFile &
f,
const char *
s);
1496 bool createOutputDir(
QDir &perlModDir);
1497 bool generateDoxyLatexTex();
1498 bool generateDoxyFormatTex();
1499 bool generateDoxyStructurePM();
1500 bool generateDoxyLatexPL();
1501 bool generateDoxyLatexStructurePL();
1502 bool generateDoxyRules();
1503 bool generateMakefile();
1504 bool generatePerlModOutput();
1567 if (declAl && declAl->
count()>0)
1596 if (defArg) ++defAli;
1688 generatePerlModForMember(md,d);
1701 for (mnii.toFirst();(mni=mnii.current());++mnii)
1747 if (cd->
name().
find(
'@')!=-1)
return;
1758 for (bcli.toFirst();(bcd=bcli.current());++bcli)
1772 for (bcli.toFirst();(bcd=bcli.current());++bcli)
1787 for (cli.toFirst();(cd=cli.current());++
cli)
1813 addListOfAllMembers(cd);
1818 for (;(mg=mgli.current());++mgli)
1819 generatePerlModSection(cd,mg->members(),
"user_defined",mg->header());
1850 DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance);
1851 if (!inheritanceGraph.isTrivial())
1853 t <<
" <inheritancegraph>" <<
endl;
1854 inheritanceGraph.writePerlMod(
t);
1855 t <<
" </inheritancegraph>" <<
endl;
1857 DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation);
1860 t <<
" <collaborationgraph>" <<
endl;
1861 collaborationGraph.writePerlMod(
t);
1862 t <<
" </collaborationgraph>" <<
endl;
1864 t <<
" <location file=\"" 1900 for (cli.toFirst();(cd=cli.current());++
cli)
1913 for (nli.toFirst();(nd=nli.current());++nli)
1924 for (;(mg=mgli.current());++mgli)
1925 generatePerlModSection(nd,mg->members(),
"user-defined",mg->header());
1967 for (ili1.toFirst();(inc=ili1.current());++ili1)
1984 for (ili2.toFirst();(inc=ili2.current());++ili2)
2028 .addFieldQuotedString(
"title", gd->
groupTitle());
2049 for (cli.toFirst();(cd=cli.current());++
cli)
2062 for (nli.toFirst();(nd=nli.current());++nli)
2075 for (pli.toFirst();(pd=pli.current());++pli)
2099 for (;(mg=mgli.current());++mgli)
2100 generatePerlModSection(gd,mg->members(),
"user-defined",mg->header());
2138 if (!createOutputFile(outputFile, pathDoxyDocsPM))
2149 for (cli.toFirst();(cd=cli.current());++
cli)
2150 generatePerlModForClass(cd);
2156 for (nli.toFirst();(nd=nli.current());++nli)
2157 generatePerlModForNamespace(nd);
2163 for (;(fn=fnli.
current());++fnli)
2167 for (;(fd=fni.
current());++fni)
2168 generatePerlModForFile(fd);
2175 for (;(gd=gli.current());++gli)
2177 generatePerlModForGroup(gd);
2184 for (pdi.toFirst();(pd=pdi.current());++pdi)
2186 generatePerlModForPage(pd);
2203 err(
"Cannot open file %s for writing!\n", s);
2212 if (outputDirectory.
isEmpty())
2222 if (!dir.
mkdir(outputDirectory))
2224 err(
"tag OUTPUT_DIRECTORY: Output directory `%s' does not " 2225 "exist and cannot be created\n",outputDirectory.
data());
2230 msg(
"Notice: Output directory `%s' does not exist. " 2231 "I have created it for you.\n", outputDirectory.
data());
2233 dir.
cd(outputDirectory);
2242 if (!dir.
mkdir(outputDirectory))
2244 err(
"Cannot create directory %s\n",outputDirectory.
data());
2249 perlModDir.
setPath(outputDirectory+
"/perlmod");
2250 if (!perlModDir.
exists() && !perlModDir.
mkdir(outputDirectory+
"/perlmod"))
2252 err(
"Could not create perlmod directory in %s\n",outputDirectory.
data());
2261 if (!createOutputFile(doxyModelPM, pathDoxyStructurePM))
2265 doxyModelPMStream <<
2266 "sub memberlist($) {\n" 2267 " my $prefix = $_[0];\n" 2269 "\t[ \"hash\", $prefix . \"s\",\n" 2272 "\t [ \"list\", $prefix . \"List\",\n" 2273 "\t\t[ \"hash\", $prefix,\n" 2275 "\t\t kind => [ \"string\", $prefix . \"Kind\" ],\n" 2276 "\t\t name => [ \"string\", $prefix . \"Name\" ],\n" 2277 "\t\t static => [ \"string\", $prefix . \"Static\" ],\n" 2278 "\t\t virtualness => [ \"string\", $prefix . \"Virtualness\" ],\n" 2279 "\t\t protection => [ \"string\", $prefix . \"Protection\" ],\n" 2280 "\t\t type => [ \"string\", $prefix . \"Type\" ],\n" 2281 "\t\t parameters =>\n" 2282 "\t\t [ \"list\", $prefix . \"Params\",\n" 2283 "\t\t\t[ \"hash\", $prefix . \"Param\",\n" 2285 "\t\t\t declaration_name => [ \"string\", $prefix . \"ParamName\" ],\n" 2286 "\t\t\t type => [ \"string\", $prefix . \"ParamType\" ],\n" 2290 "\t\t detailed =>\n" 2291 "\t\t [ \"hash\", $prefix . \"Detailed\",\n" 2293 "\t\t\t doc => [ \"doc\", $prefix . \"DetailedDoc\" ],\n" 2294 "\t\t\t return => [ \"doc\", $prefix . \"Return\" ],\n" 2295 "\t\t\t see => [ \"doc\", $prefix . \"See\" ],\n" 2296 "\t\t\t params =>\n" 2297 "\t\t\t [ \"list\", $prefix . \"PDBlocks\",\n" 2298 "\t\t\t [ \"hash\", $prefix . \"PDBlock\",\n" 2300 "\t\t\t\t parameters =>\n" 2301 "\t\t\t\t [ \"list\", $prefix . \"PDParams\",\n" 2302 "\t\t\t\t [ \"hash\", $prefix . \"PDParam\",\n" 2304 "\t\t\t\t\t name => [ \"string\", $prefix . \"PDParamName\" ],\n" 2308 "\t\t\t\t doc => [ \"doc\", $prefix . \"PDDoc\" ],\n" 2321 "$doxystructure =\n" 2322 " [ \"hash\", \"Root\",\n" 2325 "\t [ \"list\", \"Files\",\n" 2326 "\t [ \"hash\", \"File\",\n" 2328 "\t\tname => [ \"string\", \"FileName\" ],\n" 2329 "\t\ttypedefs => memberlist(\"FileTypedef\"),\n" 2330 "\t\tvariables => memberlist(\"FileVariable\"),\n" 2331 "\t\tfunctions => memberlist(\"FileFunction\"),\n" 2333 "\t\t [ \"hash\", \"FileDetailed\",\n" 2335 "\t\t doc => [ \"doc\", \"FileDetailedDoc\" ],\n" 2342 "\t [ \"list\", \"Pages\",\n" 2343 "\t [ \"hash\", \"Page\",\n" 2345 "\t\tname => [ \"string\", \"PageName\" ],\n" 2347 "\t\t [ \"hash\", \"PageDetailed\",\n" 2349 "\t\t doc => [ \"doc\", \"PageDetailedDoc\" ],\n" 2356 "\t [ \"list\", \"Classes\",\n" 2357 "\t [ \"hash\", \"Class\",\n" 2359 "\t\tname => [ \"string\", \"ClassName\" ],\n" 2360 "\t\tpublic_typedefs => memberlist(\"ClassPublicTypedef\"),\n" 2361 "\t\tpublic_methods => memberlist(\"ClassPublicMethod\"),\n" 2362 "\t\tpublic_members => memberlist(\"ClassPublicMember\"),\n" 2363 "\t\tprotected_typedefs => memberlist(\"ClassProtectedTypedef\"),\n" 2364 "\t\tprotected_methods => memberlist(\"ClassProtectedMethod\"),\n" 2365 "\t\tprotected_members => memberlist(\"ClassProtectedMember\"),\n" 2366 "\t\tprivate_typedefs => memberlist(\"ClassPrivateTypedef\"),\n" 2367 "\t\tprivate_methods => memberlist(\"ClassPrivateMethod\"),\n" 2368 "\t\tprivate_members => memberlist(\"ClassPrivateMember\"),\n" 2370 "\t\t [ \"hash\", \"ClassDetailed\",\n" 2372 "\t\t doc => [ \"doc\", \"ClassDetailedDoc\" ],\n" 2379 "\t [ \"list\", \"Groups\",\n" 2380 "\t [ \"hash\", \"Group\",\n" 2382 "\t\tname => [ \"string\", \"GroupName\" ],\n" 2383 "\t\ttitle => [ \"string\", \"GroupTitle\" ],\n" 2385 "\t\t [ \"list\", \"Files\",\n" 2386 "\t\t [ \"hash\", \"File\",\n" 2388 "\t\t name => [ \"string\", \"Filename\" ]\n" 2393 "\t\t [ \"list\", \"Classes\",\n" 2394 "\t\t [ \"hash\", \"Class\",\n" 2396 "\t\t name => [ \"string\", \"Classname\" ]\n" 2400 "\t\tnamespaces =>\n" 2401 "\t\t [ \"list\", \"Namespaces\",\n" 2402 "\t\t [ \"hash\", \"Namespace\",\n" 2404 "\t\t name => [ \"string\", \"NamespaceName\" ]\n" 2409 "\t\t [ \"list\", \"Pages\",\n" 2410 "\t\t [ \"hash\", \"Page\"," 2412 "\t\t title => [ \"string\", \"PageName\" ]\n" 2417 "\t\t [ \"list\", \"Groups\",\n" 2418 "\t\t [ \"hash\", \"Group\",\n" 2420 "\t\t title => [ \"string\", \"GroupName\" ]\n" 2424 "\t\tfunctions => memberlist(\"GroupFunction\"),\n" 2426 "\t\t [ \"hash\", \"GroupDetailed\",\n" 2428 "\t\t doc => [ \"doc\", \"GroupDetailedDoc\" ],\n" 2445 if (!createOutputFile(doxyRules, pathDoxyRules))
2453 prefix <<
"DOXY_EXEC_PATH = " << pathDoxyExec <<
"\n" <<
2454 prefix <<
"DOXYFILE = " << pathDoxyfile <<
"\n" <<
2455 prefix <<
"DOXYDOCS_PM = " << pathDoxyDocsPM <<
"\n" <<
2456 prefix <<
"DOXYSTRUCTURE_PM = " << pathDoxyStructurePM <<
"\n" <<
2457 prefix <<
"DOXYRULES = " << pathDoxyRules <<
"\n";
2460 prefix <<
"DOXYLATEX_PL = " << pathDoxyLatexPL <<
"\n" <<
2461 prefix <<
"DOXYLATEXSTRUCTURE_PL = " << pathDoxyLatexStructurePL <<
"\n" <<
2462 prefix <<
"DOXYSTRUCTURE_TEX = " << pathDoxyStructureTex <<
"\n" <<
2463 prefix <<
"DOXYDOCS_TEX = " << pathDoxyDocsTex <<
"\n" <<
2464 prefix <<
"DOXYFORMAT_TEX = " << pathDoxyFormatTex <<
"\n" <<
2465 prefix <<
"DOXYLATEX_TEX = " << pathDoxyLatexTex <<
"\n" <<
2466 prefix <<
"DOXYLATEX_DVI = " << pathDoxyLatexDVI <<
"\n" <<
2467 prefix <<
"DOXYLATEX_PDF = " << pathDoxyLatexPDF <<
"\n";
2471 ".PHONY: clean-perlmod\n" 2473 "\trm -f $(" << prefix <<
"DOXYSTRUCTURE_PM) \\\n" 2474 "\t$(" << prefix <<
"DOXYDOCS_PM)";
2478 "\t$(" << prefix <<
"DOXYLATEX_PL) \\\n" 2479 "\t$(" << prefix <<
"DOXYLATEXSTRUCTURE_PL) \\\n" 2480 "\t$(" << prefix <<
"DOXYDOCS_TEX) \\\n" 2481 "\t$(" << prefix <<
"DOXYSTRUCTURE_TEX) \\\n" 2482 "\t$(" << prefix <<
"DOXYFORMAT_TEX) \\\n" 2483 "\t$(" << prefix <<
"DOXYLATEX_TEX) \\\n" 2484 "\t$(" << prefix <<
"DOXYLATEX_PDF) \\\n" 2485 "\t$(" << prefix <<
"DOXYLATEX_DVI) \\\n" 2486 "\t$(addprefix $(" << prefix <<
"DOXYLATEX_TEX:tex=),out aux log)";
2487 doxyRulesStream <<
"\n\n";
2490 "$(" << prefix <<
"DOXYRULES) \\\n" 2491 "$(" << prefix <<
"DOXYMAKEFILE) \\\n" 2492 "$(" << prefix <<
"DOXYSTRUCTURE_PM) \\\n" 2493 "$(" << prefix <<
"DOXYDOCS_PM)";
2497 "$(" << prefix <<
"DOXYLATEX_PL) \\\n" 2498 "$(" << prefix <<
"DOXYLATEXSTRUCTURE_PL) \\\n" 2499 "$(" << prefix <<
"DOXYFORMAT_TEX) \\\n" 2500 "$(" << prefix <<
"DOXYLATEX_TEX)";
2504 "\t$(" << prefix <<
"DOXYFILE)\n" 2505 "\tcd $(" << prefix <<
"DOXY_EXEC_PATH) ; doxygen \"$<\"\n";
2510 "$(" << prefix <<
"DOXYDOCS_TEX): \\\n" 2511 "$(" << prefix <<
"DOXYLATEX_PL) \\\n" 2512 "$(" << prefix <<
"DOXYDOCS_PM)\n" 2513 "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" 2515 "$(" << prefix <<
"DOXYSTRUCTURE_TEX): \\\n" 2516 "$(" << prefix <<
"DOXYLATEXSTRUCTURE_PL) \\\n" 2517 "$(" << prefix <<
"DOXYSTRUCTURE_PM)\n" 2518 "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" 2520 "$(" << prefix <<
"DOXYLATEX_PDF) \\\n" 2521 "$(" << prefix <<
"DOXYLATEX_DVI): \\\n" 2522 "$(" << prefix <<
"DOXYLATEX_TEX) \\\n" 2523 "$(" << prefix <<
"DOXYFORMAT_TEX) \\\n" 2524 "$(" << prefix <<
"DOXYSTRUCTURE_TEX) \\\n" 2525 "$(" << prefix <<
"DOXYDOCS_TEX)\n" 2527 "$(" << prefix <<
"DOXYLATEX_PDF): \\\n" 2528 "$(" << prefix <<
"DOXYLATEX_TEX)\n" 2529 "\tpdflatex -interaction=nonstopmode \"$<\"\n" 2531 "$(" << prefix <<
"DOXYLATEX_DVI): \\\n" 2532 "$(" << prefix <<
"DOXYLATEX_TEX)\n" 2533 "\tlatex -interaction=nonstopmode \"$<\"\n";
2542 if (!createOutputFile(makefile, pathMakefile))
2550 ".PHONY: default clean" << (perlmodLatex ?
" pdf" :
"") <<
"\n" 2551 "default: " << (perlmodLatex ?
"pdf" :
"clean") <<
"\n" 2553 "include " << pathDoxyRules <<
"\n" 2555 "clean: clean-perlmod\n";
2559 "pdf: $(" << prefix <<
"DOXYLATEX_PDF)\n" 2560 "dvi: $(" << prefix <<
"DOXYLATEX_DVI)\n";
2568 QFile doxyLatexStructurePL;
2569 if (!createOutputFile(doxyLatexStructurePL, pathDoxyLatexStructurePL))
2572 FTextStream doxyLatexStructurePLStream(&doxyLatexStructurePL);
2573 doxyLatexStructurePLStream <<
2574 "use DoxyStructure;\n" 2576 "sub process($) {\n" 2577 "\tmy $node = $_[0];\n" 2578 "\tmy ($type, $name) = @$node[0, 1];\n" 2580 "\tif ($type eq \"string\") { $command = \"String\" }\n" 2581 "\telsif ($type eq \"doc\") { $command = \"Doc\" }\n" 2582 "\telsif ($type eq \"hash\") {\n" 2583 "\t\t$command = \"Hash\";\n" 2584 "\t\tfor my $subnode (values %{$$node[2]}) {\n" 2585 "\t\t\tprocess($subnode);\n" 2588 "\telsif ($type eq \"list\") {\n" 2589 "\t\t$command = \"List\";\n" 2590 "\t\tprocess($$node[2]);\n" 2592 "\tprint \"\\\\\" . $command . \"Node{\" . $name . \"}%\\n\";\n" 2595 "process($doxystructure);\n";
2603 if (!createOutputFile(doxyLatexPL, pathDoxyLatexPL))
2607 doxyLatexPLStream <<
2608 "use DoxyStructure;\n" 2611 "sub latex_quote($) {\n" 2612 "\tmy $text = $_[0];\n" 2613 "\t$text =~ s/\\\\/\\\\textbackslash /g;\n" 2614 "\t$text =~ s/\\|/\\\\textbar /g;\n" 2615 "\t$text =~ s/</\\\\textless /g;\n" 2616 "\t$text =~ s/>/\\\\textgreater /g;\n" 2617 "\t$text =~ s/~/\\\\textasciitilde /g;\n" 2618 "\t$text =~ s/\\^/\\\\textasciicircum /g;\n" 2619 "\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n" 2623 "sub generate_doc($) {\n" 2624 "\tmy $doc = $_[0];\n" 2625 "\tfor my $item (@$doc) {\n" 2626 "\t\tmy $type = $$item{type};\n" 2627 "\t\tif ($type eq \"text\") {\n" 2628 "\t\t\tlatex_quote($$item{content});\n" 2629 "\t\t} elsif ($type eq \"parbreak\") {\n" 2630 "\t\t\tprint \"\\n\\n\";\n" 2631 "\t\t} elsif ($type eq \"style\") {\n" 2632 "\t\t\tmy $style = $$item{style};\n" 2633 "\t\t\tif ($$item{enable} eq \"yes\") {\n" 2634 "\t\t\t\tif ($style eq \"bold\") { print '\\bfseries'; }\n" 2635 "\t\t\t\tif ($style eq \"italic\") { print '\\itshape'; }\n" 2636 "\t\t\t\tif ($style eq \"code\") { print '\\ttfamily'; }\n" 2638 "\t\t\t\tif ($style eq \"bold\") { print '\\mdseries'; }\n" 2639 "\t\t\t\tif ($style eq \"italic\") { print '\\upshape'; }\n" 2640 "\t\t\t\tif ($style eq \"code\") { print '\\rmfamily'; }\n" 2642 "\t\t\tprint '{}';\n" 2643 "\t\t} elsif ($type eq \"symbol\") {\n" 2644 "\t\t\tmy $symbol = $$item{symbol};\n" 2645 "\t\t\tif ($symbol eq \"copyright\") { print '\\copyright'; }\n" 2646 "\t\t\telsif ($symbol eq \"szlig\") { print '\\ss'; }\n" 2647 "\t\t\tprint '{}';\n" 2648 "\t\t} elsif ($type eq \"accent\") {\n" 2649 "\t\t\tmy ($accent) = $$item{accent};\n" 2650 "\t\t\tif ($accent eq \"umlaut\") { print '\\\"'; }\n" 2651 "\t\t\telsif ($accent eq \"acute\") { print '\\\\\\''; }\n" 2652 "\t\t\telsif ($accent eq \"grave\") { print '\\`'; }\n" 2653 "\t\t\telsif ($accent eq \"circ\") { print '\\^'; }\n" 2654 "\t\t\telsif ($accent eq \"tilde\") { print '\\~'; }\n" 2655 "\t\t\telsif ($accent eq \"cedilla\") { print '\\c'; }\n" 2656 "\t\t\telsif ($accent eq \"ring\") { print '\\r'; }\n" 2657 "\t\t\tprint \"{\" . $$item{letter} . \"}\"; \n" 2658 "\t\t} elsif ($type eq \"list\") {\n" 2659 "\t\t\tmy $env = ($$item{style} eq \"ordered\") ? \"enumerate\" : \"itemize\";\n" 2660 "\t\t\tprint \"\\n\\\\begin{\" . $env .\"}\";\n" 2661 "\t\t \tfor my $subitem (@{$$item{content}}) {\n" 2662 "\t\t\t\tprint \"\\n\\\\item \";\n" 2663 "\t\t\t\tgenerate_doc($subitem);\n" 2665 "\t\t\tprint \"\\n\\\\end{\" . $env .\"}\";\n" 2666 "\t\t} elsif ($type eq \"url\") {\n" 2667 "\t\t\tlatex_quote($$item{content});\n" 2672 "sub generate($$) {\n" 2673 "\tmy ($item, $node) = @_;\n" 2674 "\tmy ($type, $name) = @$node[0, 1];\n" 2675 "\tif ($type eq \"string\") {\n" 2676 "\t\tprint \"\\\\\" . $name . \"{\";\n" 2677 "\t\tlatex_quote($item);\n" 2678 "\t\tprint \"}\";\n" 2679 "\t} elsif ($type eq \"doc\") {\n" 2680 "\t\tif (@$item) {\n" 2681 "\t\t\tprint \"\\\\\" . $name . \"{\";\n" 2682 "\t\t\tgenerate_doc($item);\n" 2683 "\t\t\tprint \"}%\\n\";\n" 2685 "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" 2687 "\t} elsif ($type eq \"hash\") {\n" 2688 "\t\tmy ($key, $value);\n" 2689 "\t\twhile (($key, $subnode) = each %{$$node[2]}) {\n" 2690 "\t\t\tmy $subname = $$subnode[1];\n" 2691 "\t\t\tprint \"\\\\Defcs{field\" . $subname . \"}{\";\n" 2692 "\t\t\tif ($$item{$key}) {\n" 2693 "\t\t\t\tgenerate($$item{$key}, $subnode);\n" 2695 "#\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n" 2697 "\t\t\tprint \"}%\\n\";\n" 2699 "\t\tprint \"\\\\\" . $name . \"%\\n\";\n" 2700 "\t} elsif ($type eq \"list\") {\n" 2701 "\t\tmy $index = 0;\n" 2702 "\t\tif (@$item) {\n" 2703 "\t\t\tprint \"\\\\\" . $name . \"{%\\n\";\n" 2704 "\t\t\tfor my $subitem (@$item) {\n" 2705 "\t\t\t\tif ($index) {\n" 2706 "\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n" 2708 "\t\t\t\tgenerate($subitem, $$node[2]);\n" 2709 "\t\t\t\t$index++;\n" 2711 "\t\t\tprint \"}%\\n\";\n" 2713 "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" 2718 "generate($doxydocs, $doxystructure);\n";
2725 QFile doxyFormatTex;
2726 if (!createOutputFile(doxyFormatTex, pathDoxyFormatTex))
2730 doxyFormatTexStream <<
2731 "\\def\\Defcs#1{\\long\\expandafter\\def\\csname#1\\endcsname}\n" 2732 "\\Defcs{Empty}{}\n" 2733 "\\def\\IfEmpty#1{\\expandafter\\ifx\\csname#1\\endcsname\\Empty}\n" 2735 "\\def\\StringNode#1{\\Defcs{#1}##1{##1}}\n" 2736 "\\def\\DocNode#1{\\Defcs{#1}##1{##1}}\n" 2737 "\\def\\ListNode#1{\\Defcs{#1}##1{##1}\\Defcs{#1Sep}{}}\n" 2738 "\\def\\HashNode#1{\\Defcs{#1}{}}\n" 2740 "\\input{" << pathDoxyStructureTex <<
"}\n" 2743 "\\dimendef\\DimenA=151\\relax\n" 2744 "\\dimendef\\DimenB=152\\relax\n" 2745 "\\countdef\\ZoneDepth=151\\relax\n" 2747 "\\def\\Cs#1{\\csname#1\\endcsname}\n" 2748 "\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}\n" 2749 "\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}\n" 2750 "\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}\n" 2752 "\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax\n" 2753 "\\raggedright#1\\vskip 0.5mm\\relax} }}\n" 2755 "\\def\\Zone#1#2#3{%\n" 2756 "\\Defcs{Test#1}{#2}%\n" 2757 "\\Defcs{Emit#1}{#3}%\n" 2759 "\\advance\\ZoneDepth1\\relax\n" 2760 "\\Letcs{Mode\\number\\ZoneDepth}0\\relax\n" 2761 "\\Letcs{Present\\number\\ZoneDepth}0\\relax\n" 2763 "\\expandafter\\if\\Cs{Present\\number\\ZoneDepth}1%\n" 2764 "\\advance\\ZoneDepth-1\\relax\n" 2765 "\\Letcs{Present\\number\\ZoneDepth}1\\relax\n" 2766 "\\expandafter\\if\\Cs{Mode\\number\\ZoneDepth}1%\n" 2767 "\\advance\\ZoneDepth1\\relax\n" 2768 "\\Letcs{Mode\\number\\ZoneDepth}1\\relax\n" 2770 "\\advance\\ZoneDepth-1\\relax\\fi\n" 2771 "\\advance\\ZoneDepth1\\relax\\fi\n" 2772 "\\advance\\ZoneDepth-1\\relax}}\n" 2774 "\\def\\Member#1#2{%\n" 2775 "\\Defcs{Test#1}{\\Cs{field#1Detailed}\n" 2776 "\\IfEmpty{field#1DetailedDoc}\\else\\Letcs{Present#1}1\\fi}\n" 2777 "\\Defcs{#1}{\\Letcs{Present#1}0\\relax\n" 2778 "\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1\\relax\n" 2779 "\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}\n" 2781 "\\def\\TypedefMemberList#1#2{%\n" 2782 "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n" 2783 "\\Defcs{#1Name}##1{\\textbf{##1}}%\n" 2784 "\\Defcs{#1See}##1{\\See{##1}}%\n" 2786 "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" 2787 "\\Member{#1}{\\Frame{typedef \\Cs{field#1Type} \\Cs{field#1Name}}%\n" 2788 "\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n" 2790 "\\def\\VariableMemberList#1#2{%\n" 2791 "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n" 2792 "\\Defcs{#1Name}##1{\\textbf{##1}}%\n" 2793 "\\Defcs{#1See}##1{\\See{##1}}%\n" 2795 "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" 2796 "\\Member{#1}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}}%\n" 2797 "\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n" 2799 "\\def\\FunctionMemberList#1#2{%\n" 2800 "\\Defcs{#1PDParamName}##1{\\textit{##1}}%\n" 2801 "\\Defcs{#1PDParam}{\\Cs{field#1PDParamName}}%\n" 2802 "\\Defcs{#1PDParamsSep}{, }%\n" 2803 "\\Defcs{#1PDBlocksSep}{\\vskip 2mm\\relax}%\n" 2805 "\\Defcs{#1PDBlocks}##1{%\n" 2806 "\\Heading{Parameters:}\\vskip 1.5mm\\relax\n" 2807 "\\DimenA0pt\\relax\n" 2808 "\\Defcs{#1PDBlock}{\\setbox\\BoxA\\hbox{\\Cs{field#1PDParams}}%\n" 2809 "\\ifdim\\DimenA<\\wd\\BoxA\\DimenA\\wd\\BoxA\\fi}%\n" 2811 "\\advance\\DimenA3mm\\relax\n" 2812 "\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax\n" 2813 "\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax\n" 2814 "\\Cs{field#1PDParams}}\\hfill\n" 2815 "\\vtop{\\hsize\\DimenB\\relax\\Cs{field#1PDDoc}}}}%\n" 2818 "\\Defcs{#1ParamName}##1{\\textit{##1}}\n" 2819 "\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}\n" 2820 "\\Defcs{#1ParamsSep}{, }\n" 2822 "\\Defcs{#1Name}##1{\\textbf{##1}}\n" 2823 "\\Defcs{#1See}##1{\\See{##1}}\n" 2824 "\\Defcs{#1Return}##1{\\Heading{Returns: }##1}\n" 2825 "\\Defcs{field#1Title}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}(\\Cs{field#1Params})}}%\n" 2827 "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" 2829 "\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}\n" 2830 "\\Cs{field#1Return}\\Cs{field#1PDBlocks}\\Cs{field#1See}\\vskip 5mm\\relax}}\n" 2832 "\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}\n" 2833 "\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}\n" 2835 "\\def\\FileSubzones{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}\n" 2837 "\\def\\ClassSubzones{%\n" 2838 "\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods\n" 2839 "\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods\n" 2840 "\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}\n" 2842 "\\Member{Page}{\\subsection{\\fieldPageName}\\fieldPageDetailedDoc}\n" 2844 "\\TypedefMemberList{FileTypedef}{Typedefs}\n" 2845 "\\VariableMemberList{FileVariable}{Variables}\n" 2846 "\\FunctionMemberList{FileFunction}{Functions}\n" 2847 "\\Zone{File}{\\FileSubzones}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\FileSubzones}\n" 2849 "\\TypedefMemberList{ClassPublicTypedef}{Public Typedefs}\n" 2850 "\\TypedefMemberList{ClassProtectedTypedef}{Protected Typedefs}\n" 2851 "\\TypedefMemberList{ClassPrivateTypedef}{Private Typedefs}\n" 2852 "\\VariableMemberList{ClassPublicMember}{Public Members}\n" 2853 "\\VariableMemberList{ClassProtectedMember}{Protected Members}\n" 2854 "\\VariableMemberList{ClassPrivateMember}{Private Members}\n" 2855 "\\FunctionMemberList{ClassPublicMethod}{Public Methods}\n" 2856 "\\FunctionMemberList{ClassProtectedMethod}{Protected Methods}\n" 2857 "\\FunctionMemberList{ClassPrivateMethod}{Private Methods}\n" 2858 "\\Zone{Class}{\\ClassSubzones}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\ClassSubzones}\n" 2860 "\\Zone{AllPages}{\\fieldPages}{\\section{Pages}\\fieldPages}\n" 2861 "\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}\n" 2862 "\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}\n" 2864 "\\newlength{\\oldparskip}\n" 2865 "\\newlength{\\oldparindent}\n" 2866 "\\newlength{\\oldfboxrule}\n" 2868 "\\ZoneDepth0\\relax\n" 2869 "\\Letcs{Mode0}1\\relax\n" 2871 "\\def\\EmitDoxyDocs{%\n" 2872 "\\setlength{\\oldparskip}{\\parskip}\n" 2873 "\\setlength{\\oldparindent}{\\parindent}\n" 2874 "\\setlength{\\oldfboxrule}{\\fboxrule}\n" 2875 "\\setlength{\\parskip}{0cm}\n" 2876 "\\setlength{\\parindent}{0cm}\n" 2877 "\\setlength{\\fboxrule}{1pt}\n" 2878 "\\AllPages\\AllFiles\\AllClasses\n" 2879 "\\setlength{\\parskip}{\\oldparskip}\n" 2880 "\\setlength{\\parindent}{\\oldparindent}\n" 2881 "\\setlength{\\fboxrule}{\\oldfboxrule}}\n";
2889 if (!createOutputFile(doxyLatexTex, pathDoxyLatexTex))
2893 doxyLatexTexStream <<
2894 "\\documentclass[a4paper,12pt]{article}\n" 2895 "\\usepackage[latin1]{inputenc}\n" 2896 "\\usepackage[none]{hyphenat}\n" 2897 "\\usepackage[T1]{fontenc}\n" 2898 "\\usepackage{hyperref}\n" 2899 "\\usepackage{times}\n" 2901 "\\input{doxyformat}\n" 2903 "\\begin{document}\n" 2904 "\\input{" << pathDoxyDocsTex <<
"}\n" 2907 "\\end{document}\n";
2923 if (!createOutputDir(perlModDir))
2929 pathDoxyDocsPM = perlModAbsPath +
"/DoxyDocs.pm";
2930 pathDoxyStructurePM = perlModAbsPath +
"/DoxyStructure.pm";
2931 pathMakefile = perlModAbsPath +
"/Makefile";
2932 pathDoxyRules = perlModAbsPath +
"/doxyrules.make";
2935 pathDoxyStructureTex = perlModAbsPath +
"/doxystructure.tex";
2936 pathDoxyFormatTex = perlModAbsPath +
"/doxyformat.tex";
2937 pathDoxyLatexTex = perlModAbsPath +
"/doxylatex.tex";
2938 pathDoxyLatexDVI = perlModAbsPath +
"/doxylatex.dvi";
2939 pathDoxyLatexPDF = perlModAbsPath +
"/doxylatex.pdf";
2940 pathDoxyDocsTex = perlModAbsPath +
"/doxydocs.tex";
2941 pathDoxyLatexPL = perlModAbsPath +
"/doxylatex.pl";
2942 pathDoxyLatexStructurePL = perlModAbsPath +
"/doxylatex-structure.pl";
2945 if (!(generatePerlModOutput()
2946 && generateDoxyStructurePM()
2947 && generateMakefile()
2948 && generateDoxyRules()))
2952 if (!(generateDoxyLatexStructurePL()
2953 && generateDoxyLatexPL()
2954 && generateDoxyLatexTex()
2955 && generateDoxyFormatTex()))
Traverses directory structures and contents in a platform-independent way.
void iaddFieldQuotedString(const char *, const char *)
static GroupSDict * groupSDict
#define PERLOUTPUT_MAX_INDENTATION
void openItem(const char *)
PerlModOutput & addFieldBoolean(const char *field, bool content)
QCString pathDoxyLatexStructurePL
MemberGroupSDict * getMemberGroupSDict() const
This class represents an function or template argument list.
PerlModOutput & open(char c, const char *s=0)
QCString stripWhiteSpace() const
void addLink(const QCString &ref, const QCString &file, const QCString &anchor)
MemberDef * reimplements() const
void iaddQuoted(const char *)
BaseClassList * subClasses() const
IncludeInfo * includeInfo() const
MemberList * reimplementedBy() const
QCString pathDoxyStructurePM
PerlModGenerator(bool pretty)
void msg(const char *fmt,...)
PerlModOutput & openHash(const char *s=0)
static TemplateVariant parseCode(MemberDef *md, const QCString &scopeName, const QCString &relPath, const QCString &code, int startLine=-1, int endLine=-1, bool showLineNumbers=FALSE)
void generatePerlModForClass(ClassDef *cd)
virtual void setPath(const QString &path)
Protection protection() const
ArgumentList * templateArguments() const
void addListOfAllMembers(ClassDef *cd)
MemberNameInfoSDict * memberNameInfoSDict() const
static QCString pathDoxyfile
int open(const char *, int)
Opens a file descriptor.
static FileNameList * inputNameList
PerlModOutput & openList(const char *s=0)
QCString pathDoxyStructureTex
MemberList * enumFieldList() const
static QCString pathDoxyExec
PerlModOutput & closeSave(QCString &s)
DocRoot * validatingParseDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const char *input, bool indexWords, bool isExample, const char *exampleName, bool singleLine, bool linkFromIndex)
bool generateDoxyLatexPL()
PerlModOutput(bool pretty)
PerlModOutput & closeHash()
bool generateDoxyFormatTex()
static HtmlEntityMapper * instance()
virtual bool isReference() const
Simplified and optimized version of QTextStream.
int find(char c, int index=0, bool cs=TRUE) const
void generatePerlModForFile(FileDef *fd)
void setName(const QString &name)
const char * groupTitle() const
PerlModOutput & close(char c=0)
static constexpr double mg
virtual QString absPath() const
int findRev(char c, int index=-1, bool cs=TRUE) const
ClassSDict * getClasses() const
const int DocVisitor_Other
void icloseSave(QCString &)
const DocSymbol::PerlSymb * perl(DocSymbol::SymType symb) const
Access routine to the perl struct with the perl code of the HTML entity.
ArgumentList * declArgumentList() const
ClassSDict * getClassSDict()
QStack< PerlModOutputStream > m_saved
void generatePerlModForPage(PageDef *pi)
GroupList * getSubGroups() const
QCString pathDoxyLatexPDF
QCString getDefFileName() const
PerlModOutput & closeList()
Abstract visitor that participates in the visitor pattern.
bool generateDoxyStructurePM()
static NamespaceSDict * namespaceSDict
QCString ambiguityResolutionScope
QCString targetTitle() const
ClassDef * templateMaster() const
Specifier virtualness(int count=0) const
This class contains the information about the argument of a function or template. ...
const char * typeString() const
virtual bool mkdir(const QString &dirName, bool acceptAbsPath=TRUE) const
int close(int)
Closes the file descriptor fd.
const QCString & name() const
PageSDict * getPages() const
bool createOutputFile(QFile &f, const char *s)
void generatePerlModForMember(MemberDef *md, Definition *)
QCString briefDescription(bool abbr=FALSE) const
PerlModOutputStream * m_stream
void singleItem(const char *)
QCString right(uint len) const
QList< IncludeInfo > * includeFileList() const
static QString currentDirPath()
PerlModOutput & addFieldQuotedString(const char *field, const char *content)
NamespaceSDict * getNamespaces() const
PerlModOutput & addQuoted(const char *s)
Concrete visitor implementation for PerlMod output.
static SectionDict * sectionDict
A bunch of utility functions.
static PageSDict * pageSDict
bool createOutputDir(QDir &perlModDir)
const char * data() const
#define Config_getString(val)
bool generateDoxyLatexTex()
#define Config_getBool(val)
ClassDef * getClassDef() const
virtual ~PerlModDocVisitor()
PerlModOutput & add(int n)
void setPerlModOutputStream(PerlModOutputStream *os)
MemberList * getMemberList(MemberListType lt) const
void err(const char *fmt,...)
MemberList * getMemberList(MemberListType lt) const
static void addTemplateArgumentList(ArgumentList *al, PerlModOutput &output, const char *)
MemberType memberType() const
virtual bool cd(const QString &dirName, bool acceptAbsPath=TRUE)
virtual QCString briefDescription(bool abbreviate=FALSE) const
void visitPost(DocAutoList *)
QCString getOutputFileBase() const
The QFile class is an I/O device that operates on files.
PerlModDocVisitor(PerlModOutput &)
NamespaceSDict * getNamespaceSDict() const
QCString & sprintf(const char *format,...)
PerlModOutput & add(unsigned int n)
QCString pathDoxyLatexTex
PerlModOutput & openSave()
MemberGroupSDict * getMemberGroupSDict() const
PerlModOutput & continueBlock()
PerlModOutput & add(QCString &s)
virtual Definition * getOuterScope() const
QCString documentation() const
bool generatePerlModOutput()
int getEndBodyLine() const
GroupDef * getGroupDef() const
const QList< DocNode > & parameters()
MemberList * getMemberList(MemberListType lt) const
ArgumentList * argumentList() const
PerlModOutput & addFieldQuotedChar(const char *field, char content)
PerlModOutput & addField(const char *s)
int getStartBodyLine() const
QList< IncludeInfo > * includedByFileList() const
const QCString & initializer() const
const char * excpString() const
A model of a page symbol.
void iaddField(const char *)
static const char * getProtectionName(Protection prot)
FileList * getFiles() const
QCString pathDoxyFormatTex
MemberGroupSDict * getMemberGroupSDict() const
QCString pathDoxyLatexDVI
QCString exampleFile() const
PerlModOutput & add(char c)
void generatePerlModForNamespace(NamespaceDef *nd)
static void addPerlModDocBlock(PerlModOutput &output, const char *name, const QCString &fileName, int lineNr, Definition *scope, MemberDef *md, const QCString &text)
void generatePerlModSection(Definition *d, MemberList *ml, const char *name, const char *header=0)
static void addTemplateList(ClassDef *cd, PerlModOutput &output)
ClassSDict * getClassSDict() const
const char * argsString() const
The QFileInfo class provides system-independent file information.
void visitPre(DocAutoList *)
void openSubBlock(const char *=0)
T * find(const char *key)
virtual QCString documentation() const
static ClassSDict * classSDict
PerlModOutput & add(const char *s)
static PageDef * mainPage
std::string nl(std::size_t i=1)
const QCString & docName() const
virtual void accept(DocVisitor *v)=0
MemberList * getMemberList(MemberListType lt)
virtual bool exists() const
bool generateDoxyLatexStructurePL()
void iopen(char, const char *)
void iaddFieldQuotedChar(const char *, char)
void setPerlModDoxyfile(const QCString &qs)
QTextStream & endl(QTextStream &s)
BaseClassList * baseClasses() const
void generatePerlModForGroup(GroupDef *gd)
ArgumentList * templateArguments() const
PerlModOutputStream(FTextStream *t=0)
QCString filterTitle(const QCString &title)
static const char * getVirtualnessName(Specifier virt)