My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
PerlModGenerator Class Reference

Public Member Functions

 PerlModGenerator (bool pretty)
 
void generatePerlModForMember (MemberDef *md, Definition *)
 
void generatePerlModSection (Definition *d, MemberList *ml, const char *name, const char *header=0)
 
void addListOfAllMembers (ClassDef *cd)
 
void generatePerlModForClass (ClassDef *cd)
 
void generatePerlModForNamespace (NamespaceDef *nd)
 
void generatePerlModForFile (FileDef *fd)
 
void generatePerlModForGroup (GroupDef *gd)
 
void generatePerlModForPage (PageDef *pi)
 
bool createOutputFile (QFile &f, const char *s)
 
bool createOutputDir (QDir &perlModDir)
 
bool generateDoxyLatexTex ()
 
bool generateDoxyFormatTex ()
 
bool generateDoxyStructurePM ()
 
bool generateDoxyLatexPL ()
 
bool generateDoxyLatexStructurePL ()
 
bool generateDoxyRules ()
 
bool generateMakefile ()
 
bool generatePerlModOutput ()
 
void generate ()
 

Public Attributes

PerlModOutput m_output
 
QCString pathDoxyStructurePM
 
QCString pathDoxyDocsTex
 
QCString pathDoxyFormatTex
 
QCString pathDoxyLatexTex
 
QCString pathDoxyLatexDVI
 
QCString pathDoxyLatexPDF
 
QCString pathDoxyStructureTex
 
QCString pathDoxyDocsPM
 
QCString pathDoxyLatexPL
 
QCString pathDoxyLatexStructurePL
 
QCString pathDoxyRules
 
QCString pathMakefile
 

Detailed Description

Definition at line 1504 of file perlmodgen.cpp.

Constructor & Destructor Documentation

PerlModGenerator::PerlModGenerator ( bool  pretty)
inline

Definition at line 1523 of file perlmodgen.cpp.

: m_output(pretty) { }

Member Function Documentation

void PerlModGenerator::addListOfAllMembers ( ClassDef cd)
bool PerlModGenerator::createOutputDir ( QDir &  perlModDir)

Definition at line 2249 of file perlmodgen.cpp.

References Config_getString, err(), and msg().

Referenced by generate().

{
QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY);
if (outputDirectory.isEmpty())
{
outputDirectory=QDir::currentDirPath().utf8();
}
else
{
QDir dir(outputDirectory);
if (!dir.exists())
{
dir.setPath(QDir::currentDirPath());
if (!dir.mkdir(outputDirectory))
{
err("tag OUTPUT_DIRECTORY: Output directory `%s' does not "
"exist and cannot be created\n",outputDirectory.data());
exit(1);
}
else
{
msg("Notice: Output directory `%s' does not exist. "
"I have created it for you.\n", outputDirectory.data());
}
dir.cd(outputDirectory);
}
outputDirectory=dir.absPath().utf8();
}
QDir dir(outputDirectory);
if (!dir.exists())
{
dir.setPath(QDir::currentDirPath());
if (!dir.mkdir(outputDirectory))
{
err("Cannot create directory %s\n",outputDirectory.data());
return false;
}
}
perlModDir.setPath(outputDirectory+"/perlmod");
if (!perlModDir.exists() && !perlModDir.mkdir(outputDirectory+"/perlmod"))
{
err("Could not create perlmod directory in %s\n",outputDirectory.data());
return false;
}
return true;
}
bool PerlModGenerator::createOutputFile ( QFile &  f,
const char *  s 
)

Definition at line 2238 of file perlmodgen.cpp.

References err().

Referenced by generateDoxyFormatTex(), generateDoxyLatexPL(), generateDoxyLatexStructurePL(), generateDoxyLatexTex(), generateDoxyRules(), generateDoxyStructurePM(), generateMakefile(), and generatePerlModOutput().

{
f.setName(s);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n", s);
return false;
}
return true;
}
void PerlModGenerator::generate ( )

Definition at line 2952 of file perlmodgen.cpp.

References Config_getBool, createOutputDir(), generateDoxyFormatTex(), generateDoxyLatexPL(), generateDoxyLatexStructurePL(), generateDoxyLatexTex(), generateDoxyRules(), generateDoxyStructurePM(), generateMakefile(), generatePerlModOutput(), pathDoxyDocsPM, pathDoxyDocsTex, pathDoxyFormatTex, pathDoxyLatexDVI, pathDoxyLatexPDF, pathDoxyLatexPL, pathDoxyLatexStructurePL, pathDoxyLatexTex, pathDoxyRules, pathDoxyStructurePM, pathDoxyStructureTex, and pathMakefile.

Referenced by generatePerlMod().

{
// + classes
// + namespaces
// + files
// - packages
// + groups
// + related pages
// - examples
QDir perlModDir;
if (!createOutputDir(perlModDir))
return;
bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
QCString perlModAbsPath = perlModDir.absPath().utf8();
pathDoxyDocsPM = perlModAbsPath + "/DoxyDocs.pm";
pathDoxyStructurePM = perlModAbsPath + "/DoxyStructure.pm";
pathMakefile = perlModAbsPath + "/Makefile";
pathDoxyRules = perlModAbsPath + "/doxyrules.make";
if (perlmodLatex) {
pathDoxyStructureTex = perlModAbsPath + "/doxystructure.tex";
pathDoxyFormatTex = perlModAbsPath + "/doxyformat.tex";
pathDoxyLatexTex = perlModAbsPath + "/doxylatex.tex";
pathDoxyLatexDVI = perlModAbsPath + "/doxylatex.dvi";
pathDoxyLatexPDF = perlModAbsPath + "/doxylatex.pdf";
pathDoxyDocsTex = perlModAbsPath + "/doxydocs.tex";
pathDoxyLatexPL = perlModAbsPath + "/doxylatex.pl";
pathDoxyLatexStructurePL = perlModAbsPath + "/doxylatex-structure.pl";
}
return;
if (perlmodLatex) {
return;
}
}
bool PerlModGenerator::generateDoxyFormatTex ( )

Definition at line 2763 of file perlmodgen.cpp.

References createOutputFile(), pathDoxyFormatTex, and pathDoxyStructureTex.

Referenced by generate().

{
QFile doxyFormatTex;
if (!createOutputFile(doxyFormatTex, pathDoxyFormatTex))
return false;
FTextStream doxyFormatTexStream(&doxyFormatTex);
doxyFormatTexStream <<
"\\def\\Defcs#1{\\long\\expandafter\\def\\csname#1\\endcsname}\n"
"\\Defcs{Empty}{}\n"
"\\def\\IfEmpty#1{\\expandafter\\ifx\\csname#1\\endcsname\\Empty}\n"
"\n"
"\\def\\StringNode#1{\\Defcs{#1}##1{##1}}\n"
"\\def\\DocNode#1{\\Defcs{#1}##1{##1}}\n"
"\\def\\ListNode#1{\\Defcs{#1}##1{##1}\\Defcs{#1Sep}{}}\n"
"\\def\\HashNode#1{\\Defcs{#1}{}}\n"
"\n"
"\\input{" << pathDoxyStructureTex << "}\n"
"\n"
"\\newbox\\BoxA\n"
"\\dimendef\\DimenA=151\\relax\n"
"\\dimendef\\DimenB=152\\relax\n"
"\\countdef\\ZoneDepth=151\\relax\n"
"\n"
"\\def\\Cs#1{\\csname#1\\endcsname}\n"
"\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}\n"
"\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}\n"
"\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}\n"
"\n"
"\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax\n"
"\\raggedright#1\\vskip 0.5mm\\relax} }}\n"
"\n"
"\\def\\Zone#1#2#3{%\n"
"\\Defcs{Test#1}{#2}%\n"
"\\Defcs{Emit#1}{#3}%\n"
"\\Defcs{#1}{%\n"
"\\advance\\ZoneDepth1\\relax\n"
"\\Letcs{Mode\\number\\ZoneDepth}0\\relax\n"
"\\Letcs{Present\\number\\ZoneDepth}0\\relax\n"
"\\Cs{Test#1}\n"
"\\expandafter\\if\\Cs{Present\\number\\ZoneDepth}1%\n"
"\\advance\\ZoneDepth-1\\relax\n"
"\\Letcs{Present\\number\\ZoneDepth}1\\relax\n"
"\\expandafter\\if\\Cs{Mode\\number\\ZoneDepth}1%\n"
"\\advance\\ZoneDepth1\\relax\n"
"\\Letcs{Mode\\number\\ZoneDepth}1\\relax\n"
"\\Cs{Emit#1}\n"
"\\advance\\ZoneDepth-1\\relax\\fi\n"
"\\advance\\ZoneDepth1\\relax\\fi\n"
"\\advance\\ZoneDepth-1\\relax}}\n"
"\n"
"\\def\\Member#1#2{%\n"
"\\Defcs{Test#1}{\\Cs{field#1Detailed}\n"
"\\IfEmpty{field#1DetailedDoc}\\else\\Letcs{Present#1}1\\fi}\n"
"\\Defcs{#1}{\\Letcs{Present#1}0\\relax\n"
"\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1\\relax\n"
"\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}\n"
"\n"
"\\def\\TypedefMemberList#1#2{%\n"
"\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n"
"\\Defcs{#1Name}##1{\\textbf{##1}}%\n"
"\\Defcs{#1See}##1{\\See{##1}}%\n"
"%\n"
"\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n"
"\\Member{#1}{\\Frame{typedef \\Cs{field#1Type} \\Cs{field#1Name}}%\n"
"\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n"
"\n"
"\\def\\VariableMemberList#1#2{%\n"
"\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n"
"\\Defcs{#1Name}##1{\\textbf{##1}}%\n"
"\\Defcs{#1See}##1{\\See{##1}}%\n"
"%\n"
"\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n"
"\\Member{#1}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}}%\n"
"\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n"
"\n"
"\\def\\FunctionMemberList#1#2{%\n"
"\\Defcs{#1PDParamName}##1{\\textit{##1}}%\n"
"\\Defcs{#1PDParam}{\\Cs{field#1PDParamName}}%\n"
"\\Defcs{#1PDParamsSep}{, }%\n"
"\\Defcs{#1PDBlocksSep}{\\vskip 2mm\\relax}%\n"
"%\n"
"\\Defcs{#1PDBlocks}##1{%\n"
"\\Heading{Parameters:}\\vskip 1.5mm\\relax\n"
"\\DimenA0pt\\relax\n"
"\\Defcs{#1PDBlock}{\\setbox\\BoxA\\hbox{\\Cs{field#1PDParams}}%\n"
"\\ifdim\\DimenA<\\wd\\BoxA\\DimenA\\wd\\BoxA\\fi}%\n"
"##1%\n"
"\\advance\\DimenA3mm\\relax\n"
"\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax\n"
"\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax\n"
"\\Cs{field#1PDParams}}\\hfill\n"
"\\vtop{\\hsize\\DimenB\\relax\\Cs{field#1PDDoc}}}}%\n"
"##1}\n"
"\n"
"\\Defcs{#1ParamName}##1{\\textit{##1}}\n"
"\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}\n"
"\\Defcs{#1ParamsSep}{, }\n"
"\n"
"\\Defcs{#1Name}##1{\\textbf{##1}}\n"
"\\Defcs{#1See}##1{\\See{##1}}\n"
"\\Defcs{#1Return}##1{\\Heading{Returns: }##1}\n"
"\\Defcs{field#1Title}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}(\\Cs{field#1Params})}}%\n"
"%\n"
"\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n"
"\\Member{#1}{%\n"
"\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}\n"
"\\Cs{field#1Return}\\Cs{field#1PDBlocks}\\Cs{field#1See}\\vskip 5mm\\relax}}\n"
"\n"
"\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}\n"
"\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}\n"
"\n"
"\\def\\FileSubzones{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}\n"
"\n"
"\\def\\ClassSubzones{%\n"
"\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods\n"
"\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods\n"
"\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}\n"
"\n"
"\\Member{Page}{\\subsection{\\fieldPageName}\\fieldPageDetailedDoc}\n"
"\n"
"\\TypedefMemberList{FileTypedef}{Typedefs}\n"
"\\VariableMemberList{FileVariable}{Variables}\n"
"\\FunctionMemberList{FileFunction}{Functions}\n"
"\\Zone{File}{\\FileSubzones}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\FileSubzones}\n"
"\n"
"\\TypedefMemberList{ClassPublicTypedef}{Public Typedefs}\n"
"\\TypedefMemberList{ClassProtectedTypedef}{Protected Typedefs}\n"
"\\TypedefMemberList{ClassPrivateTypedef}{Private Typedefs}\n"
"\\VariableMemberList{ClassPublicMember}{Public Members}\n"
"\\VariableMemberList{ClassProtectedMember}{Protected Members}\n"
"\\VariableMemberList{ClassPrivateMember}{Private Members}\n"
"\\FunctionMemberList{ClassPublicMethod}{Public Methods}\n"
"\\FunctionMemberList{ClassProtectedMethod}{Protected Methods}\n"
"\\FunctionMemberList{ClassPrivateMethod}{Private Methods}\n"
"\\Zone{Class}{\\ClassSubzones}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\ClassSubzones}\n"
"\n"
"\\Zone{AllPages}{\\fieldPages}{\\section{Pages}\\fieldPages}\n"
"\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}\n"
"\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}\n"
"\n"
"\\newlength{\\oldparskip}\n"
"\\newlength{\\oldparindent}\n"
"\\newlength{\\oldfboxrule}\n"
"\n"
"\\ZoneDepth0\\relax\n"
"\\Letcs{Mode0}1\\relax\n"
"\n"
"\\def\\EmitDoxyDocs{%\n"
"\\setlength{\\oldparskip}{\\parskip}\n"
"\\setlength{\\oldparindent}{\\parindent}\n"
"\\setlength{\\oldfboxrule}{\\fboxrule}\n"
"\\setlength{\\parskip}{0cm}\n"
"\\setlength{\\parindent}{0cm}\n"
"\\setlength{\\fboxrule}{1pt}\n"
"\\AllPages\\AllFiles\\AllClasses\n"
"\\setlength{\\parskip}{\\oldparskip}\n"
"\\setlength{\\parindent}{\\oldparindent}\n"
"\\setlength{\\fboxrule}{\\oldfboxrule}}\n";
return true;
}
bool PerlModGenerator::generateDoxyLatexPL ( )

Definition at line 2640 of file perlmodgen.cpp.

References createOutputFile(), and pathDoxyLatexPL.

Referenced by generate().

{
QFile doxyLatexPL;
if (!createOutputFile(doxyLatexPL, pathDoxyLatexPL))
return false;
FTextStream doxyLatexPLStream(&doxyLatexPL);
doxyLatexPLStream <<
"use DoxyStructure;\n"
"use DoxyDocs;\n"
"\n"
"sub latex_quote($) {\n"
"\tmy $text = $_[0];\n"
"\t$text =~ s/\\\\/\\\\textbackslash /g;\n"
"\t$text =~ s/\\|/\\\\textbar /g;\n"
"\t$text =~ s/</\\\\textless /g;\n"
"\t$text =~ s/>/\\\\textgreater /g;\n"
"\t$text =~ s/~/\\\\textasciitilde /g;\n"
"\t$text =~ s/\\^/\\\\textasciicircum /g;\n"
"\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n"
"\tprint $text;\n"
"}\n"
"\n"
"sub generate_doc($) {\n"
"\tmy $doc = $_[0];\n"
"\tfor my $item (@$doc) {\n"
"\t\tmy $type = $$item{type};\n"
"\t\tif ($type eq \"text\") {\n"
"\t\t\tlatex_quote($$item{content});\n"
"\t\t} elsif ($type eq \"parbreak\") {\n"
"\t\t\tprint \"\\n\\n\";\n"
"\t\t} elsif ($type eq \"style\") {\n"
"\t\t\tmy $style = $$item{style};\n"
"\t\t\tif ($$item{enable} eq \"yes\") {\n"
"\t\t\t\tif ($style eq \"bold\") { print '\\bfseries'; }\n"
"\t\t\t\tif ($style eq \"italic\") { print '\\itshape'; }\n"
"\t\t\t\tif ($style eq \"code\") { print '\\ttfamily'; }\n"
"\t\t\t} else {\n"
"\t\t\t\tif ($style eq \"bold\") { print '\\mdseries'; }\n"
"\t\t\t\tif ($style eq \"italic\") { print '\\upshape'; }\n"
"\t\t\t\tif ($style eq \"code\") { print '\\rmfamily'; }\n"
"\t\t\t}\n"
"\t\t\tprint '{}';\n"
"\t\t} elsif ($type eq \"symbol\") {\n"
"\t\t\tmy $symbol = $$item{symbol};\n"
"\t\t\tif ($symbol eq \"copyright\") { print '\\copyright'; }\n"
"\t\t\telsif ($symbol eq \"szlig\") { print '\\ss'; }\n"
"\t\t\tprint '{}';\n"
"\t\t} elsif ($type eq \"accent\") {\n"
"\t\t\tmy ($accent) = $$item{accent};\n"
"\t\t\tif ($accent eq \"umlaut\") { print '\\\"'; }\n"
"\t\t\telsif ($accent eq \"acute\") { print '\\\\\\''; }\n"
"\t\t\telsif ($accent eq \"grave\") { print '\\`'; }\n"
"\t\t\telsif ($accent eq \"circ\") { print '\\^'; }\n"
"\t\t\telsif ($accent eq \"tilde\") { print '\\~'; }\n"
"\t\t\telsif ($accent eq \"cedilla\") { print '\\c'; }\n"
"\t\t\telsif ($accent eq \"ring\") { print '\\r'; }\n"
"\t\t\tprint \"{\" . $$item{letter} . \"}\"; \n"
"\t\t} elsif ($type eq \"list\") {\n"
"\t\t\tmy $env = ($$item{style} eq \"ordered\") ? \"enumerate\" : \"itemize\";\n"
"\t\t\tprint \"\\n\\\\begin{\" . $env .\"}\";\n"
"\t\t \tfor my $subitem (@{$$item{content}}) {\n"
"\t\t\t\tprint \"\\n\\\\item \";\n"
"\t\t\t\tgenerate_doc($subitem);\n"
"\t\t \t}\n"
"\t\t\tprint \"\\n\\\\end{\" . $env .\"}\";\n"
"\t\t} elsif ($type eq \"url\") {\n"
"\t\t\tlatex_quote($$item{content});\n"
"\t\t}\n"
"\t}\n"
"}\n"
"\n"
"sub generate($$) {\n"
"\tmy ($item, $node) = @_;\n"
"\tmy ($type, $name) = @$node[0, 1];\n"
"\tif ($type eq \"string\") {\n"
"\t\tprint \"\\\\\" . $name . \"{\";\n"
"\t\tlatex_quote($item);\n"
"\t\tprint \"}\";\n"
"\t} elsif ($type eq \"doc\") {\n"
"\t\tif (@$item) {\n"
"\t\t\tprint \"\\\\\" . $name . \"{\";\n"
"\t\t\tgenerate_doc($item);\n"
"\t\t\tprint \"}%\\n\";\n"
"\t\t} else {\n"
"#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
"\t\t}\n"
"\t} elsif ($type eq \"hash\") {\n"
"\t\tmy ($key, $value);\n"
"\t\twhile (($key, $subnode) = each %{$$node[2]}) {\n"
"\t\t\tmy $subname = $$subnode[1];\n"
"\t\t\tprint \"\\\\Defcs{field\" . $subname . \"}{\";\n"
"\t\t\tif ($$item{$key}) {\n"
"\t\t\t\tgenerate($$item{$key}, $subnode);\n"
"\t\t\t} else {\n"
"#\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n"
"\t\t\t}\n"
"\t\t\tprint \"}%\\n\";\n"
"\t\t}\n"
"\t\tprint \"\\\\\" . $name . \"%\\n\";\n"
"\t} elsif ($type eq \"list\") {\n"
"\t\tmy $index = 0;\n"
"\t\tif (@$item) {\n"
"\t\t\tprint \"\\\\\" . $name . \"{%\\n\";\n"
"\t\t\tfor my $subitem (@$item) {\n"
"\t\t\t\tif ($index) {\n"
"\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n"
"\t\t\t\t}\n"
"\t\t\t\tgenerate($subitem, $$node[2]);\n"
"\t\t\t\t$index++;\n"
"\t\t\t}\n"
"\t\t\tprint \"}%\\n\";\n"
"\t\t} else {\n"
"#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
"\t\t}\n"
"\t}\n"
"}\n"
"\n"
"generate($doxydocs, $doxystructure);\n";
return true;
}
bool PerlModGenerator::generateDoxyLatexStructurePL ( )

Definition at line 2606 of file perlmodgen.cpp.

References createOutputFile(), and pathDoxyLatexStructurePL.

Referenced by generate().

{
QFile doxyLatexStructurePL;
if (!createOutputFile(doxyLatexStructurePL, pathDoxyLatexStructurePL))
return false;
FTextStream doxyLatexStructurePLStream(&doxyLatexStructurePL);
doxyLatexStructurePLStream <<
"use DoxyStructure;\n"
"\n"
"sub process($) {\n"
"\tmy $node = $_[0];\n"
"\tmy ($type, $name) = @$node[0, 1];\n"
"\tmy $command;\n"
"\tif ($type eq \"string\") { $command = \"String\" }\n"
"\telsif ($type eq \"doc\") { $command = \"Doc\" }\n"
"\telsif ($type eq \"hash\") {\n"
"\t\t$command = \"Hash\";\n"
"\t\tfor my $subnode (values %{$$node[2]}) {\n"
"\t\t\tprocess($subnode);\n"
"\t\t}\n"
"\t}\n"
"\telsif ($type eq \"list\") {\n"
"\t\t$command = \"List\";\n"
"\t\tprocess($$node[2]);\n"
"\t}\n"
"\tprint \"\\\\\" . $command . \"Node{\" . $name . \"}%\\n\";\n"
"}\n"
"\n"
"process($doxystructure);\n";
return true;
}
bool PerlModGenerator::generateDoxyLatexTex ( )

Definition at line 2926 of file perlmodgen.cpp.

References createOutputFile(), pathDoxyDocsTex, and pathDoxyLatexTex.

Referenced by generate().

{
QFile doxyLatexTex;
if (!createOutputFile(doxyLatexTex, pathDoxyLatexTex))
return false;
FTextStream doxyLatexTexStream(&doxyLatexTex);
doxyLatexTexStream <<
"\\documentclass[a4paper,12pt]{article}\n"
"\\usepackage[latin1]{inputenc}\n"
"\\usepackage[none]{hyphenat}\n"
"\\usepackage[T1]{fontenc}\n"
"\\usepackage{hyperref}\n"
"\\usepackage{times}\n"
"\n"
"\\input{doxyformat}\n"
"\n"
"\\begin{document}\n"
"\\input{" << pathDoxyDocsTex << "}\n"
"\\sloppy\n"
"\\EmitDoxyDocs\n"
"\\end{document}\n";
return true;
}
bool PerlModGenerator::generateDoxyRules ( )

Definition at line 2482 of file perlmodgen.cpp.

References Config_getBool, Config_getString, createOutputFile(), pathDoxyDocsPM, pathDoxyDocsTex, pathDoxyFormatTex, pathDoxyLatexDVI, pathDoxyLatexPDF, pathDoxyLatexPL, pathDoxyLatexStructurePL, pathDoxyLatexTex, pathDoxyRules, pathDoxyStructurePM, and pathDoxyStructureTex.

Referenced by generate().

{
QFile doxyRules;
if (!createOutputFile(doxyRules, pathDoxyRules))
return false;
bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
QCString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
FTextStream doxyRulesStream(&doxyRules);
doxyRulesStream <<
prefix << "DOXY_EXEC_PATH = " << pathDoxyExec << "\n" <<
prefix << "DOXYFILE = " << pathDoxyfile << "\n" <<
prefix << "DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" <<
prefix << "DOXYSTRUCTURE_PM = " << pathDoxyStructurePM << "\n" <<
prefix << "DOXYRULES = " << pathDoxyRules << "\n";
if (perlmodLatex)
doxyRulesStream <<
prefix << "DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" <<
prefix << "DOXYLATEXSTRUCTURE_PL = " << pathDoxyLatexStructurePL << "\n" <<
prefix << "DOXYSTRUCTURE_TEX = " << pathDoxyStructureTex << "\n" <<
prefix << "DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" <<
prefix << "DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" <<
prefix << "DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" <<
prefix << "DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" <<
prefix << "DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n";
doxyRulesStream <<
"\n"
".PHONY: clean-perlmod\n"
"clean-perlmod::\n"
"\trm -f $(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
"\t$(" << prefix << "DOXYDOCS_PM)";
if (perlmodLatex)
doxyRulesStream <<
" \\\n"
"\t$(" << prefix << "DOXYLATEX_PL) \\\n"
"\t$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
"\t$(" << prefix << "DOXYDOCS_TEX) \\\n"
"\t$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
"\t$(" << prefix << "DOXYFORMAT_TEX) \\\n"
"\t$(" << prefix << "DOXYLATEX_TEX) \\\n"
"\t$(" << prefix << "DOXYLATEX_PDF) \\\n"
"\t$(" << prefix << "DOXYLATEX_DVI) \\\n"
"\t$(addprefix $(" << prefix << "DOXYLATEX_TEX:tex=),out aux log)";
doxyRulesStream << "\n\n";
doxyRulesStream <<
"$(" << prefix << "DOXYRULES) \\\n"
"$(" << prefix << "DOXYMAKEFILE) \\\n"
"$(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
"$(" << prefix << "DOXYDOCS_PM)";
if (perlmodLatex) {
doxyRulesStream <<
" \\\n"
"$(" << prefix << "DOXYLATEX_PL) \\\n"
"$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
"$(" << prefix << "DOXYFORMAT_TEX) \\\n"
"$(" << prefix << "DOXYLATEX_TEX)";
}
doxyRulesStream <<
": \\\n"
"\t$(" << prefix << "DOXYFILE)\n"
"\tcd $(" << prefix << "DOXY_EXEC_PATH) ; doxygen \"$<\"\n";
if (perlmodLatex) {
doxyRulesStream <<
"\n"
"$(" << prefix << "DOXYDOCS_TEX): \\\n"
"$(" << prefix << "DOXYLATEX_PL) \\\n"
"$(" << prefix << "DOXYDOCS_PM)\n"
"\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
"\n"
"$(" << prefix << "DOXYSTRUCTURE_TEX): \\\n"
"$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
"$(" << prefix << "DOXYSTRUCTURE_PM)\n"
"\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
"\n"
"$(" << prefix << "DOXYLATEX_PDF) \\\n"
"$(" << prefix << "DOXYLATEX_DVI): \\\n"
"$(" << prefix << "DOXYLATEX_TEX) \\\n"
"$(" << prefix << "DOXYFORMAT_TEX) \\\n"
"$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
"$(" << prefix << "DOXYDOCS_TEX)\n"
"\n"
"$(" << prefix << "DOXYLATEX_PDF): \\\n"
"$(" << prefix << "DOXYLATEX_TEX)\n"
"\tpdflatex -interaction=nonstopmode \"$<\"\n"
"\n"
"$(" << prefix << "DOXYLATEX_DVI): \\\n"
"$(" << prefix << "DOXYLATEX_TEX)\n"
"\tlatex -interaction=nonstopmode \"$<\"\n";
}
return true;
}
bool PerlModGenerator::generateDoxyStructurePM ( )

Definition at line 2298 of file perlmodgen.cpp.

References createOutputFile(), and pathDoxyStructurePM.

Referenced by generate().

{
QFile doxyModelPM;
return false;
FTextStream doxyModelPMStream(&doxyModelPM);
doxyModelPMStream <<
"sub memberlist($) {\n"
" my $prefix = $_[0];\n"
" return\n"
"\t[ \"hash\", $prefix . \"s\",\n"
"\t {\n"
"\t members =>\n"
"\t [ \"list\", $prefix . \"List\",\n"
"\t\t[ \"hash\", $prefix,\n"
"\t\t {\n"
"\t\t kind => [ \"string\", $prefix . \"Kind\" ],\n"
"\t\t name => [ \"string\", $prefix . \"Name\" ],\n"
"\t\t static => [ \"string\", $prefix . \"Static\" ],\n"
"\t\t virtualness => [ \"string\", $prefix . \"Virtualness\" ],\n"
"\t\t protection => [ \"string\", $prefix . \"Protection\" ],\n"
"\t\t type => [ \"string\", $prefix . \"Type\" ],\n"
"\t\t parameters =>\n"
"\t\t [ \"list\", $prefix . \"Params\",\n"
"\t\t\t[ \"hash\", $prefix . \"Param\",\n"
"\t\t\t {\n"
"\t\t\t declaration_name => [ \"string\", $prefix . \"ParamName\" ],\n"
"\t\t\t type => [ \"string\", $prefix . \"ParamType\" ],\n"
"\t\t\t },\n"
"\t\t\t],\n"
"\t\t ],\n"
"\t\t detailed =>\n"
"\t\t [ \"hash\", $prefix . \"Detailed\",\n"
"\t\t\t{\n"
"\t\t\t doc => [ \"doc\", $prefix . \"DetailedDoc\" ],\n"
"\t\t\t return => [ \"doc\", $prefix . \"Return\" ],\n"
"\t\t\t see => [ \"doc\", $prefix . \"See\" ],\n"
"\t\t\t params =>\n"
"\t\t\t [ \"list\", $prefix . \"PDBlocks\",\n"
"\t\t\t [ \"hash\", $prefix . \"PDBlock\",\n"
"\t\t\t\t{\n"
"\t\t\t\t parameters =>\n"
"\t\t\t\t [ \"list\", $prefix . \"PDParams\",\n"
"\t\t\t\t [ \"hash\", $prefix . \"PDParam\",\n"
"\t\t\t\t\t{\n"
"\t\t\t\t\t name => [ \"string\", $prefix . \"PDParamName\" ],\n"
"\t\t\t\t\t},\n"
"\t\t\t\t ],\n"
"\t\t\t\t ],\n"
"\t\t\t\t doc => [ \"doc\", $prefix . \"PDDoc\" ],\n"
"\t\t\t\t},\n"
"\t\t\t ],\n"
"\t\t\t ],\n"
"\t\t\t},\n"
"\t\t ],\n"
"\t\t },\n"
"\t\t],\n"
"\t ],\n"
"\t },\n"
"\t];\n"
"}\n"
"\n"
"$doxystructure =\n"
" [ \"hash\", \"Root\",\n"
" {\n"
"\tfiles =>\n"
"\t [ \"list\", \"Files\",\n"
"\t [ \"hash\", \"File\",\n"
"\t {\n"
"\t\tname => [ \"string\", \"FileName\" ],\n"
"\t\ttypedefs => memberlist(\"FileTypedef\"),\n"
"\t\tvariables => memberlist(\"FileVariable\"),\n"
"\t\tfunctions => memberlist(\"FileFunction\"),\n"
"\t\tdetailed =>\n"
"\t\t [ \"hash\", \"FileDetailed\",\n"
"\t\t {\n"
"\t\t doc => [ \"doc\", \"FileDetailedDoc\" ],\n"
"\t\t },\n"
"\t\t ],\n"
"\t },\n"
"\t ],\n"
"\t ],\n"
"\tpages =>\n"
"\t [ \"list\", \"Pages\",\n"
"\t [ \"hash\", \"Page\",\n"
"\t {\n"
"\t\tname => [ \"string\", \"PageName\" ],\n"
"\t\tdetailed =>\n"
"\t\t [ \"hash\", \"PageDetailed\",\n"
"\t\t {\n"
"\t\t doc => [ \"doc\", \"PageDetailedDoc\" ],\n"
"\t\t },\n"
"\t\t ],\n"
"\t },\n"
"\t ],\n"
"\t ],\n"
"\tclasses =>\n"
"\t [ \"list\", \"Classes\",\n"
"\t [ \"hash\", \"Class\",\n"
"\t {\n"
"\t\tname => [ \"string\", \"ClassName\" ],\n"
"\t\tpublic_typedefs => memberlist(\"ClassPublicTypedef\"),\n"
"\t\tpublic_methods => memberlist(\"ClassPublicMethod\"),\n"
"\t\tpublic_members => memberlist(\"ClassPublicMember\"),\n"
"\t\tprotected_typedefs => memberlist(\"ClassProtectedTypedef\"),\n"
"\t\tprotected_methods => memberlist(\"ClassProtectedMethod\"),\n"
"\t\tprotected_members => memberlist(\"ClassProtectedMember\"),\n"
"\t\tprivate_typedefs => memberlist(\"ClassPrivateTypedef\"),\n"
"\t\tprivate_methods => memberlist(\"ClassPrivateMethod\"),\n"
"\t\tprivate_members => memberlist(\"ClassPrivateMember\"),\n"
"\t\tdetailed =>\n"
"\t\t [ \"hash\", \"ClassDetailed\",\n"
"\t\t {\n"
"\t\t doc => [ \"doc\", \"ClassDetailedDoc\" ],\n"
"\t\t },\n"
"\t\t ],\n"
"\t },\n"
"\t ],\n"
"\t ],\n"
"\tgroups =>\n"
"\t [ \"list\", \"Groups\",\n"
"\t [ \"hash\", \"Group\",\n"
"\t {\n"
"\t\tname => [ \"string\", \"GroupName\" ],\n"
"\t\ttitle => [ \"string\", \"GroupTitle\" ],\n"
"\t\tfiles =>\n"
"\t\t [ \"list\", \"Files\",\n"
"\t\t [ \"hash\", \"File\",\n"
"\t\t {\n"
"\t\t name => [ \"string\", \"Filename\" ]\n"
"\t\t }\n"
"\t\t ],\n"
"\t\t ],\n"
"\t\tclasses =>\n"
"\t\t [ \"list\", \"Classes\",\n"
"\t\t [ \"hash\", \"Class\",\n"
"\t\t {\n"
"\t\t name => [ \"string\", \"Classname\" ]\n"
"\t\t }\n"
"\t\t ],\n"
"\t\t ],\n"
"\t\tnamespaces =>\n"
"\t\t [ \"list\", \"Namespaces\",\n"
"\t\t [ \"hash\", \"Namespace\",\n"
"\t\t {\n"
"\t\t name => [ \"string\", \"NamespaceName\" ]\n"
"\t\t }\n"
"\t\t ],\n"
"\t\t ],\n"
"\t\tpages =>\n"
"\t\t [ \"list\", \"Pages\",\n"
"\t\t [ \"hash\", \"Page\","
"\t\t {\n"
"\t\t title => [ \"string\", \"PageName\" ]\n"
"\t\t }\n"
"\t\t ],\n"
"\t\t ],\n"
"\t\tgroups =>\n"
"\t\t [ \"list\", \"Groups\",\n"
"\t\t [ \"hash\", \"Group\",\n"
"\t\t {\n"
"\t\t title => [ \"string\", \"GroupName\" ]\n"
"\t\t }\n"
"\t\t ],\n"
"\t\t ],\n"
"\t\tfunctions => memberlist(\"GroupFunction\"),\n"
"\t\tdetailed =>\n"
"\t\t [ \"hash\", \"GroupDetailed\",\n"
"\t\t {\n"
"\t\t doc => [ \"doc\", \"GroupDetailedDoc\" ],\n"
"\t\t },\n"
"\t\t ],\n"
"\t }\n"
"\t ],\n"
"\t ],\n"
" },\n"
" ];\n"
"\n"
"1;\n";
return true;
}
bool PerlModGenerator::generateMakefile ( )

Definition at line 2579 of file perlmodgen.cpp.

References Config_getBool, Config_getString, createOutputFile(), pathDoxyRules, and pathMakefile.

Referenced by generate().

{
QFile makefile;
if (!createOutputFile(makefile, pathMakefile))
return false;
bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
QCString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
FTextStream makefileStream(&makefile);
makefileStream <<
".PHONY: default clean" << (perlmodLatex ? " pdf" : "") << "\n"
"default: " << (perlmodLatex ? "pdf" : "clean") << "\n"
"\n"
"include " << pathDoxyRules << "\n"
"\n"
"clean: clean-perlmod\n";
if (perlmodLatex) {
makefileStream <<
"pdf: $(" << prefix << "DOXYLATEX_PDF)\n"
"dvi: $(" << prefix << "DOXYLATEX_DVI)\n";
}
return true;
}
void PerlModGenerator::generatePerlModForClass ( ClassDef cd)

Definition at line 1768 of file perlmodgen.cpp.

References PerlModOutput::addFieldBoolean(), PerlModOutput::addFieldQuotedString(), addListOfAllMembers(), addPerlModDocBlock(), addTemplateList(), ClassDef::baseClasses(), Definition::briefDescription(), PerlModOutput::closeHash(), PerlModOutput::closeList(), FileDef::docName(), Definition::documentation(), endl(), IncludeInfo::fileDef, generatePerlModSection(), ClassDef::getClassSDict(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getEndBodyLine(), ClassDef::getMemberGroupSDict(), ClassDef::getMemberList(), FileDef::getOutputFileBase(), getProtectionName(), Definition::getStartBodyLine(), getVirtualnessName(), ClassDef::includeInfo(), IncludeInfo::includeName, ClassDef::isReference(), Definition::isReference(), DotClassGraph::isTrivial(), SDict< ClassDef >::Iterator, SIntDict< MemberGroup >::Iterator, IncludeInfo::local, m_output, MemberListType_dcopMethods, MemberListType_friends, MemberListType_priAttribs, MemberListType_priMethods, MemberListType_priSlots, MemberListType_priStaticAttribs, MemberListType_priStaticMethods, MemberListType_priTypes, MemberListType_proAttribs, MemberListType_proMethods, MemberListType_properties, MemberListType_proSlots, MemberListType_proStaticAttribs, MemberListType_proStaticMethods, MemberListType_proTypes, MemberListType_pubAttribs, MemberListType_pubMethods, MemberListType_pubSlots, MemberListType_pubStaticAttribs, MemberListType_pubStaticMethods, MemberListType_pubTypes, MemberListType_related, MemberListType_signals, Definition::name(), PerlModOutput::openHash(), PerlModOutput::openList(), ClassDef::subClasses(), and ClassDef::templateMaster().

Referenced by generatePerlModOutput().

{
// + brief description
// + detailed description
// + template argument list(s)
// - include file
// + member groups
// + inheritance diagram
// + list of direct super classes
// + list of direct sub classes
// + list of inner classes
// + collaboration diagram
// + list of all members
// + user defined member sections
// + standard member sections
// + detailed member documentation
// - examples using the class
if (cd->isReference()) return; // skip external references.
if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
if (cd->templateMaster()!=0) return; // skip generated template instances.
.addFieldQuotedString("name", cd->name());
if (cd->baseClasses())
{
m_output.openList("base");
for (bcli.toFirst();(bcd=bcli.current());++bcli)
.addFieldQuotedString("name", bcd->classDef->displayName())
.addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt))
.addFieldQuotedString("protection", getProtectionName(bcd->prot))
.closeHash();
}
if (cd->subClasses())
{
m_output.openList("derived");
for (bcli.toFirst();(bcd=bcli.current());++bcli)
.addFieldQuotedString("name", bcd->classDef->displayName())
.addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt))
.addFieldQuotedString("protection", getProtectionName(bcd->prot))
.closeHash();
}
if (cl)
{
m_output.openList("inner");
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
.addFieldQuotedString("name", cd->name())
.closeHash();
}
if (ii)
{
QCString nm = ii->includeName;
if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
if (!nm.isEmpty())
{
m_output.openHash("includes");
#if 0
if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
t << " id=\"" << ii->fileDef->getOutputFileBase() << "\"";
#endif
.addFieldQuotedString("name", nm)
}
}
{
for (;(mg=mgli.current());++mgli)
generatePerlModSection(cd,mg->members(),"user_defined",mg->header());
}
#if 0
DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance);
if (!inheritanceGraph.isTrivial())
{
t << " <inheritancegraph>" << endl;
inheritanceGraph.writePerlMod(t);
t << " </inheritancegraph>" << endl;
}
DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation);
if (!collaborationGraph.isTrivial())
{
t << " <collaborationgraph>" << endl;
collaborationGraph.writePerlMod(t);
t << " </collaborationgraph>" << endl;
}
t << " <location file=\""
<< cd->getDefFileName() << "\" line=\""
<< cd->getDefLine() << "\"";
if (cd->getStartBodyLine()!=-1)
{
t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
<< cd->getEndBodyLine() << "\"";
}
t << "/>" << endl;
#endif
}
void PerlModGenerator::generatePerlModForFile ( FileDef fd)

Definition at line 1981 of file perlmodgen.cpp.

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), Definition::briefDescription(), PerlModOutput::closeHash(), PerlModOutput::closeList(), Definition::documentation(), IncludeInfo::fileDef, generatePerlModSection(), Definition::getDefFileName(), Definition::getDefLine(), FileDef::getMemberList(), FileDef::getOutputFileBase(), FileDef::includedByFileList(), FileDef::includeFileList(), IncludeInfo::includeName, Definition::isReference(), m_output, MemberListType_decDefineMembers, MemberListType_decEnumMembers, MemberListType_decFuncMembers, MemberListType_decProtoMembers, MemberListType_decTypedefMembers, MemberListType_decVarMembers, FileDef::name(), PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModOutput().

{
// + includes files
// + includedby files
// - include graph
// - included by graph
// - contained class definitions
// - contained namespace definitions
// - member groups
// + normal members
// + brief desc
// + detailed desc
// - source code
// - location
// - number of lines
if (fd->isReference()) return;
.addFieldQuotedString("name", fd->name());
m_output.openList("includes");
if (fd->includeFileList())
{
QListIterator<IncludeInfo> ili1(*fd->includeFileList());
for (ili1.toFirst();(inc=ili1.current());++ili1)
{
if (inc->fileDef && !inc->fileDef->isReference())
{
}
}
}
m_output.openList("included_by");
if (fd->includedByFileList())
{
QListIterator<IncludeInfo> ili2(*fd->includedByFileList());
for (ili2.toFirst();(inc=ili2.current());++ili2)
{
if (inc->fileDef && !inc->fileDef->isReference())
{
}
}
}
}
void PerlModGenerator::generatePerlModForGroup ( GroupDef gd)

Definition at line 2050 of file perlmodgen.cpp.

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), Definition::briefDescription(), PerlModOutput::closeHash(), PerlModOutput::closeList(), Definition::documentation(), generatePerlModSection(), GroupDef::getClasses(), Definition::getDefFileName(), Definition::getDefLine(), GroupDef::getFiles(), GroupDef::getMemberGroupSDict(), GroupDef::getMemberList(), GroupDef::getNamespaces(), GroupDef::getPages(), GroupDef::getSubGroups(), GroupDef::groupTitle(), Definition::isReference(), SDict< PageDef >::Iterator, SDict< ClassDef >::Iterator, SDict< NamespaceDef >::Iterator, SIntDict< MemberGroup >::Iterator, m_output, MemberListType_decDefineMembers, MemberListType_decEnumMembers, MemberListType_decFuncMembers, MemberListType_decProtoMembers, MemberListType_decTypedefMembers, MemberListType_decVarMembers, FileDef::name(), Definition::name(), PerlModOutput::openHash(), PerlModOutput::openList(), and PageDef::title().

Referenced by generatePerlModOutput().

{
// + members
// + member groups
// + files
// + classes
// + namespaces
// - packages
// + pages
// + child groups
// - examples
// + brief description
// + detailed description
if (gd->isReference()) return; // skip external references
.addFieldQuotedString("name", gd->name())
.addFieldQuotedString("title", gd->groupTitle());
FileList *fl = gd->getFiles();
if (fl)
{
m_output.openList("files");
QListIterator<FileDef> fli(*fl);
FileDef *fd;
for (fli.toFirst();(fd=fli.current());++fli)
.addFieldQuotedString("name", fd->name())
.closeHash();
}
ClassSDict *cl = gd->getClasses();
if (cl)
{
m_output.openList("classes");
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
.addFieldQuotedString("name", cd->name())
.closeHash();
}
if (nl)
{
m_output.openList("namespaces");
for (nli.toFirst();(nd=nli.current());++nli)
.addFieldQuotedString("name", nd->name())
.closeHash();
}
PageSDict *pl = gd->getPages();
if (pl)
{
m_output.openList("pages");
PageDef *pd;
for (pli.toFirst();(pd=pli.current());++pli)
.addFieldQuotedString("title", pd->title())
.closeHash();
}
GroupList *gl = gd->getSubGroups();
if (gl)
{
m_output.openList("groups");
GroupDef *sgd;
for (gli.toFirst();(sgd=gli.current());++gli)
.addFieldQuotedString("title", sgd->groupTitle())
.closeHash();
}
{
for (;(mg=mgli.current());++mgli)
generatePerlModSection(gd,mg->members(),"user-defined",mg->header());
}
}
void PerlModGenerator::generatePerlModForMember ( MemberDef md,
Definition  
)

Definition at line 1549 of file perlmodgen.cpp.

References PerlModOutput::addFieldBoolean(), PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), MemberDef::argsString(), MemberDef::argumentList(), Argument::array, Argument::attrib, MemberDef::briefDescription(), PerlModOutput::closeHash(), PerlModOutput::closeList(), ArgumentList::constSpecifier, MemberDef::declArgumentList(), Argument::defval, MemberDef::documentation(), MemberDef::enumFieldList(), MemberDef::excpString(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getOuterScope(), getProtectionName(), getVirtualnessName(), MemberDef::initializer(), MemberDef::isStatic(), m_output, MemberDef::memberType(), MemberType_DCOP, MemberType_Define, MemberType_Enumeration, MemberType_EnumValue, MemberType_Event, MemberType_Friend, MemberType_Function, MemberType_Interface, MemberType_Property, MemberType_Service, MemberType_Signal, MemberType_Slot, MemberType_Typedef, MemberType_Variable, Argument::name, Definition::name(), PerlModOutput::openHash(), PerlModOutput::openList(), MemberDef::protection(), MemberDef::reimplementedBy(), MemberDef::reimplements(), Argument::type, MemberDef::typeString(), MemberDef::virtualness(), and ArgumentList::volatileSpecifier.

Referenced by generatePerlModSection().

{
// + declaration/definition arg lists
// + reimplements
// + reimplementedBy
// + exceptions
// + const/volatile specifiers
// - examples
// - source definition
// - source references
// - source referenced by
// - body code
// - template arguments
// (templateArguments(), definitionTemplateParameterLists())
QCString memType;
bool isFunc=FALSE;
switch (md->memberType())
{
case MemberType_Define: memType="define"; break;
case MemberType_EnumValue: memType="enumvalue"; break;
case MemberType_Property: memType="property"; break;
case MemberType_Variable: memType="variable"; break;
case MemberType_Typedef: memType="typedef"; break;
case MemberType_Enumeration: memType="enum"; break;
case MemberType_Function: memType="function"; isFunc=TRUE; break;
case MemberType_Signal: memType="signal"; isFunc=TRUE; break;
//case MemberType_Prototype: memType="prototype"; isFunc=TRUE; break;
case MemberType_Friend: memType="friend"; isFunc=TRUE; break;
case MemberType_DCOP: memType="dcop"; isFunc=TRUE; break;
case MemberType_Slot: memType="slot"; isFunc=TRUE; break;
case MemberType_Event: memType="event"; break;
case MemberType_Interface: memType="interface"; break;
case MemberType_Service: memType="service"; break;
}
.addFieldQuotedString("kind", memType)
.addFieldQuotedString("name", md->name())
.addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness()))
.addFieldBoolean("static", md->isStatic());
if (isFunc) //function
{
m_output.addFieldBoolean("const", al!=0 && al->constSpecifier)
.addFieldBoolean("volatile", al!=0 && al->volatileSpecifier);
m_output.openList("parameters");
ArgumentList *declAl = md->declArgumentList();
ArgumentList *defAl = md->argumentList();
if (declAl && declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
for (declAli.toFirst();(a=declAli.current());++declAli)
{
Argument *defArg = defAli.current();
if (!a->name.isEmpty())
m_output.addFieldQuotedString("declaration_name", a->name);
if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
m_output.addFieldQuotedString("definition_name", defArg->name);
if (!a->type.isEmpty())
if (!a->array.isEmpty())
if (!a->defval.isEmpty())
m_output.addFieldQuotedString("default_value", a->defval);
if (!a->attrib.isEmpty())
if (defArg) ++defAli;
}
}
}
else if (md->memberType()==MemberType_Define &&
md->argsString()!=0) // define
{
m_output.openList("parameters");
for (ali.toFirst();(a=ali.current());++ali)
{
}
}
else if (md->argsString()!=0)
{
}
if (!md->initializer().isEmpty())
m_output.addFieldQuotedString("initializer", md->initializer());
if (md->excpString())
if (md->memberType()==MemberType_Enumeration) // enum
{
MemberList *enumFields = md->enumFieldList();
if (enumFields)
{
m_output.openList("values");
MemberListIterator emli(*enumFields);
MemberDef *emd;
for (emli.toFirst();(emd=emli.current());++emli)
{
.addFieldQuotedString("name", emd->name());
if (!emd->initializer().isEmpty())
m_output.addFieldQuotedString("initializer", emd->initializer());
addPerlModDocBlock(m_output,"detailed",emd->getDefFileName(),emd->getDefLine(),emd->getOuterScope(),emd,emd->documentation());
}
}
}
MemberDef *rmd = md->reimplements();
if (rmd)
m_output.openHash("reimplements")
.addFieldQuotedString("name", rmd->name())
.closeHash();
MemberList *rbml = md->reimplementedBy();
if (rbml)
{
MemberListIterator mli(*rbml);
m_output.openList("reimplemented_by");
for (mli.toFirst();(rmd=mli.current());++mli)
.addFieldQuotedString("name", rmd->name())
.closeHash();
}
}
void PerlModGenerator::generatePerlModForNamespace ( NamespaceDef nd)

Definition at line 1918 of file perlmodgen.cpp.

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), Definition::briefDescription(), PerlModOutput::closeHash(), PerlModOutput::closeList(), Definition::documentation(), generatePerlModSection(), NamespaceDef::getClassSDict(), Definition::getDefFileName(), Definition::getDefLine(), NamespaceDef::getMemberGroupSDict(), NamespaceDef::getMemberList(), NamespaceDef::getNamespaceSDict(), Definition::isReference(), SDict< ClassDef >::Iterator, SDict< NamespaceDef >::Iterator, SIntDict< MemberGroup >::Iterator, m_output, MemberListType_decDefineMembers, MemberListType_decEnumMembers, MemberListType_decFuncMembers, MemberListType_decProtoMembers, MemberListType_decTypedefMembers, MemberListType_decVarMembers, Definition::name(), PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModOutput().

{
// + contained class definitions
// + contained namespace definitions
// + member groups
// + normal members
// + brief desc
// + detailed desc
// + location
// - files containing (parts of) the namespace definition
if (nd->isReference()) return; // skip external references
.addFieldQuotedString("name", nd->name());
if (cl)
{
m_output.openList("classes");
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
.addFieldQuotedString("name", cd->name())
.closeHash();
}
if (nl)
{
m_output.openList("namespaces");
for (nli.toFirst();(nd=nli.current());++nli)
.addFieldQuotedString("name", nd->name())
.closeHash();
}
{
for (;(mg=mgli.current());++mgli)
generatePerlModSection(nd,mg->members(),"user-defined",mg->header());
}
}
void PerlModGenerator::generatePerlModForPage ( PageDef pi)
bool PerlModGenerator::generatePerlModOutput ( )

Definition at line 2175 of file perlmodgen.cpp.

References PerlModOutput::add(), Doxygen::classSDict, PerlModOutput::closeHash(), PerlModOutput::closeList(), createOutputFile(), generatePerlModForClass(), generatePerlModForFile(), generatePerlModForGroup(), generatePerlModForNamespace(), generatePerlModForPage(), Doxygen::groupSDict, Doxygen::inputNameList, SDict< GroupDef >::Iterator, SDict< ClassDef >::Iterator, SDict< PageDef >::Iterator, SDict< NamespaceDef >::Iterator, m_output, Doxygen::mainPage, Doxygen::namespaceSDict, PerlModOutput::openHash(), PerlModOutput::openList(), Doxygen::pageSDict, pathDoxyDocsPM, and PerlModOutput::setPerlModOutputStream().

Referenced by generate().

{
QFile outputFile;
if (!createOutputFile(outputFile, pathDoxyDocsPM))
return false;
FTextStream outputTextStream(&outputFile);
PerlModOutputStream outputStream(&outputTextStream);
m_output.add("$doxydocs=").openHash();
m_output.openList("classes");
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
m_output.openList("namespaces");
for (nli.toFirst();(nd=nli.current());++nli)
m_output.openList("files");
FileName *fn;
for (;(fn=fnli.current());++fnli)
{
FileNameIterator fni(*fn);
FileDef *fd;
for (;(fd=fni.current());++fni)
}
m_output.openList("groups");
GroupDef *gd;
for (;(gd=gli.current());++gli)
{
}
m_output.openList("pages");
PageDef *pd=0;
for (pdi.toFirst();(pd=pdi.current());++pdi)
{
}
{
}
m_output.closeHash().add(";\n1;\n");
return true;
}
void PerlModGenerator::generatePerlModSection ( Definition d,
MemberList ml,
const char *  name,
const char *  header = 0 
)

Member Data Documentation

PerlModOutput PerlModGenerator::m_output
QCString PerlModGenerator::pathDoxyDocsPM

Definition at line 1517 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyRules(), and generatePerlModOutput().

QCString PerlModGenerator::pathDoxyDocsTex

Definition at line 1511 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyLatexTex(), and generateDoxyRules().

QCString PerlModGenerator::pathDoxyFormatTex

Definition at line 1512 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyFormatTex(), and generateDoxyRules().

QCString PerlModGenerator::pathDoxyLatexDVI

Definition at line 1514 of file perlmodgen.cpp.

Referenced by generate(), and generateDoxyRules().

QCString PerlModGenerator::pathDoxyLatexPDF

Definition at line 1515 of file perlmodgen.cpp.

Referenced by generate(), and generateDoxyRules().

QCString PerlModGenerator::pathDoxyLatexPL

Definition at line 1518 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyLatexPL(), and generateDoxyRules().

QCString PerlModGenerator::pathDoxyLatexStructurePL

Definition at line 1519 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyLatexStructurePL(), and generateDoxyRules().

QCString PerlModGenerator::pathDoxyLatexTex

Definition at line 1513 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyLatexTex(), and generateDoxyRules().

QCString PerlModGenerator::pathDoxyRules

Definition at line 1520 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyRules(), and generateMakefile().

QCString PerlModGenerator::pathDoxyStructurePM

Definition at line 1510 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyRules(), and generateDoxyStructurePM().

QCString PerlModGenerator::pathDoxyStructureTex

Definition at line 1516 of file perlmodgen.cpp.

Referenced by generate(), generateDoxyFormatTex(), and generateDoxyRules().

QCString PerlModGenerator::pathMakefile

Definition at line 1521 of file perlmodgen.cpp.

Referenced by generate(), and generateMakefile().


The documentation for this class was generated from the following file: