Doxygen
Loading...
Searching...
No Matches
PerlModGenerator Class Reference
Collaboration diagram for PerlModGenerator:

Public Member Functions

 PerlModGenerator (bool pretty)
void generatePerlModForMember (const MemberDef *md, const Definition *)
void generatePerlUserDefinedSection (const Definition *d, const MemberGroupList &mgl)
void generatePerlModSection (const Definition *d, MemberList *ml, const DString &name, const DString &header=DString())
void addListOfAllMembers (const ClassDef *cd)
void addIncludeInfo (const IncludeInfo *ii)
void generatePerlModForClass (const ClassDef *cd)
void generatePerlModForConcept (const ConceptDef *cd)
void generatePerlModForModule (const ModuleDef *mod)
void generatePerlModForNamespace (const NamespaceDef *nd)
void generatePerlModForFile (const FileDef *fd)
void generatePerlModForGroup (const GroupDef *gd)
void generatePerlModForPage (PageDef *pi)
bool createOutputFile (std::ofstream &f, const DString &s)
bool createOutputDir (Dir &perlModDir)
bool generateDoxyLatexTex ()
bool generateDoxyFormatTex ()
bool generateDoxyStructurePM ()
bool generateDoxyLatexPL ()
bool generateDoxyLatexStructurePL ()
bool generateDoxyRules ()
bool generateMakefile ()
bool generatePerlModOutput ()
void generate ()

Public Attributes

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

Detailed Description

Definition at line 1440 of file perlmodgen.cpp.

Constructor & Destructor Documentation

◆ PerlModGenerator()

PerlModGenerator::PerlModGenerator ( bool pretty)
inline

Definition at line 1459 of file perlmodgen.cpp.

1459: m_output(pretty) { }
PerlModOutput m_output

References m_output.

Member Function Documentation

◆ addIncludeInfo()

void PerlModGenerator::addIncludeInfo ( const IncludeInfo * ii)

Definition at line 1718 of file perlmodgen.cpp.

1719{
1720 if (ii)
1721 {
1722 DString nm = ii->includeName;
1723 if (nm.empty() && ii->fileDef) nm = ii->fileDef->docName();
1724 if (!nm.empty())
1725 {
1726 m_output.openHash("includes");
1728 .addFieldQuotedString("name", nm)
1729 .closeHash();
1730 }
1731 }
1732}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
virtual const DString & docName() const =0
IncludeKind kind
Definition filedef.h:79
const FileDef * fileDef
Definition filedef.h:77
DString includeName
Definition filedef.h:78
PerlModOutput & addFieldQuotedString(const DString &field, const DString &content)
PerlModOutput & addFieldBoolean(const DString &field, bool content)
PerlModOutput & openHash(const DString &s=DString())
PerlModOutput & closeHash()
@ ImportLocal
Definition filedef.h:51
@ IncludeLocal
Definition filedef.h:47

References PerlModOutput::addFieldBoolean(), PerlModOutput::addFieldQuotedString(), PerlModOutput::closeHash(), FileDef::docName(), DString::empty(), IncludeInfo::fileDef, ImportLocal, IncludeLocal, IncludeInfo::includeName, IncludeInfo::kind, m_output, and PerlModOutput::openHash().

Referenced by generatePerlModForClass(), and generatePerlModForConcept().

◆ addListOfAllMembers()

void PerlModGenerator::addListOfAllMembers ( const ClassDef * cd)

Definition at line 1665 of file perlmodgen.cpp.

1666{
1667 m_output.openList("all_members");
1668 for (auto &mni : cd->memberNameInfoLinkedMap())
1669 {
1670 for (auto &mi : *mni)
1671 {
1672 const MemberDef *md=mi->memberDef();
1673 const ClassDef *mcd=md->getClassDef();
1674
1676 .addFieldQuotedString("name", md->name())
1678 .addFieldQuotedString("protection", getProtectionName(mi->prot()));
1679
1680 if (!mi->ambiguityResolutionScope().empty())
1681 m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope());
1682
1683 m_output.addFieldQuotedString("scope", mcd->name())
1684 .closeHash();
1685 }
1686 }
1688}
virtual const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const =0
Returns a dictionary of all members.
virtual const DString & name() const =0
virtual const ClassDef * getClassDef() const =0
virtual Specifier virtualness(int count=0) const =0
PerlModOutput & closeList()
PerlModOutput & openList(const DString &s=DString())
static const char * getVirtualnessName(Specifier virt)
static const char * getProtectionName(Protection prot)

References PerlModOutput::addFieldQuotedString(), PerlModOutput::closeHash(), PerlModOutput::closeList(), MemberDef::getClassDef(), getProtectionName(), getVirtualnessName(), m_output, ClassDef::memberNameInfoLinkedMap(), Definition::name(), PerlModOutput::openHash(), PerlModOutput::openList(), and MemberDef::virtualness().

Referenced by generatePerlModForClass().

◆ createOutputDir()

bool PerlModGenerator::createOutputDir ( Dir & perlModDir)

Definition at line 2247 of file perlmodgen.cpp.

2248{
2249 std::string outputDirectory = Config_getString(OUTPUT_DIRECTORY).str();
2250 perlModDir.setPath(outputDirectory+"/perlmod");
2251 if (!perlModDir.exists() && !perlModDir.mkdir(outputDirectory+"/perlmod"))
2252 {
2253 err("Could not create perlmod directory in {}\n",outputDirectory);
2254 return false;
2255 }
2256 return true;
2257}
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:301
void setPath(const std::string &path)
Definition dir.cpp:235
bool exists() const
Definition dir.cpp:263
#define Config_getString(name)
Definition config.h:32
#define err(fmt,...)
Definition message.h:127

References Config_getString, err, Dir::exists(), Dir::mkdir(), and Dir::setPath().

Referenced by generate().

◆ createOutputFile()

bool PerlModGenerator::createOutputFile ( std::ofstream & f,
const DString & s )

Definition at line 2236 of file perlmodgen.cpp.

2237{
2239 if (!f.is_open())
2240 {
2241 err("Cannot open file {} for writing!\n", s);
2242 return false;
2243 }
2244 return true;
2245}
std::ofstream openOutputStream(const DString &name, bool append=false)
Definition portable.cpp:681

References err, and Portable::openOutputStream().

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

◆ generate()

void PerlModGenerator::generate ( )

Definition at line 2906 of file perlmodgen.cpp.

2907{
2908 // + classes
2909 // + namespaces
2910 // + files
2911 // - packages
2912 // + groups
2913 // + related pages
2914 // - examples
2915
2916 Dir perlModDir;
2917 if (!createOutputDir(perlModDir))
2918 return;
2919
2920 bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
2921
2922 DString perlModAbsPath = perlModDir.absPath();
2923 pathDoxyDocsPM = perlModAbsPath + "/DoxyDocs.pm";
2924 pathDoxyStructurePM = perlModAbsPath + "/DoxyStructure.pm";
2925 pathMakefile = perlModAbsPath + "/Makefile";
2926 pathDoxyRules = perlModAbsPath + "/doxyrules.make";
2927
2928 if (perlmodLatex) {
2929 pathDoxyStructureTex = perlModAbsPath + "/doxystructure.tex";
2930 pathDoxyFormatTex = perlModAbsPath + "/doxyformat.tex";
2931 pathDoxyLatexTex = perlModAbsPath + "/doxylatex.tex";
2932 pathDoxyLatexDVI = perlModAbsPath + "/doxylatex.dvi";
2933 pathDoxyLatexPDF = perlModAbsPath + "/doxylatex.pdf";
2934 pathDoxyDocsTex = perlModAbsPath + "/doxydocs.tex";
2935 pathDoxyLatexPL = perlModAbsPath + "/doxylatex.pl";
2936 pathDoxyLatexStructurePL = perlModAbsPath + "/doxylatex-structure.pl";
2937 }
2938
2939 if (!(generatePerlModOutput()
2941 && generateMakefile()
2942 && generateDoxyRules()))
2943 return;
2944
2945 if (perlmodLatex) {
2950 return;
2951 }
2952}
std::string absPath() const
Definition dir.cpp:370
DString pathDoxyLatexStructurePL
DString pathDoxyStructureTex
bool generateDoxyFormatTex()
bool generateDoxyLatexTex()
bool createOutputDir(Dir &perlModDir)
bool generatePerlModOutput()
DString pathDoxyFormatTex
DString pathDoxyStructurePM
bool generateDoxyStructurePM()
bool generateDoxyLatexStructurePL()
#define Config_getBool(name)
Definition config.h:33

References Dir::absPath(), 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().

◆ generateDoxyFormatTex()

bool PerlModGenerator::generateDoxyFormatTex ( )

Definition at line 2719 of file perlmodgen.cpp.

2720{
2721 std::ofstream doxyFormatTexStream;
2722 if (!createOutputFile(doxyFormatTexStream, pathDoxyFormatTex))
2723 return false;
2724
2725 doxyFormatTexStream <<
2726 "\\def\\Defcs#1{\\long\\expandafter\\def\\csname#1\\endcsname}\n"
2727 "\\Defcs{Empty}{}\n"
2728 "\\def\\IfEmpty#1{\\expandafter\\ifx\\csname#1\\endcsname\\Empty}\n"
2729 "\n"
2730 "\\def\\StringNode#1{\\Defcs{#1}##1{##1}}\n"
2731 "\\def\\DocNode#1{\\Defcs{#1}##1{##1}}\n"
2732 "\\def\\ListNode#1{\\Defcs{#1}##1{##1}\\Defcs{#1Sep}{}}\n"
2733 "\\def\\HashNode#1{\\Defcs{#1}{}}\n"
2734 "\n"
2735 "\\input{" << pathDoxyStructureTex << "}\n"
2736 "\n"
2737 "\\newbox\\BoxA\n"
2738 "\\dimendef\\DimenA=151\\relax\n"
2739 "\\dimendef\\DimenB=152\\relax\n"
2740 "\\countdef\\ZoneDepth=151\\relax\n"
2741 "\n"
2742 "\\def\\Cs#1{\\csname#1\\endcsname}\n"
2743 "\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}\n"
2744 "\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}\n"
2745 "\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}\n"
2746 "\n"
2747 "\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax\n"
2748 "\\raggedright#1\\vskip 0.5mm\\relax} }}\n"
2749 "\n"
2750 "\\def\\Zone#1#2#3{%\n"
2751 "\\Defcs{Test#1}{#2}%\n"
2752 "\\Defcs{Emit#1}{#3}%\n"
2753 "\\Defcs{#1}{%\n"
2754 "\\advance\\ZoneDepth1\\relax\n"
2755 "\\Letcs{Mode\\number\\ZoneDepth}0\\relax\n"
2756 "\\Letcs{Present\\number\\ZoneDepth}0\\relax\n"
2757 "\\Cs{Test#1}\n"
2758 "\\expandafter\\if\\Cs{Present\\number\\ZoneDepth}1%\n"
2759 "\\advance\\ZoneDepth-1\\relax\n"
2760 "\\Letcs{Present\\number\\ZoneDepth}1\\relax\n"
2761 "\\expandafter\\if\\Cs{Mode\\number\\ZoneDepth}1%\n"
2762 "\\advance\\ZoneDepth1\\relax\n"
2763 "\\Letcs{Mode\\number\\ZoneDepth}1\\relax\n"
2764 "\\Cs{Emit#1}\n"
2765 "\\advance\\ZoneDepth-1\\relax\\fi\n"
2766 "\\advance\\ZoneDepth1\\relax\\fi\n"
2767 "\\advance\\ZoneDepth-1\\relax}}\n"
2768 "\n"
2769 "\\def\\Member#1#2{%\n"
2770 "\\Defcs{Test#1}{\\Cs{field#1Detailed}\n"
2771 "\\IfEmpty{field#1DetailedDoc}\\else\\Letcs{Present#1}1\\fi}\n"
2772 "\\Defcs{#1}{\\Letcs{Present#1}0\\relax\n"
2773 "\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1\\relax\n"
2774 "\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}\n"
2775 "\n"
2776 "\\def\\TypedefMemberList#1#2{%\n"
2777 "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n"
2778 "\\Defcs{#1Name}##1{\\textbf{##1}}%\n"
2779 "\\Defcs{#1See}##1{\\See{##1}}%\n"
2780 "%\n"
2781 "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n"
2782 "\\Member{#1}{\\Frame{typedef \\Cs{field#1Type} \\Cs{field#1Name}}%\n"
2783 "\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n"
2784 "\n"
2785 "\\def\\VariableMemberList#1#2{%\n"
2786 "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n"
2787 "\\Defcs{#1Name}##1{\\textbf{##1}}%\n"
2788 "\\Defcs{#1See}##1{\\See{##1}}%\n"
2789 "%\n"
2790 "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n"
2791 "\\Member{#1}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}}%\n"
2792 "\\Cs{field#1DetailedDoc}\\Cs{field#1See}\\vskip 5mm\\relax}}%\n"
2793 "\n"
2794 "\\def\\FunctionMemberList#1#2{%\n"
2795 "\\Defcs{#1PDParamName}##1{\\textit{##1}}%\n"
2796 "\\Defcs{#1PDParam}{\\Cs{field#1PDParamName}}%\n"
2797 "\\Defcs{#1PDParamsSep}{, }%\n"
2798 "\\Defcs{#1PDBlocksSep}{\\vskip 2mm\\relax}%\n"
2799 "%\n"
2800 "\\Defcs{#1PDBlocks}##1{%\n"
2801 "\\Heading{Parameters:}\\vskip 1.5mm\\relax\n"
2802 "\\DimenA0pt\\relax\n"
2803 "\\Defcs{#1PDBlock}{\\setbox\\BoxA\\hbox{\\Cs{field#1PDParams}}%\n"
2804 "\\ifdim\\DimenA<\\wd\\BoxA\\DimenA\\wd\\BoxA\\fi}%\n"
2805 "##1%\n"
2806 "\\advance\\DimenA3mm\\relax\n"
2807 "\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax\n"
2808 "\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax\n"
2809 "\\Cs{field#1PDParams}}\\hfill\n"
2810 "\\vtop{\\hsize\\DimenB\\relax\\Cs{field#1PDDoc}}}}%\n"
2811 "##1}\n"
2812 "\n"
2813 "\\Defcs{#1ParamName}##1{\\textit{##1}}\n"
2814 "\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}\n"
2815 "\\Defcs{#1ParamsSep}{, }\n"
2816 "\n"
2817 "\\Defcs{#1Name}##1{\\textbf{##1}}\n"
2818 "\\Defcs{#1See}##1{\\See{##1}}\n"
2819 "\\Defcs{#1Return}##1{\\Heading{Returns: }##1}\n"
2820 "\\Defcs{field#1Title}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}(\\Cs{field#1Params})}}%\n"
2821 "%\n"
2822 "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n"
2823 "\\Member{#1}{%\n"
2824 "\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}\n"
2825 "\\Cs{field#1Return}\\Cs{field#1PDBlocks}\\Cs{field#1See}\\vskip 5mm\\relax}}\n"
2826 "\n"
2827 "\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}\n"
2828 "\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}\n"
2829 "\n"
2830 "\\def\\FileSubzones{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}\n"
2831 "\n"
2832 "\\def\\ClassSubzones{%\n"
2833 "\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods\n"
2834 "\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods\n"
2835 "\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}\n"
2836 "\n"
2837 "\\Member{Page}{\\subsection{\\fieldPageName}\\fieldPageDetailedDoc}\n"
2838 "\n"
2839 "\\TypedefMemberList{FileTypedef}{Typedefs}\n"
2840 "\\VariableMemberList{FileVariable}{Variables}\n"
2841 "\\FunctionMemberList{FileFunction}{Functions}\n"
2842 "\\Zone{File}{\\FileSubzones}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\FileSubzones}\n"
2843 "\n"
2844 "\\TypedefMemberList{ClassPublicTypedef}{Public Typedefs}\n"
2845 "\\TypedefMemberList{ClassProtectedTypedef}{Protected Typedefs}\n"
2846 "\\TypedefMemberList{ClassPrivateTypedef}{Private Typedefs}\n"
2847 "\\VariableMemberList{ClassPublicMember}{Public Members}\n"
2848 "\\VariableMemberList{ClassProtectedMember}{Protected Members}\n"
2849 "\\VariableMemberList{ClassPrivateMember}{Private Members}\n"
2850 "\\FunctionMemberList{ClassPublicMethod}{Public Methods}\n"
2851 "\\FunctionMemberList{ClassProtectedMethod}{Protected Methods}\n"
2852 "\\FunctionMemberList{ClassPrivateMethod}{Private Methods}\n"
2853 "\\Zone{Class}{\\ClassSubzones}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\ClassSubzones}\n"
2854 "\n"
2855 "\\Zone{AllPages}{\\fieldPages}{\\section{Pages}\\fieldPages}\n"
2856 "\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}\n"
2857 "\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}\n"
2858 "\n"
2859 "\\newlength{\\oldparskip}\n"
2860 "\\newlength{\\oldparindent}\n"
2861 "\\newlength{\\oldfboxrule}\n"
2862 "\n"
2863 "\\ZoneDepth0\\relax\n"
2864 "\\Letcs{Mode0}1\\relax\n"
2865 "\n"
2866 "\\def\\EmitDoxyDocs{%\n"
2867 "\\setlength{\\oldparskip}{\\parskip}\n"
2868 "\\setlength{\\oldparindent}{\\parindent}\n"
2869 "\\setlength{\\oldfboxrule}{\\fboxrule}\n"
2870 "\\setlength{\\parskip}{0cm}\n"
2871 "\\setlength{\\parindent}{0cm}\n"
2872 "\\setlength{\\fboxrule}{1pt}\n"
2873 "\\AllPages\\AllFiles\\AllClasses\n"
2874 "\\setlength{\\parskip}{\\oldparskip}\n"
2875 "\\setlength{\\parindent}{\\oldparindent}\n"
2876 "\\setlength{\\fboxrule}{\\oldfboxrule}}\n";
2877
2878 return true;
2879}
bool createOutputFile(std::ofstream &f, const DString &s)

References createOutputFile(), pathDoxyFormatTex, and pathDoxyStructureTex.

Referenced by generate().

◆ generateDoxyLatexPL()

bool PerlModGenerator::generateDoxyLatexPL ( )

Definition at line 2597 of file perlmodgen.cpp.

2598{
2599 std::ofstream doxyLatexPLStream;
2600 if (!createOutputFile(doxyLatexPLStream, pathDoxyLatexPL))
2601 return false;
2602
2603 doxyLatexPLStream <<
2604 "use DoxyStructure;\n"
2605 "use DoxyDocs;\n"
2606 "\n"
2607 "sub latex_quote($) {\n"
2608 "\tmy $text = $_[0];\n"
2609 "\t$text =~ s/\\\\/\\\\textbackslash /g;\n"
2610 "\t$text =~ s/\\|/\\\\textbar /g;\n"
2611 "\t$text =~ s/</\\\\textless /g;\n"
2612 "\t$text =~ s/>/\\\\textgreater /g;\n"
2613 "\t$text =~ s/~/\\\\textasciitilde /g;\n"
2614 "\t$text =~ s/\\^/\\\\textasciicircum /g;\n"
2615 "\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n"
2616 "\tprint $text;\n"
2617 "}\n"
2618 "\n"
2619 "sub generate_doc($) {\n"
2620 "\tmy $doc = $_[0];\n"
2621 "\tfor my $item (@$doc) {\n"
2622 "\t\tmy $type = $$item{type};\n"
2623 "\t\tif ($type eq \"text\") {\n"
2624 "\t\t\tlatex_quote($$item{content});\n"
2625 "\t\t} elsif ($type eq \"parbreak\") {\n"
2626 "\t\t\tprint \"\\n\\n\";\n"
2627 "\t\t} elsif ($type eq \"style\") {\n"
2628 "\t\t\tmy $style = $$item{style};\n"
2629 "\t\t\tif ($$item{enable} eq \"yes\") {\n"
2630 "\t\t\t\tif ($style eq \"bold\") { print '\\bfseries'; }\n"
2631 "\t\t\t\tif ($style eq \"italic\") { print '\\itshape'; }\n"
2632 "\t\t\t\tif ($style eq \"code\") { print '\\ttfamily'; }\n"
2633 "\t\t\t} else {\n"
2634 "\t\t\t\tif ($style eq \"bold\") { print '\\mdseries'; }\n"
2635 "\t\t\t\tif ($style eq \"italic\") { print '\\upshape'; }\n"
2636 "\t\t\t\tif ($style eq \"code\") { print '\\rmfamily'; }\n"
2637 "\t\t\t}\n"
2638 "\t\t\tprint '{}';\n"
2639 "\t\t} elsif ($type eq \"symbol\") {\n"
2640 "\t\t\tmy $symbol = $$item{symbol};\n"
2641 "\t\t\tif ($symbol eq \"copyright\") { print '\\copyright'; }\n"
2642 "\t\t\telsif ($symbol eq \"szlig\") { print '\\ss'; }\n"
2643 "\t\t\tprint '{}';\n"
2644 "\t\t} elsif ($type eq \"accent\") {\n"
2645 "\t\t\tmy ($accent) = $$item{accent};\n"
2646 "\t\t\tif ($accent eq \"umlaut\") { print '\\\"'; }\n"
2647 "\t\t\telsif ($accent eq \"acute\") { print '\\\\\\''; }\n"
2648 "\t\t\telsif ($accent eq \"grave\") { print '\\`'; }\n"
2649 "\t\t\telsif ($accent eq \"circ\") { print '\\^'; }\n"
2650 "\t\t\telsif ($accent eq \"tilde\") { print '\\~'; }\n"
2651 "\t\t\telsif ($accent eq \"cedilla\") { print '\\c'; }\n"
2652 "\t\t\telsif ($accent eq \"ring\") { print '\\r'; }\n"
2653 "\t\t\tprint \"{\" . $$item{letter} . \"}\"; \n"
2654 "\t\t} elsif ($type eq \"list\") {\n"
2655 "\t\t\tmy $env = ($$item{style} eq \"ordered\") ? \"enumerate\" : \"itemize\";\n"
2656 "\t\t\tprint \"\\n\\\\begin{\" . $env .\"}\";\n"
2657 "\t\t \tfor my $subitem (@{$$item{content}}) {\n"
2658 "\t\t\t\tprint \"\\n\\\\item \";\n"
2659 "\t\t\t\tgenerate_doc($subitem);\n"
2660 "\t\t \t}\n"
2661 "\t\t\tprint \"\\n\\\\end{\" . $env .\"}\";\n"
2662 "\t\t} elsif ($type eq \"url\") {\n"
2663 "\t\t\tlatex_quote($$item{content});\n"
2664 "\t\t}\n"
2665 "\t}\n"
2666 "}\n"
2667 "\n"
2668 "sub generate($$) {\n"
2669 "\tmy ($item, $node) = @_;\n"
2670 "\tmy ($type, $name) = @$node[0, 1];\n"
2671 "\tif ($type eq \"string\") {\n"
2672 "\t\tprint \"\\\\\" . $name . \"{\";\n"
2673 "\t\tlatex_quote($item);\n"
2674 "\t\tprint \"}\";\n"
2675 "\t} elsif ($type eq \"doc\") {\n"
2676 "\t\tif (@$item) {\n"
2677 "\t\t\tprint \"\\\\\" . $name . \"{\";\n"
2678 "\t\t\tgenerate_doc($item);\n"
2679 "\t\t\tprint \"}%\\n\";\n"
2680 "\t\t} else {\n"
2681 "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
2682 "\t\t}\n"
2683 "\t} elsif ($type eq \"hash\") {\n"
2684 "\t\tmy ($key, $value);\n"
2685 "\t\twhile (($key, $subnode) = each %{$$node[2]}) {\n"
2686 "\t\t\tmy $subname = $$subnode[1];\n"
2687 "\t\t\tprint \"\\\\Defcs{field\" . $subname . \"}{\";\n"
2688 "\t\t\tif ($$item{$key}) {\n"
2689 "\t\t\t\tgenerate($$item{$key}, $subnode);\n"
2690 "\t\t\t} else {\n"
2691 "#\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n"
2692 "\t\t\t}\n"
2693 "\t\t\tprint \"}%\\n\";\n"
2694 "\t\t}\n"
2695 "\t\tprint \"\\\\\" . $name . \"%\\n\";\n"
2696 "\t} elsif ($type eq \"list\") {\n"
2697 "\t\tmy $index = 0;\n"
2698 "\t\tif (@$item) {\n"
2699 "\t\t\tprint \"\\\\\" . $name . \"{%\\n\";\n"
2700 "\t\t\tfor my $subitem (@$item) {\n"
2701 "\t\t\t\tif ($index) {\n"
2702 "\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n"
2703 "\t\t\t\t}\n"
2704 "\t\t\t\tgenerate($subitem, $$node[2]);\n"
2705 "\t\t\t\t$index++;\n"
2706 "\t\t\t}\n"
2707 "\t\t\tprint \"}%\\n\";\n"
2708 "\t\t} else {\n"
2709 "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
2710 "\t\t}\n"
2711 "\t}\n"
2712 "}\n"
2713 "\n"
2714 "generate($doxydocs, $doxystructure);\n";
2715
2716 return true;
2717}

References createOutputFile(), and pathDoxyLatexPL.

Referenced by generate().

◆ generateDoxyLatexStructurePL()

bool PerlModGenerator::generateDoxyLatexStructurePL ( )

Definition at line 2564 of file perlmodgen.cpp.

2565{
2566 std::ofstream doxyLatexStructurePLStream;
2567 if (!createOutputFile(doxyLatexStructurePLStream, pathDoxyLatexStructurePL))
2568 return false;
2569
2570 doxyLatexStructurePLStream <<
2571 "use DoxyStructure;\n"
2572 "\n"
2573 "sub process($) {\n"
2574 "\tmy $node = $_[0];\n"
2575 "\tmy ($type, $name) = @$node[0, 1];\n"
2576 "\tmy $command;\n"
2577 "\tif ($type eq \"string\") { $command = \"String\" }\n"
2578 "\telsif ($type eq \"doc\") { $command = \"Doc\" }\n"
2579 "\telsif ($type eq \"hash\") {\n"
2580 "\t\t$command = \"Hash\";\n"
2581 "\t\tfor my $subnode (values %{$$node[2]}) {\n"
2582 "\t\t\tprocess($subnode);\n"
2583 "\t\t}\n"
2584 "\t}\n"
2585 "\telsif ($type eq \"list\") {\n"
2586 "\t\t$command = \"List\";\n"
2587 "\t\tprocess($$node[2]);\n"
2588 "\t}\n"
2589 "\tprint \"\\\\\" . $command . \"Node{\" . $name . \"}%\\n\";\n"
2590 "}\n"
2591 "\n"
2592 "process($doxystructure);\n";
2593
2594 return true;
2595}

References createOutputFile(), and pathDoxyLatexStructurePL.

Referenced by generate().

◆ generateDoxyLatexTex()

bool PerlModGenerator::generateDoxyLatexTex ( )

Definition at line 2881 of file perlmodgen.cpp.

2882{
2883 std::ofstream doxyLatexTexStream;
2884 if (!createOutputFile(doxyLatexTexStream, pathDoxyLatexTex))
2885 return false;
2886
2887 doxyLatexTexStream <<
2888 "\\documentclass[a4paper,12pt]{article}\n"
2889 "\\usepackage[latin1]{inputenc}\n"
2890 "\\usepackage[none]{hyphenat}\n"
2891 "\\usepackage[T1]{fontenc}\n"
2892 "\\usepackage{hyperref}\n"
2893 "\\usepackage{times}\n"
2894 "\n"
2895 "\\input{doxyformat}\n"
2896 "\n"
2897 "\\begin{document}\n"
2898 "\\input{" << pathDoxyDocsTex << "}\n"
2899 "\\sloppy\n"
2900 "\\EmitDoxyDocs\n"
2901 "\\end{document}\n";
2902
2903 return true;
2904}

References createOutputFile(), pathDoxyDocsTex, and pathDoxyLatexTex.

Referenced by generate().

◆ generateDoxyRules()

bool PerlModGenerator::generateDoxyRules ( )

Definition at line 2442 of file perlmodgen.cpp.

2443{
2444 std::ofstream doxyRulesStream;
2445 if (!createOutputFile(doxyRulesStream, pathDoxyRules))
2446 return false;
2447
2448 bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
2449 DString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
2450
2451 doxyRulesStream <<
2452 prefix << "DOXY_EXEC_PATH = " << pathDoxyExec << "\n" <<
2453 prefix << "DOXYFILE = " << pathDoxyfile << "\n" <<
2454 prefix << "DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" <<
2455 prefix << "DOXYSTRUCTURE_PM = " << pathDoxyStructurePM << "\n" <<
2456 prefix << "DOXYRULES = " << pathDoxyRules << "\n";
2457 if (perlmodLatex)
2458 doxyRulesStream <<
2459 prefix << "DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" <<
2460 prefix << "DOXYLATEXSTRUCTURE_PL = " << pathDoxyLatexStructurePL << "\n" <<
2461 prefix << "DOXYSTRUCTURE_TEX = " << pathDoxyStructureTex << "\n" <<
2462 prefix << "DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" <<
2463 prefix << "DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" <<
2464 prefix << "DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" <<
2465 prefix << "DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" <<
2466 prefix << "DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n";
2467
2468 doxyRulesStream <<
2469 "\n"
2470 ".PHONY: clean-perlmod\n"
2471 "clean-perlmod::\n"
2472 "\trm -f $(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
2473 "\t$(" << prefix << "DOXYDOCS_PM)";
2474 if (perlmodLatex)
2475 doxyRulesStream <<
2476 " \\\n"
2477 "\t$(" << prefix << "DOXYLATEX_PL) \\\n"
2478 "\t$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
2479 "\t$(" << prefix << "DOXYDOCS_TEX) \\\n"
2480 "\t$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
2481 "\t$(" << prefix << "DOXYFORMAT_TEX) \\\n"
2482 "\t$(" << prefix << "DOXYLATEX_TEX) \\\n"
2483 "\t$(" << prefix << "DOXYLATEX_PDF) \\\n"
2484 "\t$(" << prefix << "DOXYLATEX_DVI) \\\n"
2485 "\t$(addprefix $(" << prefix << "DOXYLATEX_TEX:tex=),out aux log)";
2486 doxyRulesStream << "\n\n";
2487
2488 doxyRulesStream <<
2489 "$(" << prefix << "DOXYRULES) \\\n"
2490 "$(" << prefix << "DOXYMAKEFILE) \\\n"
2491 "$(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
2492 "$(" << prefix << "DOXYDOCS_PM)";
2493 if (perlmodLatex) {
2494 doxyRulesStream <<
2495 " \\\n"
2496 "$(" << prefix << "DOXYLATEX_PL) \\\n"
2497 "$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
2498 "$(" << prefix << "DOXYFORMAT_TEX) \\\n"
2499 "$(" << prefix << "DOXYLATEX_TEX)";
2500 }
2501 doxyRulesStream <<
2502 ": \\\n"
2503 "\t$(" << prefix << "DOXYFILE)\n"
2504 "\tcd $(" << prefix << "DOXY_EXEC_PATH) ; doxygen \"$<\"\n";
2505
2506 if (perlmodLatex) {
2507 doxyRulesStream <<
2508 "\n"
2509 "$(" << prefix << "DOXYDOCS_TEX): \\\n"
2510 "$(" << prefix << "DOXYLATEX_PL) \\\n"
2511 "$(" << prefix << "DOXYDOCS_PM)\n"
2512 "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
2513 "\n"
2514 "$(" << prefix << "DOXYSTRUCTURE_TEX): \\\n"
2515 "$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
2516 "$(" << prefix << "DOXYSTRUCTURE_PM)\n"
2517 "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
2518 "\n"
2519 "$(" << prefix << "DOXYLATEX_PDF) \\\n"
2520 "$(" << prefix << "DOXYLATEX_DVI): \\\n"
2521 "$(" << prefix << "DOXYLATEX_TEX) \\\n"
2522 "$(" << prefix << "DOXYFORMAT_TEX) \\\n"
2523 "$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
2524 "$(" << prefix << "DOXYDOCS_TEX)\n"
2525 "\n"
2526 "$(" << prefix << "DOXYLATEX_PDF): \\\n"
2527 "$(" << prefix << "DOXYLATEX_TEX)\n"
2528 "\tpdflatex -interaction=nonstopmode \"$<\"\n"
2529 "\n"
2530 "$(" << prefix << "DOXYLATEX_DVI): \\\n"
2531 "$(" << prefix << "DOXYLATEX_TEX)\n"
2532 "\tlatex -interaction=nonstopmode \"$<\"\n";
2533 }
2534
2535 return true;
2536}
constexpr auto prefix
Definition anchor.cpp:47
static DString pathDoxyExec
static DString pathDoxyfile

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

Referenced by generate().

◆ generateDoxyStructurePM()

bool PerlModGenerator::generateDoxyStructurePM ( )

Definition at line 2259 of file perlmodgen.cpp.

2260{
2261 std::ofstream doxyModelPMStream;
2262 if (!createOutputFile(doxyModelPMStream, pathDoxyStructurePM))
2263 return false;
2264
2265 doxyModelPMStream <<
2266 "sub memberlist($) {\n"
2267 " my $prefix = $_[0];\n"
2268 " return\n"
2269 "\t[ \"hash\", $prefix . \"s\",\n"
2270 "\t {\n"
2271 "\t members =>\n"
2272 "\t [ \"list\", $prefix . \"List\",\n"
2273 "\t\t[ \"hash\", $prefix,\n"
2274 "\t\t {\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"
2284 "\t\t\t {\n"
2285 "\t\t\t declaration_name => [ \"string\", $prefix . \"ParamName\" ],\n"
2286 "\t\t\t type => [ \"string\", $prefix . \"ParamType\" ],\n"
2287 "\t\t\t },\n"
2288 "\t\t\t],\n"
2289 "\t\t ],\n"
2290 "\t\t detailed =>\n"
2291 "\t\t [ \"hash\", $prefix . \"Detailed\",\n"
2292 "\t\t\t{\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"
2299 "\t\t\t\t{\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"
2303 "\t\t\t\t\t{\n"
2304 "\t\t\t\t\t name => [ \"string\", $prefix . \"PDParamName\" ],\n"
2305 "\t\t\t\t\t},\n"
2306 "\t\t\t\t ],\n"
2307 "\t\t\t\t ],\n"
2308 "\t\t\t\t doc => [ \"doc\", $prefix . \"PDDoc\" ],\n"
2309 "\t\t\t\t},\n"
2310 "\t\t\t ],\n"
2311 "\t\t\t ],\n"
2312 "\t\t\t},\n"
2313 "\t\t ],\n"
2314 "\t\t },\n"
2315 "\t\t],\n"
2316 "\t ],\n"
2317 "\t },\n"
2318 "\t];\n"
2319 "}\n"
2320 "\n"
2321 "$doxystructure =\n"
2322 " [ \"hash\", \"Root\",\n"
2323 " {\n"
2324 "\tfiles =>\n"
2325 "\t [ \"list\", \"Files\",\n"
2326 "\t [ \"hash\", \"File\",\n"
2327 "\t {\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"
2332 "\t\tdetailed =>\n"
2333 "\t\t [ \"hash\", \"FileDetailed\",\n"
2334 "\t\t {\n"
2335 "\t\t doc => [ \"doc\", \"FileDetailedDoc\" ],\n"
2336 "\t\t },\n"
2337 "\t\t ],\n"
2338 "\t },\n"
2339 "\t ],\n"
2340 "\t ],\n"
2341 "\tpages =>\n"
2342 "\t [ \"list\", \"Pages\",\n"
2343 "\t [ \"hash\", \"Page\",\n"
2344 "\t {\n"
2345 "\t\tname => [ \"string\", \"PageName\" ],\n"
2346 "\t\tdetailed =>\n"
2347 "\t\t [ \"hash\", \"PageDetailed\",\n"
2348 "\t\t {\n"
2349 "\t\t doc => [ \"doc\", \"PageDetailedDoc\" ],\n"
2350 "\t\t },\n"
2351 "\t\t ],\n"
2352 "\t },\n"
2353 "\t ],\n"
2354 "\t ],\n"
2355 "\tclasses =>\n"
2356 "\t [ \"list\", \"Classes\",\n"
2357 "\t [ \"hash\", \"Class\",\n"
2358 "\t {\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"
2369 "\t\tdetailed =>\n"
2370 "\t\t [ \"hash\", \"ClassDetailed\",\n"
2371 "\t\t {\n"
2372 "\t\t doc => [ \"doc\", \"ClassDetailedDoc\" ],\n"
2373 "\t\t },\n"
2374 "\t\t ],\n"
2375 "\t },\n"
2376 "\t ],\n"
2377 "\t ],\n"
2378 "\tgroups =>\n"
2379 "\t [ \"list\", \"Groups\",\n"
2380 "\t [ \"hash\", \"Group\",\n"
2381 "\t {\n"
2382 "\t\tname => [ \"string\", \"GroupName\" ],\n"
2383 "\t\ttitle => [ \"string\", \"GroupTitle\" ],\n"
2384 "\t\tfiles =>\n"
2385 "\t\t [ \"list\", \"Files\",\n"
2386 "\t\t [ \"hash\", \"File\",\n"
2387 "\t\t {\n"
2388 "\t\t name => [ \"string\", \"Filename\" ]\n"
2389 "\t\t }\n"
2390 "\t\t ],\n"
2391 "\t\t ],\n"
2392 "\t\tclasses =>\n"
2393 "\t\t [ \"list\", \"Classes\",\n"
2394 "\t\t [ \"hash\", \"Class\",\n"
2395 "\t\t {\n"
2396 "\t\t name => [ \"string\", \"Classname\" ]\n"
2397 "\t\t }\n"
2398 "\t\t ],\n"
2399 "\t\t ],\n"
2400 "\t\tnamespaces =>\n"
2401 "\t\t [ \"list\", \"Namespaces\",\n"
2402 "\t\t [ \"hash\", \"Namespace\",\n"
2403 "\t\t {\n"
2404 "\t\t name => [ \"string\", \"NamespaceName\" ]\n"
2405 "\t\t }\n"
2406 "\t\t ],\n"
2407 "\t\t ],\n"
2408 "\t\tpages =>\n"
2409 "\t\t [ \"list\", \"Pages\",\n"
2410 "\t\t [ \"hash\", \"Page\","
2411 "\t\t {\n"
2412 "\t\t title => [ \"string\", \"PageName\" ]\n"
2413 "\t\t }\n"
2414 "\t\t ],\n"
2415 "\t\t ],\n"
2416 "\t\tgroups =>\n"
2417 "\t\t [ \"list\", \"Groups\",\n"
2418 "\t\t [ \"hash\", \"Group\",\n"
2419 "\t\t {\n"
2420 "\t\t title => [ \"string\", \"GroupName\" ]\n"
2421 "\t\t }\n"
2422 "\t\t ],\n"
2423 "\t\t ],\n"
2424 "\t\tfunctions => memberlist(\"GroupFunction\"),\n"
2425 "\t\tdetailed =>\n"
2426 "\t\t [ \"hash\", \"GroupDetailed\",\n"
2427 "\t\t {\n"
2428 "\t\t doc => [ \"doc\", \"GroupDetailedDoc\" ],\n"
2429 "\t\t },\n"
2430 "\t\t ],\n"
2431 "\t }\n"
2432 "\t ],\n"
2433 "\t ],\n"
2434 " },\n"
2435 " ];\n"
2436 "\n"
2437 "1;\n";
2438
2439 return true;
2440}

References createOutputFile(), and pathDoxyStructurePM.

Referenced by generate().

◆ generateMakefile()

bool PerlModGenerator::generateMakefile ( )

Definition at line 2538 of file perlmodgen.cpp.

2539{
2540 std::ofstream makefileStream;
2541 if (!createOutputFile(makefileStream, pathMakefile))
2542 return false;
2543
2544 bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
2545 DString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
2546
2547 makefileStream <<
2548 ".PHONY: default clean" << (perlmodLatex ? " pdf" : "") << "\n"
2549 "default: " << (perlmodLatex ? "pdf" : "clean") << "\n"
2550 "\n"
2551 "include " << pathDoxyRules << "\n"
2552 "\n"
2553 "clean: clean-perlmod\n";
2554
2555 if (perlmodLatex) {
2556 makefileStream <<
2557 "pdf: $(" << prefix << "DOXYLATEX_PDF)\n"
2558 "dvi: $(" << prefix << "DOXYLATEX_DVI)\n";
2559 }
2560
2561 return true;
2562}

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

Referenced by generate().

◆ generatePerlModForClass()

void PerlModGenerator::generatePerlModForClass ( const ClassDef * cd)

Definition at line 1734 of file perlmodgen.cpp.

1735{
1736 // + brief description
1737 // + detailed description
1738 // + template argument list(s)
1739 // - include file
1740 // + member groups
1741 // + inheritance diagram
1742 // + list of direct super classes
1743 // + list of direct sub classes
1744 // + list of inner classes
1745 // + collaboration diagram
1746 // + list of all members
1747 // + user defined member sections
1748 // + standard member sections
1749 // + detailed member documentation
1750 // - examples using the class
1751
1752 if (cd->isReference()) return; // skip external references.
1753 if (cd->isAnonymous()) return; // skip anonymous compounds.
1754 if (cd->isImplicitTemplateInstance()) return; // skip generated template instances.
1755
1757 .addFieldQuotedString("name", cd->name());
1758 /* DGA: fix # #7547 Perlmod does not generate "kind" information to discriminate struct/union */
1760
1761 if (!cd->baseClasses().empty())
1762 {
1763 m_output.openList("base");
1764 for (const auto &bcd : cd->baseClasses())
1765 {
1767 .addFieldQuotedString("name", bcd.classDef->displayName())
1768 .addFieldQuotedString("virtualness", getVirtualnessName(bcd.virt))
1769 .addFieldQuotedString("protection", getProtectionName(bcd.prot))
1770 .closeHash();
1771 }
1773 }
1774
1775 if (!cd->subClasses().empty())
1776 {
1777 m_output.openList("derived");
1778 for (const auto &bcd : cd->subClasses())
1779 {
1781 .addFieldQuotedString("name", bcd.classDef->displayName())
1782 .addFieldQuotedString("virtualness", getVirtualnessName(bcd.virt))
1783 .addFieldQuotedString("protection", getProtectionName(bcd.prot))
1784 .closeHash();
1785 }
1787 }
1788
1789 {
1790 m_output.openList("inner");
1791 for (const auto &icd : cd->getClasses())
1793 .addFieldQuotedString("name", icd->name())
1794 .closeHash();
1796 }
1797
1799
1803
1804 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubTypes()),"public_typedefs");
1805 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubMethods()),"public_methods");
1806 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubAttribs()),"public_members");
1807 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubSlots()),"public_slots");
1808 generatePerlModSection(cd,cd->getMemberList(MemberListType::Signals()),"signals");
1809 generatePerlModSection(cd,cd->getMemberList(MemberListType::DcopMethods()),"dcop_methods");
1810 generatePerlModSection(cd,cd->getMemberList(MemberListType::Properties()),"properties");
1811 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubStaticMethods()),"public_static_methods");
1812 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubStaticAttribs()),"public_static_members");
1813 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProTypes()),"protected_typedefs");
1814 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProMethods()),"protected_methods");
1815 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProAttribs()),"protected_members");
1816 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProSlots()),"protected_slots");
1817 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProStaticMethods()),"protected_static_methods");
1818 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProStaticAttribs()),"protected_static_members");
1819 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriTypes()),"private_typedefs");
1820 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriMethods()),"private_methods");
1821 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriAttribs()),"private_members");
1822 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriSlots()),"private_slots");
1823 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriStaticMethods()),"private_static_methods");
1824 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriStaticAttribs()),"private_static_members");
1825 generatePerlModSection(cd,cd->getMemberList(MemberListType::Friends()),"friend_methods");
1826 generatePerlModSection(cd,cd->getMemberList(MemberListType::Related()),"related_methods");
1827
1828 addPerlModDocBlock(m_output,"brief",cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1829 addPerlModDocBlock(m_output,"detailed",cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1830
1831#if 0
1832 DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance);
1833 if (!inheritanceGraph.isTrivial())
1834 {
1835 t << " <inheritancegraph>" << endl;
1836 inheritanceGraph.writePerlMod(t);
1837 t << " </inheritancegraph>" << endl;
1838 }
1839 DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation);
1840 if (!collaborationGraph.isTrivial())
1841 {
1842 t << " <collaborationgraph>" << endl;
1843 collaborationGraph.writePerlMod(t);
1844 t << " </collaborationgraph>" << endl;
1845 }
1846 t << " <location file=\""
1847 << cd->getDefFileName() << "\" line=\""
1848 << cd->getDefLine() << "\"";
1849 if (cd->getStartBodyLine()!=-1)
1850 {
1851 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1852 << cd->getEndBodyLine() << "\"";
1853 }
1854 t << "/>" << endl;
1855#endif
1856
1858}
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual DString compoundTypeString() const =0
Returns the type of compound as a string.
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt.
virtual bool isImplicitTemplateInstance() const =0
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class.
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
virtual const IncludeInfo * includeInfo() const =0
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
virtual DString briefDescription(bool abbreviate=false) const =0
virtual int getEndBodyLine() const =0
virtual DString briefFile() const =0
virtual int docLine() const =0
virtual DString getDefFileName() const =0
virtual DString documentation() const =0
virtual int getDefLine() const =0
virtual int briefLine() const =0
virtual bool isAnonymous() const =0
virtual DString docFile() const =0
virtual int getStartBodyLine() const =0
virtual bool isReference() const =0
void generatePerlModSection(const Definition *d, MemberList *ml, const DString &name, const DString &header=DString())
void addIncludeInfo(const IncludeInfo *ii)
void addListOfAllMembers(const ClassDef *cd)
void generatePerlUserDefinedSection(const Definition *d, const MemberGroupList &mgl)
static void addTemplateList(const ClassDef *cd, PerlModOutput &output)
static void addPerlModDocBlock(PerlModOutput &output, const DString &name, const DString &fileName, int lineNr, const Definition *scope, const MemberDef *md, const DString &text)

References PerlModOutput::addFieldQuotedString(), addIncludeInfo(), addListOfAllMembers(), addPerlModDocBlock(), addTemplateList(), ClassDef::baseClasses(), Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), PerlModOutput::closeHash(), PerlModOutput::closeList(), ClassDef::compoundTypeString(), Definition::docFile(), Definition::docLine(), Definition::documentation(), generatePerlModSection(), generatePerlUserDefinedSection(), ClassDef::getClasses(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getEndBodyLine(), ClassDef::getMemberGroups(), ClassDef::getMemberList(), getProtectionName(), Definition::getStartBodyLine(), getVirtualnessName(), ClassDef::includeInfo(), Definition::isAnonymous(), ClassDef::isImplicitTemplateInstance(), Definition::isReference(), DotClassGraph::isTrivial(), m_output, Definition::name(), PerlModOutput::openHash(), PerlModOutput::openList(), and ClassDef::subClasses().

Referenced by generatePerlModOutput().

◆ generatePerlModForConcept()

void PerlModGenerator::generatePerlModForConcept ( const ConceptDef * cd)

◆ generatePerlModForFile()

void PerlModGenerator::generatePerlModForFile ( const FileDef * fd)

Definition at line 1987 of file perlmodgen.cpp.

1988{
1989 // + includes files
1990 // + includedby files
1991 // - include graph
1992 // - included by graph
1993 // - contained class definitions
1994 // - contained namespace definitions
1995 // - member groups
1996 // + normal members
1997 // + brief desc
1998 // + detailed desc
1999 // - source code
2000 // - location
2001 // - number of lines
2002
2003 if (fd->isReference()) return;
2004
2006 .addFieldQuotedString("name", fd->name());
2007
2008 m_output.openList("includes");
2009 for (const auto &inc: fd->includeFileList())
2010 {
2012 .addFieldQuotedString("name", inc.includeName);
2013 if (inc.fileDef && !inc.fileDef->isReference())
2014 {
2015 m_output.addFieldQuotedString("ref", inc.fileDef->getOutputFileBase());
2016 }
2018 }
2020
2021 m_output.openList("included_by");
2022 for (const auto &inc : fd->includedByFileList())
2023 {
2025 .addFieldQuotedString("name", inc.includeName);
2026 if (inc.fileDef && !inc.fileDef->isReference())
2027 {
2028 m_output.addFieldQuotedString("ref", inc.fileDef->getOutputFileBase());
2029 }
2031 }
2033
2035
2036 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecDefineMembers()),"defines");
2037 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecProtoMembers()),"prototypes");
2038 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
2039 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecEnumMembers()),"enums");
2040 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecFuncMembers()),"functions");
2041 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecVarMembers()),"variables");
2042
2043 addPerlModDocBlock(m_output,"brief",fd->briefFile(),fd->briefLine(),nullptr,nullptr,fd->briefDescription());
2044 addPerlModDocBlock(m_output,"detailed",fd->docFile(),fd->docLine(),nullptr,nullptr,fd->documentation());
2045
2047}
virtual const MemberGroupList & getMemberGroups() const =0
virtual const IncludeInfoList & includeFileList() const =0
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual const IncludeInfoList & includedByFileList() const =0

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), PerlModOutput::closeHash(), PerlModOutput::closeList(), Definition::docFile(), Definition::docLine(), Definition::documentation(), generatePerlModSection(), generatePerlUserDefinedSection(), FileDef::getMemberGroups(), FileDef::getMemberList(), FileDef::includedByFileList(), FileDef::includeFileList(), Definition::isReference(), m_output, Definition::name(), PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModOutput().

◆ generatePerlModForGroup()

void PerlModGenerator::generatePerlModForGroup ( const GroupDef * gd)

Definition at line 2049 of file perlmodgen.cpp.

2050{
2051 // + members
2052 // + member groups
2053 // + files
2054 // + classes
2055 // + namespaces
2056 // - packages
2057 // + pages
2058 // + child groups
2059 // - examples
2060 // + brief description
2061 // + detailed description
2062
2063 if (gd->isReference()) return; // skip external references
2064
2066 .addFieldQuotedString("name", gd->name())
2067 .addFieldQuotedString("title", gd->groupTitle());
2068
2069 if (!gd->getFiles().empty())
2070 {
2071 m_output.openList("files");
2072 for (const auto &fd : gd->getFiles())
2074 .addFieldQuotedString("name", fd->name())
2075 .closeHash();
2077 }
2078
2079 if (!gd->getClasses().empty())
2080 {
2081 m_output.openList("classes");
2082 for (const auto &cd : gd->getClasses())
2084 .addFieldQuotedString("name", cd->name())
2085 .closeHash();
2087 }
2088
2089 if (!gd->getConcepts().empty())
2090 {
2091 m_output.openList("concepts");
2092 for (const auto &cd : gd->getConcepts())
2094 .addFieldQuotedString("name", cd->name())
2095 .closeHash();
2097 }
2098
2099 if (!gd->getModules().empty())
2100 {
2101 m_output.openList("modules");
2102 for (const auto &mod : gd->getModules())
2104 .addFieldQuotedString("name", mod->name())
2105 .closeHash();
2107 }
2108
2109 if (!gd->getNamespaces().empty())
2110 {
2111 m_output.openList("namespaces");
2112 for (const auto &nd : gd->getNamespaces())
2114 .addFieldQuotedString("name", nd->name())
2115 .closeHash();
2117 }
2118
2119 if (!gd->getPages().empty())
2120 {
2121 m_output.openList("pages");
2122 for (const auto &pd : gd->getPages())
2124 .addFieldQuotedString("title", pd->title())
2125 .closeHash();
2127 }
2128
2129 if (!gd->getSubGroups().empty())
2130 {
2131 m_output.openList("groups");
2132 for (const auto &sgd : gd->getSubGroups())
2134 .addFieldQuotedString("title", sgd->groupTitle())
2135 .closeHash();
2137 }
2138
2140
2141 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecDefineMembers()),"defines");
2142 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecProtoMembers()),"prototypes");
2143 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
2144 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecEnumMembers()),"enums");
2145 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecFuncMembers()),"functions");
2146 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecVarMembers()),"variables");
2147
2148 addPerlModDocBlock(m_output,"brief",gd->briefFile(),gd->briefLine(),nullptr,nullptr,gd->briefDescription());
2149 addPerlModDocBlock(m_output,"detailed",gd->docFile(),gd->docLine(),nullptr,nullptr,gd->documentation());
2150
2152}
virtual DString groupTitle() const =0
virtual const GroupList & getSubGroups() const =0
virtual const FileList & getFiles() const =0
virtual const MemberGroupList & getMemberGroups() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const PageLinkedRefMap & getPages() const =0
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual const ModuleLinkedRefMap & getModules() const =0
bool empty() const
Definition linkedmap.h:374

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), PerlModOutput::closeHash(), PerlModOutput::closeList(), Definition::docFile(), Definition::docLine(), Definition::documentation(), LinkedRefMap< T, Hash, KeyEqual, Map >::empty(), generatePerlModSection(), generatePerlUserDefinedSection(), GroupDef::getClasses(), GroupDef::getConcepts(), GroupDef::getFiles(), GroupDef::getMemberGroups(), GroupDef::getMemberList(), GroupDef::getModules(), GroupDef::getNamespaces(), GroupDef::getPages(), GroupDef::getSubGroups(), GroupDef::groupTitle(), Definition::isReference(), m_output, Definition::name(), PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModOutput().

◆ generatePerlModForMember()

void PerlModGenerator::generatePerlModForMember ( const MemberDef * md,
const Definition *  )

Definition at line 1489 of file perlmodgen.cpp.

1490{
1491 // + declaration/definition arg lists
1492 // + reimplements
1493 // + reimplementedBy
1494 // + exceptions
1495 // + const/volatile specifiers
1496 // - examples
1497 // - source definition
1498 // - source references
1499 // - source referenced by
1500 // - body code
1501 // - template arguments
1502 // (templateArguments(), definitionTemplateParameterLists())
1503
1504 DString memType = to_string_lower(md->memberType());
1505 DString name;
1506 bool isFunc=to_isFunction(md->memberType());
1507
1508 bool isFortran = md->getLanguage()==SrcLangExt::Fortran;
1509 name = md->name();
1510 if (md->isAnonymous()) name = "__unnamed" + name.mid(1)+"__";
1511
1513 .addFieldQuotedString("kind", memType)
1514 .addFieldQuotedString("name", name)
1517 .addFieldBoolean("static", md->isStatic());
1518
1520 addPerlModDocBlock(m_output,"detailed",md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
1521 if (md->memberType()!=MemberType::Define &&
1522 md->memberType()!=MemberType::Enumeration)
1524
1525 const ArgumentList &al = md->argumentList();
1526 if (isFunc) //function
1527 {
1529 .addFieldBoolean("volatile", al.volatileSpecifier());
1530
1531 m_output.openList("parameters");
1532 const ArgumentList &declAl = md->declArgumentList();
1533 if (!declAl.empty())
1534 {
1535 auto defIt = al.begin();
1536 for (const Argument &a : declAl)
1537 {
1538 const Argument *defArg = nullptr;
1539 if (defIt!=al.end())
1540 {
1541 defArg = &(*defIt);
1542 ++defIt;
1543 }
1545
1546 if (!a.name.empty())
1547 m_output.addFieldQuotedString("declaration_name", a.name);
1548
1549 if (defArg && !defArg->name.empty() && defArg->name!=a.name)
1550 m_output.addFieldQuotedString("definition_name", defArg->name);
1551
1552 if (isFortran && defArg && !defArg->type.empty())
1553 m_output.addFieldQuotedString("type", defArg->type);
1554 else if (!a.type.empty())
1555 m_output.addFieldQuotedString("type", a.type);
1556
1557 if (!a.array.empty())
1558 m_output.addFieldQuotedString("array", a.array);
1559
1560 if (!a.defval.empty())
1561 m_output.addFieldQuotedString("default_value", a.defval);
1562
1563 if (!a.attrib.empty())
1564 m_output.addFieldQuotedString("attributes", a.attrib);
1565
1567 }
1568 }
1570 }
1571 else if (md->memberType()==MemberType::Define &&
1572 md->argsString()!=nullptr) // define
1573 {
1574 m_output.openList("parameters");
1575 for (const Argument &a : al)
1576 {
1578 .addFieldQuotedString("name", a.type)
1579 .closeHash();
1580 }
1582 }
1583 else if (md->argsString()!=nullptr)
1584 {
1585 m_output.addFieldQuotedString("arguments", md->argsString());
1586 }
1587
1588 if (!md->initializer().empty())
1589 m_output.addFieldQuotedString("initializer", md->initializer());
1590
1591 if (!md->excpString().empty())
1592 m_output.addFieldQuotedString("exceptions", md->excpString());
1593
1594 if (md->memberType()==MemberType::Enumeration) // enum
1595 {
1596 const MemberVector &enumFields = md->enumFieldList();
1598 if (!enumFields.empty())
1599 {
1600 m_output.openList("values");
1601 for (const auto &emd : enumFields)
1602 {
1604 .addFieldQuotedString("name", emd->name());
1605
1606 if (!emd->initializer().empty())
1607 m_output.addFieldQuotedString("initializer", emd->initializer());
1608
1609 addPerlModDocBlock(m_output,"brief",emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
1610
1611 addPerlModDocBlock(m_output,"detailed",emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
1612
1614 }
1616 }
1617 }
1618
1619 if (md->memberType() == MemberType::Variable && !md->bitfieldString().empty())
1620 {
1621 DString bitfield = md->bitfieldString();
1622 if (bitfield.at(0) == ':') bitfield = bitfield.mid(1);
1623 m_output.addFieldQuotedString("bitfield", bitfield);
1624 }
1625
1626 const MemberDef *rmd = md->reimplements();
1627 if (rmd)
1628 m_output.openHash("reimplements")
1629 .addFieldQuotedString("name", rmd->name())
1630 .closeHash();
1631
1632 const MemberVector &rbml = md->reimplementedBy();
1633 if (!rbml.empty())
1634 {
1635 m_output.openList("reimplemented_by");
1636 for (const auto &rbmd : rbml)
1638 .addFieldQuotedString("name", rbmd->name())
1639 .closeHash();
1641 }
1642
1644}
DString name
Definition arguments.h:45
DString type
Definition arguments.h:43
iterator end()
Definition arguments.h:95
bool constSpecifier() const
Definition arguments.h:112
bool empty() const
Definition arguments.h:100
iterator begin()
Definition arguments.h:94
bool volatileSpecifier() const
Definition arguments.h:113
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:318
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:686
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual Definition * getOuterScope() const =0
virtual DString argsString() const =0
virtual DString excpString() const =0
virtual const DString & initializer() const =0
virtual const MemberVector & enumFieldList() const =0
virtual const ArgumentList & argumentList() const =0
virtual const MemberVector & reimplementedBy() const =0
virtual DString bitfieldString() const =0
virtual bool isStatic() const =0
virtual const MemberDef * reimplements() const =0
virtual Protection protection() const =0
virtual MemberType memberType() const =0
virtual DString enumBaseType() const =0
virtual DString typeString() const =0
virtual const ArgumentList & declArgumentList() const =0
bool empty() const noexcept
Definition memberlist.h:61

References PerlModOutput::addFieldBoolean(), PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), MemberDef::argsString(), MemberDef::argumentList(), DString::at(), ArgumentList::begin(), MemberDef::bitfieldString(), Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), PerlModOutput::closeHash(), PerlModOutput::closeList(), ArgumentList::constSpecifier(), MemberDef::declArgumentList(), Definition::docFile(), Definition::docLine(), Definition::documentation(), ArgumentList::empty(), DString::empty(), MemberVector::empty(), ArgumentList::end(), MemberDef::enumBaseType(), MemberDef::enumFieldList(), MemberDef::excpString(), Definition::getLanguage(), Definition::getOuterScope(), getProtectionName(), getVirtualnessName(), MemberDef::initializer(), Definition::isAnonymous(), MemberDef::isStatic(), m_output, MemberDef::memberType(), DString::mid(), 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(), and generatePerlUserDefinedSection().

◆ generatePerlModForModule()

void PerlModGenerator::generatePerlModForModule ( const ModuleDef * mod)

Definition at line 1876 of file perlmodgen.cpp.

1877{
1878 // + contained class definitions
1879 // + contained concept definitions
1880 // + member groups
1881 // + normal members
1882 // + brief desc
1883 // + detailed desc
1884 // + location (file_id, line, column)
1885 // - exports
1886 // + used files
1887
1888 if (mod->isReference()) return; // skip external references
1889
1891 .addFieldQuotedString("name", mod->name());
1892
1894
1895 if (!mod->getClasses().empty())
1896 {
1897 m_output.openList("classes");
1898 for (const auto &cd : mod->getClasses())
1900 .addFieldQuotedString("name", cd->name())
1901 .closeHash();
1903 }
1904
1905 if (!mod->getConcepts().empty())
1906 {
1907 m_output.openList("concepts");
1908 for (const auto &cd : mod->getConcepts())
1910 .addFieldQuotedString("name", cd->name())
1911 .closeHash();
1913 }
1914
1915 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
1916 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecEnumMembers()),"enums");
1917 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecFuncMembers()),"functions");
1918 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecVarMembers()),"variables");
1919
1920 addPerlModDocBlock(m_output,"brief",mod->briefFile(),mod->briefLine(),nullptr,nullptr,mod->briefDescription());
1921 addPerlModDocBlock(m_output,"detailed",mod->docFile(),mod->docLine(),nullptr,nullptr,mod->documentation());
1922
1923 if (!mod->getUsedFiles().empty())
1924 {
1925 m_output.openList("files");
1926 for (const auto &fd : mod->getUsedFiles())
1928 .addFieldQuotedString("name", fd->name())
1929 .closeHash();
1931 }
1932
1934}
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual const MemberGroupList & getMemberGroups() const =0
virtual FileList getUsedFiles() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const ClassLinkedRefMap & getClasses() const =0

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), PerlModOutput::closeHash(), PerlModOutput::closeList(), Definition::docFile(), Definition::docLine(), Definition::documentation(), LinkedRefMap< T, Hash, KeyEqual, Map >::empty(), generatePerlModSection(), generatePerlUserDefinedSection(), ModuleDef::getClasses(), ModuleDef::getConcepts(), ModuleDef::getMemberGroups(), ModuleDef::getMemberList(), ModuleDef::getUsedFiles(), Definition::isReference(), m_output, Definition::name(), PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModOutput().

◆ generatePerlModForNamespace()

void PerlModGenerator::generatePerlModForNamespace ( const NamespaceDef * nd)

Definition at line 1936 of file perlmodgen.cpp.

1937{
1938 // + contained class definitions
1939 // + contained namespace definitions
1940 // + member groups
1941 // + normal members
1942 // + brief desc
1943 // + detailed desc
1944 // + location
1945 // - files containing (parts of) the namespace definition
1946
1947 if (nd->isReference()) return; // skip external references
1948
1950 .addFieldQuotedString("name", nd->name());
1951
1952 if (!nd->getClasses().empty())
1953 {
1954 m_output.openList("classes");
1955 for (const auto &cd : nd->getClasses())
1957 .addFieldQuotedString("name", cd->name())
1958 .closeHash();
1960 }
1961
1962 if (!nd->getNamespaces().empty())
1963 {
1964 m_output.openList("namespaces");
1965 for (const auto &ind : nd->getNamespaces())
1967 .addFieldQuotedString("name", ind->name())
1968 .closeHash();
1970 }
1971
1973
1974 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecDefineMembers()),"defines");
1975 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecProtoMembers()),"prototypes");
1976 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
1977 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecEnumMembers()),"enums");
1978 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecFuncMembers()),"functions");
1979 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecVarMembers()),"variables");
1980
1981 addPerlModDocBlock(m_output,"brief",nd->briefFile(),nd->briefLine(),nullptr,nullptr,nd->briefDescription());
1982 addPerlModDocBlock(m_output,"detailed",nd->docFile(),nd->docLine(),nullptr,nullptr,nd->documentation());
1983
1985}
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual NamespaceLinkedRefMap getNamespaces() const =0
virtual ClassLinkedRefMap getClasses() const =0
virtual const MemberGroupList & getMemberGroups() const =0

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), PerlModOutput::closeHash(), PerlModOutput::closeList(), Definition::docFile(), Definition::docLine(), Definition::documentation(), LinkedRefMap< T, Hash, KeyEqual, Map >::empty(), generatePerlModSection(), generatePerlUserDefinedSection(), NamespaceDef::getClasses(), NamespaceDef::getMemberGroups(), NamespaceDef::getMemberList(), NamespaceDef::getNamespaces(), Definition::isReference(), m_output, Definition::name(), PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModOutput().

◆ generatePerlModForPage()

void PerlModGenerator::generatePerlModForPage ( PageDef * pi)

Definition at line 2154 of file perlmodgen.cpp.

2155{
2156 // + name
2157 // + title
2158 // + documentation
2159
2160 if (pd->isReference()) return;
2161
2163 .addFieldQuotedString("name", pd->name());
2164
2165 const SectionInfo *si = SectionManager::instance().find(pd->name());
2166 if (si)
2168
2169 addPerlModDocBlock(m_output,"detailed",pd->docFile(),pd->docLine(),nullptr,nullptr,pd->documentation());
2171}
const T * find(const std::string &key) const
Definition linkedmap.h:47
DString title() const
Definition section.h:70
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
DString filterTitle(const DString &title)
Definition util.cpp:4454

References PerlModOutput::addFieldQuotedString(), addPerlModDocBlock(), PerlModOutput::closeHash(), Definition::docFile(), Definition::docLine(), Definition::documentation(), filterTitle(), LinkedMap< T, Hash, KeyEqual, Map >::find(), SectionManager::instance(), Definition::isReference(), m_output, Definition::name(), PerlModOutput::openHash(), and SectionInfo::title().

Referenced by generatePerlModOutput().

◆ generatePerlModOutput()

bool PerlModGenerator::generatePerlModOutput ( )

Definition at line 2173 of file perlmodgen.cpp.

2174{
2175 std::ofstream outputFileStream;
2176 if (!createOutputFile(outputFileStream, pathDoxyDocsPM))
2177 return false;
2178
2179 PerlModOutputStream outputStream(outputFileStream);
2180 m_output.setPerlModOutputStream(&outputStream);
2181 m_output.add("$doxydocs=").openHash();
2182
2183 m_output.openList("classes");
2184 for (const auto &cd : *Doxygen::classLinkedMap)
2185 generatePerlModForClass(cd.get());
2187
2188 m_output.openList("concepts");
2189 for (const auto &cd : *Doxygen::conceptLinkedMap)
2190 generatePerlModForConcept(cd.get());
2192
2193 m_output.openList("modules");
2194 for (const auto &mod : ModuleManager::instance().modules())
2195 generatePerlModForModule(mod.get());
2197
2198 m_output.openList("namespaces");
2199 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2202
2203 m_output.openList("files");
2204 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2205 {
2206 for (const auto &fd : *fn)
2207 {
2208 generatePerlModForFile(fd.get());
2209 }
2210 }
2212
2213 m_output.openList("groups");
2214 for (const auto &gd : *Doxygen::groupLinkedMap)
2215 {
2216 generatePerlModForGroup(gd.get());
2217 }
2219
2220 m_output.openList("pages");
2221 for (const auto &pd : *Doxygen::pageLinkedMap)
2222 {
2223 generatePerlModForPage(pd.get());
2224 }
2226 {
2228 }
2230
2231 m_output.closeHash().add(";\n1;\n");
2232 m_output.reset();
2233 return true;
2234}
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:108
static ConceptLinkedMap * conceptLinkedMap
Definition doxygen.h:90
static std::unique_ptr< PageDef > mainPage
Definition doxygen.h:93
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:97
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:88
static PageLinkedMap * pageLinkedMap
Definition doxygen.h:92
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:107
static ModuleManager & instance()
void generatePerlModForPage(PageDef *pi)
void generatePerlModForClass(const ClassDef *cd)
void generatePerlModForModule(const ModuleDef *mod)
void generatePerlModForNamespace(const NamespaceDef *nd)
void generatePerlModForGroup(const GroupDef *gd)
void generatePerlModForFile(const FileDef *fd)
void generatePerlModForConcept(const ConceptDef *cd)
PerlModOutput & add(char c)
void setPerlModOutputStream(PerlModOutputStream *os)

References PerlModOutput::add(), Doxygen::classLinkedMap, PerlModOutput::closeHash(), PerlModOutput::closeList(), Doxygen::conceptLinkedMap, createOutputFile(), generatePerlModForClass(), generatePerlModForConcept(), generatePerlModForFile(), generatePerlModForGroup(), generatePerlModForModule(), generatePerlModForNamespace(), generatePerlModForPage(), Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, ModuleManager::instance(), m_output, Doxygen::mainPage, Doxygen::namespaceLinkedMap, PerlModOutput::openHash(), PerlModOutput::openList(), Doxygen::pageLinkedMap, pathDoxyDocsPM, PerlModOutput::reset(), and PerlModOutput::setPerlModOutputStream().

Referenced by generate().

◆ generatePerlModSection()

void PerlModGenerator::generatePerlModSection ( const Definition * d,
MemberList * ml,
const DString & name,
const DString & header = DString() )

Definition at line 1646 of file perlmodgen.cpp.

1648{
1649 if (ml==nullptr) return; // empty list
1650
1651 m_output.openHash(name);
1652
1653 if (!header.empty())
1654 m_output.addFieldQuotedString("header", header);
1655
1656 m_output.openList("members");
1657 for (const auto &md : *ml)
1658 {
1660 }
1662 .closeHash();
1663}
void generatePerlModForMember(const MemberDef *md, const Definition *)

References PerlModOutput::addFieldQuotedString(), PerlModOutput::closeHash(), PerlModOutput::closeList(), DString::empty(), generatePerlModForMember(), m_output, PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModForClass(), generatePerlModForFile(), generatePerlModForGroup(), generatePerlModForModule(), and generatePerlModForNamespace().

◆ generatePerlUserDefinedSection()

void PerlModGenerator::generatePerlUserDefinedSection ( const Definition * d,
const MemberGroupList & mgl )

Definition at line 1690 of file perlmodgen.cpp.

1691{
1692 if (!mgl.empty())
1693 {
1694 m_output.openList("user_defined");
1695 for (const auto &mg : mgl)
1696 {
1698 if (!mg->header().empty())
1699 {
1700 m_output.addFieldQuotedString("header", mg->header());
1701 }
1702
1703 if (!mg->members().empty())
1704 {
1705 m_output.openList("members");
1706 for (const auto &md : mg->members())
1707 {
1709 }
1711 }
1713 }
1715 }
1716}

References PerlModOutput::addFieldQuotedString(), PerlModOutput::closeHash(), PerlModOutput::closeList(), generatePerlModForMember(), m_output, PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by generatePerlModForClass(), generatePerlModForFile(), generatePerlModForGroup(), generatePerlModForModule(), and generatePerlModForNamespace().

Member Data Documentation

◆ m_output

◆ pathDoxyDocsPM

DString PerlModGenerator::pathDoxyDocsPM

Definition at line 1453 of file perlmodgen.cpp.

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

◆ pathDoxyDocsTex

DString PerlModGenerator::pathDoxyDocsTex

Definition at line 1447 of file perlmodgen.cpp.

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

◆ pathDoxyFormatTex

DString PerlModGenerator::pathDoxyFormatTex

Definition at line 1448 of file perlmodgen.cpp.

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

◆ pathDoxyLatexDVI

DString PerlModGenerator::pathDoxyLatexDVI

Definition at line 1450 of file perlmodgen.cpp.

Referenced by generate(), and generateDoxyRules().

◆ pathDoxyLatexPDF

DString PerlModGenerator::pathDoxyLatexPDF

Definition at line 1451 of file perlmodgen.cpp.

Referenced by generate(), and generateDoxyRules().

◆ pathDoxyLatexPL

DString PerlModGenerator::pathDoxyLatexPL

Definition at line 1454 of file perlmodgen.cpp.

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

◆ pathDoxyLatexStructurePL

DString PerlModGenerator::pathDoxyLatexStructurePL

Definition at line 1455 of file perlmodgen.cpp.

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

◆ pathDoxyLatexTex

DString PerlModGenerator::pathDoxyLatexTex

Definition at line 1449 of file perlmodgen.cpp.

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

◆ pathDoxyRules

DString PerlModGenerator::pathDoxyRules

Definition at line 1456 of file perlmodgen.cpp.

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

◆ pathDoxyStructurePM

DString PerlModGenerator::pathDoxyStructurePM

Definition at line 1446 of file perlmodgen.cpp.

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

◆ pathDoxyStructureTex

DString PerlModGenerator::pathDoxyStructureTex

Definition at line 1452 of file perlmodgen.cpp.

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

◆ pathMakefile

DString PerlModGenerator::pathMakefile

Definition at line 1457 of file perlmodgen.cpp.

Referenced by generate(), and generateMakefile().


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