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 1454 of file perlmodgen.cpp.

Constructor & Destructor Documentation

◆ PerlModGenerator()

PerlModGenerator::PerlModGenerator ( bool pretty)
inline

Definition at line 1473 of file perlmodgen.cpp.

1473: m_output(pretty) { }
PerlModOutput m_output

References m_output.

Member Function Documentation

◆ addIncludeInfo()

void PerlModGenerator::addIncludeInfo ( const IncludeInfo * ii)

Definition at line 1745 of file perlmodgen.cpp.

1746{
1747 if (ii)
1748 {
1749 DString nm = ii->includeName;
1750 if (nm.empty() && ii->fileDef) nm = ii->fileDef->docName();
1751 if (!nm.empty())
1752 {
1753 m_output.openHash("includes");
1755 .addFieldQuotedString("name", nm)
1756 .closeHash();
1757 }
1758 }
1759}
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 1692 of file perlmodgen.cpp.

1693{
1694 m_output.openList("all_members");
1695 for (auto &mni : cd->memberNameInfoLinkedMap())
1696 {
1697 for (auto &mi : *mni)
1698 {
1699 const MemberDef *md=mi->memberDef();
1700 const ClassDef *mcd=md->getClassDef();
1701
1703 .addFieldQuotedString("name", md->name())
1705 .addFieldQuotedString("protection", getProtectionName(mi->prot()));
1706
1707 if (!mi->ambiguityResolutionScope().empty())
1708 m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope());
1709
1710 m_output.addFieldQuotedString("scope", mcd->name())
1711 .closeHash();
1712 }
1713 }
1715}
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 2278 of file perlmodgen.cpp.

2279{
2280 std::string outputDirectory = Config_getString(OUTPUT_DIRECTORY).str();
2281 perlModDir.setPath(outputDirectory+"/perlmod");
2282 if (!perlModDir.exists() && !perlModDir.mkdir(outputDirectory+"/perlmod"))
2283 {
2284 err("Could not create perlmod directory in {}\n",outputDirectory);
2285 return false;
2286 }
2287 return true;
2288}
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:300
void setPath(const std::string &path)
Definition dir.cpp:234
bool exists() const
Definition dir.cpp:262
#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 2267 of file perlmodgen.cpp.

2268{
2270 if (!f.is_open())
2271 {
2272 err("Cannot open file {} for writing!\n", s);
2273 return false;
2274 }
2275 return true;
2276}
std::ofstream openOutputStream(const DString &name, bool append=false)
Definition portable.cpp:679

References err, and Portable::openOutputStream().

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

◆ generate()

void PerlModGenerator::generate ( )

Definition at line 2937 of file perlmodgen.cpp.

2938{
2939 // + classes
2940 // + namespaces
2941 // + files
2942 // - packages
2943 // + groups
2944 // + related pages
2945 // - examples
2946
2947 Dir perlModDir;
2948 if (!createOutputDir(perlModDir))
2949 return;
2950
2951 bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
2952
2953 DString perlModAbsPath = perlModDir.absPath();
2954 pathDoxyDocsPM = perlModAbsPath + "/DoxyDocs.pm";
2955 pathDoxyStructurePM = perlModAbsPath + "/DoxyStructure.pm";
2956 pathMakefile = perlModAbsPath + "/Makefile";
2957 pathDoxyRules = perlModAbsPath + "/doxyrules.make";
2958
2959 if (perlmodLatex) {
2960 pathDoxyStructureTex = perlModAbsPath + "/doxystructure.tex";
2961 pathDoxyFormatTex = perlModAbsPath + "/doxyformat.tex";
2962 pathDoxyLatexTex = perlModAbsPath + "/doxylatex.tex";
2963 pathDoxyLatexDVI = perlModAbsPath + "/doxylatex.dvi";
2964 pathDoxyLatexPDF = perlModAbsPath + "/doxylatex.pdf";
2965 pathDoxyDocsTex = perlModAbsPath + "/doxydocs.tex";
2966 pathDoxyLatexPL = perlModAbsPath + "/doxylatex.pl";
2967 pathDoxyLatexStructurePL = perlModAbsPath + "/doxylatex-structure.pl";
2968 }
2969
2970 if (!(generatePerlModOutput()
2972 && generateMakefile()
2973 && generateDoxyRules()))
2974 return;
2975
2976 if (perlmodLatex) {
2981 return;
2982 }
2983}
std::string absPath() const
Definition dir.cpp:369
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 2750 of file perlmodgen.cpp.

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

References createOutputFile(), pathDoxyFormatTex, and pathDoxyStructureTex.

Referenced by generate().

◆ generateDoxyLatexPL()

bool PerlModGenerator::generateDoxyLatexPL ( )

Definition at line 2628 of file perlmodgen.cpp.

2629{
2630 std::ofstream doxyLatexPLStream;
2631 if (!createOutputFile(doxyLatexPLStream, pathDoxyLatexPL))
2632 return false;
2633
2634 doxyLatexPLStream <<
2635 "use DoxyStructure;\n"
2636 "use DoxyDocs;\n"
2637 "\n"
2638 "sub latex_quote($) {\n"
2639 "\tmy $text = $_[0];\n"
2640 "\t$text =~ s/\\\\/\\\\textbackslash /g;\n"
2641 "\t$text =~ s/\\|/\\\\textbar /g;\n"
2642 "\t$text =~ s/</\\\\textless /g;\n"
2643 "\t$text =~ s/>/\\\\textgreater /g;\n"
2644 "\t$text =~ s/~/\\\\textasciitilde /g;\n"
2645 "\t$text =~ s/\\^/\\\\textasciicircum /g;\n"
2646 "\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n"
2647 "\tprint $text;\n"
2648 "}\n"
2649 "\n"
2650 "sub generate_doc($) {\n"
2651 "\tmy $doc = $_[0];\n"
2652 "\tfor my $item (@$doc) {\n"
2653 "\t\tmy $type = $$item{type};\n"
2654 "\t\tif ($type eq \"text\") {\n"
2655 "\t\t\tlatex_quote($$item{content});\n"
2656 "\t\t} elsif ($type eq \"parbreak\") {\n"
2657 "\t\t\tprint \"\\n\\n\";\n"
2658 "\t\t} elsif ($type eq \"style\") {\n"
2659 "\t\t\tmy $style = $$item{style};\n"
2660 "\t\t\tif ($$item{enable} eq \"yes\") {\n"
2661 "\t\t\t\tif ($style eq \"bold\") { print '\\bfseries'; }\n"
2662 "\t\t\t\tif ($style eq \"italic\") { print '\\itshape'; }\n"
2663 "\t\t\t\tif ($style eq \"code\") { print '\\ttfamily'; }\n"
2664 "\t\t\t} else {\n"
2665 "\t\t\t\tif ($style eq \"bold\") { print '\\mdseries'; }\n"
2666 "\t\t\t\tif ($style eq \"italic\") { print '\\upshape'; }\n"
2667 "\t\t\t\tif ($style eq \"code\") { print '\\rmfamily'; }\n"
2668 "\t\t\t}\n"
2669 "\t\t\tprint '{}';\n"
2670 "\t\t} elsif ($type eq \"symbol\") {\n"
2671 "\t\t\tmy $symbol = $$item{symbol};\n"
2672 "\t\t\tif ($symbol eq \"copyright\") { print '\\copyright'; }\n"
2673 "\t\t\telsif ($symbol eq \"szlig\") { print '\\ss'; }\n"
2674 "\t\t\tprint '{}';\n"
2675 "\t\t} elsif ($type eq \"accent\") {\n"
2676 "\t\t\tmy ($accent) = $$item{accent};\n"
2677 "\t\t\tif ($accent eq \"umlaut\") { print '\\\"'; }\n"
2678 "\t\t\telsif ($accent eq \"acute\") { print '\\\\\\''; }\n"
2679 "\t\t\telsif ($accent eq \"grave\") { print '\\`'; }\n"
2680 "\t\t\telsif ($accent eq \"circ\") { print '\\^'; }\n"
2681 "\t\t\telsif ($accent eq \"tilde\") { print '\\~'; }\n"
2682 "\t\t\telsif ($accent eq \"cedilla\") { print '\\c'; }\n"
2683 "\t\t\telsif ($accent eq \"ring\") { print '\\r'; }\n"
2684 "\t\t\tprint \"{\" . $$item{letter} . \"}\"; \n"
2685 "\t\t} elsif ($type eq \"list\") {\n"
2686 "\t\t\tmy $env = ($$item{style} eq \"ordered\") ? \"enumerate\" : \"itemize\";\n"
2687 "\t\t\tprint \"\\n\\\\begin{\" . $env .\"}\";\n"
2688 "\t\t \tfor my $subitem (@{$$item{content}}) {\n"
2689 "\t\t\t\tprint \"\\n\\\\item \";\n"
2690 "\t\t\t\tgenerate_doc($subitem);\n"
2691 "\t\t \t}\n"
2692 "\t\t\tprint \"\\n\\\\end{\" . $env .\"}\";\n"
2693 "\t\t} elsif ($type eq \"url\") {\n"
2694 "\t\t\tlatex_quote($$item{content});\n"
2695 "\t\t}\n"
2696 "\t}\n"
2697 "}\n"
2698 "\n"
2699 "sub generate($$) {\n"
2700 "\tmy ($item, $node) = @_;\n"
2701 "\tmy ($type, $name) = @$node[0, 1];\n"
2702 "\tif ($type eq \"string\") {\n"
2703 "\t\tprint \"\\\\\" . $name . \"{\";\n"
2704 "\t\tlatex_quote($item);\n"
2705 "\t\tprint \"}\";\n"
2706 "\t} elsif ($type eq \"doc\") {\n"
2707 "\t\tif (@$item) {\n"
2708 "\t\t\tprint \"\\\\\" . $name . \"{\";\n"
2709 "\t\t\tgenerate_doc($item);\n"
2710 "\t\t\tprint \"}%\\n\";\n"
2711 "\t\t} else {\n"
2712 "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
2713 "\t\t}\n"
2714 "\t} elsif ($type eq \"hash\") {\n"
2715 "\t\tmy ($key, $value);\n"
2716 "\t\twhile (($key, $subnode) = each %{$$node[2]}) {\n"
2717 "\t\t\tmy $subname = $$subnode[1];\n"
2718 "\t\t\tprint \"\\\\Defcs{field\" . $subname . \"}{\";\n"
2719 "\t\t\tif ($$item{$key}) {\n"
2720 "\t\t\t\tgenerate($$item{$key}, $subnode);\n"
2721 "\t\t\t} else {\n"
2722 "#\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n"
2723 "\t\t\t}\n"
2724 "\t\t\tprint \"}%\\n\";\n"
2725 "\t\t}\n"
2726 "\t\tprint \"\\\\\" . $name . \"%\\n\";\n"
2727 "\t} elsif ($type eq \"list\") {\n"
2728 "\t\tmy $index = 0;\n"
2729 "\t\tif (@$item) {\n"
2730 "\t\t\tprint \"\\\\\" . $name . \"{%\\n\";\n"
2731 "\t\t\tfor my $subitem (@$item) {\n"
2732 "\t\t\t\tif ($index) {\n"
2733 "\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n"
2734 "\t\t\t\t}\n"
2735 "\t\t\t\tgenerate($subitem, $$node[2]);\n"
2736 "\t\t\t\t$index++;\n"
2737 "\t\t\t}\n"
2738 "\t\t\tprint \"}%\\n\";\n"
2739 "\t\t} else {\n"
2740 "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
2741 "\t\t}\n"
2742 "\t}\n"
2743 "}\n"
2744 "\n"
2745 "generate($doxydocs, $doxystructure);\n";
2746
2747 return true;
2748}

References createOutputFile(), and pathDoxyLatexPL.

Referenced by generate().

◆ generateDoxyLatexStructurePL()

bool PerlModGenerator::generateDoxyLatexStructurePL ( )

Definition at line 2595 of file perlmodgen.cpp.

2596{
2597 std::ofstream doxyLatexStructurePLStream;
2598 if (!createOutputFile(doxyLatexStructurePLStream, pathDoxyLatexStructurePL))
2599 return false;
2600
2601 doxyLatexStructurePLStream <<
2602 "use DoxyStructure;\n"
2603 "\n"
2604 "sub process($) {\n"
2605 "\tmy $node = $_[0];\n"
2606 "\tmy ($type, $name) = @$node[0, 1];\n"
2607 "\tmy $command;\n"
2608 "\tif ($type eq \"string\") { $command = \"String\" }\n"
2609 "\telsif ($type eq \"doc\") { $command = \"Doc\" }\n"
2610 "\telsif ($type eq \"hash\") {\n"
2611 "\t\t$command = \"Hash\";\n"
2612 "\t\tfor my $subnode (values %{$$node[2]}) {\n"
2613 "\t\t\tprocess($subnode);\n"
2614 "\t\t}\n"
2615 "\t}\n"
2616 "\telsif ($type eq \"list\") {\n"
2617 "\t\t$command = \"List\";\n"
2618 "\t\tprocess($$node[2]);\n"
2619 "\t}\n"
2620 "\tprint \"\\\\\" . $command . \"Node{\" . $name . \"}%\\n\";\n"
2621 "}\n"
2622 "\n"
2623 "process($doxystructure);\n";
2624
2625 return true;
2626}

References createOutputFile(), and pathDoxyLatexStructurePL.

Referenced by generate().

◆ generateDoxyLatexTex()

bool PerlModGenerator::generateDoxyLatexTex ( )

Definition at line 2912 of file perlmodgen.cpp.

2913{
2914 std::ofstream doxyLatexTexStream;
2915 if (!createOutputFile(doxyLatexTexStream, pathDoxyLatexTex))
2916 return false;
2917
2918 doxyLatexTexStream <<
2919 "\\documentclass[a4paper,12pt]{article}\n"
2920 "\\usepackage[latin1]{inputenc}\n"
2921 "\\usepackage[none]{hyphenat}\n"
2922 "\\usepackage[T1]{fontenc}\n"
2923 "\\usepackage{hyperref}\n"
2924 "\\usepackage{times}\n"
2925 "\n"
2926 "\\input{doxyformat}\n"
2927 "\n"
2928 "\\begin{document}\n"
2929 "\\input{" << pathDoxyDocsTex << "}\n"
2930 "\\sloppy\n"
2931 "\\EmitDoxyDocs\n"
2932 "\\end{document}\n";
2933
2934 return true;
2935}

References createOutputFile(), pathDoxyDocsTex, and pathDoxyLatexTex.

Referenced by generate().

◆ generateDoxyRules()

bool PerlModGenerator::generateDoxyRules ( )

Definition at line 2473 of file perlmodgen.cpp.

2474{
2475 std::ofstream doxyRulesStream;
2476 if (!createOutputFile(doxyRulesStream, pathDoxyRules))
2477 return false;
2478
2479 bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
2480 DString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
2481
2482 doxyRulesStream <<
2483 prefix << "DOXY_EXEC_PATH = " << pathDoxyExec << "\n" <<
2484 prefix << "DOXYFILE = " << pathDoxyfile << "\n" <<
2485 prefix << "DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" <<
2486 prefix << "DOXYSTRUCTURE_PM = " << pathDoxyStructurePM << "\n" <<
2487 prefix << "DOXYRULES = " << pathDoxyRules << "\n";
2488 if (perlmodLatex)
2489 doxyRulesStream <<
2490 prefix << "DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" <<
2491 prefix << "DOXYLATEXSTRUCTURE_PL = " << pathDoxyLatexStructurePL << "\n" <<
2492 prefix << "DOXYSTRUCTURE_TEX = " << pathDoxyStructureTex << "\n" <<
2493 prefix << "DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" <<
2494 prefix << "DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" <<
2495 prefix << "DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" <<
2496 prefix << "DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" <<
2497 prefix << "DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n";
2498
2499 doxyRulesStream <<
2500 "\n"
2501 ".PHONY: clean-perlmod\n"
2502 "clean-perlmod::\n"
2503 "\trm -f $(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
2504 "\t$(" << prefix << "DOXYDOCS_PM)";
2505 if (perlmodLatex)
2506 doxyRulesStream <<
2507 " \\\n"
2508 "\t$(" << prefix << "DOXYLATEX_PL) \\\n"
2509 "\t$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
2510 "\t$(" << prefix << "DOXYDOCS_TEX) \\\n"
2511 "\t$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
2512 "\t$(" << prefix << "DOXYFORMAT_TEX) \\\n"
2513 "\t$(" << prefix << "DOXYLATEX_TEX) \\\n"
2514 "\t$(" << prefix << "DOXYLATEX_PDF) \\\n"
2515 "\t$(" << prefix << "DOXYLATEX_DVI) \\\n"
2516 "\t$(addprefix $(" << prefix << "DOXYLATEX_TEX:tex=),out aux log)";
2517 doxyRulesStream << "\n\n";
2518
2519 doxyRulesStream <<
2520 "$(" << prefix << "DOXYRULES) \\\n"
2521 "$(" << prefix << "DOXYMAKEFILE) \\\n"
2522 "$(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
2523 "$(" << prefix << "DOXYDOCS_PM)";
2524 if (perlmodLatex) {
2525 doxyRulesStream <<
2526 " \\\n"
2527 "$(" << prefix << "DOXYLATEX_PL) \\\n"
2528 "$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
2529 "$(" << prefix << "DOXYFORMAT_TEX) \\\n"
2530 "$(" << prefix << "DOXYLATEX_TEX)";
2531 }
2532 doxyRulesStream <<
2533 ": \\\n"
2534 "\t$(" << prefix << "DOXYFILE)\n"
2535 "\tcd $(" << prefix << "DOXY_EXEC_PATH) ; doxygen \"$<\"\n";
2536
2537 if (perlmodLatex) {
2538 doxyRulesStream <<
2539 "\n"
2540 "$(" << prefix << "DOXYDOCS_TEX): \\\n"
2541 "$(" << prefix << "DOXYLATEX_PL) \\\n"
2542 "$(" << prefix << "DOXYDOCS_PM)\n"
2543 "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
2544 "\n"
2545 "$(" << prefix << "DOXYSTRUCTURE_TEX): \\\n"
2546 "$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
2547 "$(" << prefix << "DOXYSTRUCTURE_PM)\n"
2548 "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
2549 "\n"
2550 "$(" << prefix << "DOXYLATEX_PDF) \\\n"
2551 "$(" << prefix << "DOXYLATEX_DVI): \\\n"
2552 "$(" << prefix << "DOXYLATEX_TEX) \\\n"
2553 "$(" << prefix << "DOXYFORMAT_TEX) \\\n"
2554 "$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
2555 "$(" << prefix << "DOXYDOCS_TEX)\n"
2556 "\n"
2557 "$(" << prefix << "DOXYLATEX_PDF): \\\n"
2558 "$(" << prefix << "DOXYLATEX_TEX)\n"
2559 "\tpdflatex -interaction=nonstopmode \"$<\"\n"
2560 "\n"
2561 "$(" << prefix << "DOXYLATEX_DVI): \\\n"
2562 "$(" << prefix << "DOXYLATEX_TEX)\n"
2563 "\tlatex -interaction=nonstopmode \"$<\"\n";
2564 }
2565
2566 return true;
2567}
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 2290 of file perlmodgen.cpp.

2291{
2292 std::ofstream doxyModelPMStream;
2293 if (!createOutputFile(doxyModelPMStream, pathDoxyStructurePM))
2294 return false;
2295
2296 doxyModelPMStream <<
2297 "sub memberlist($) {\n"
2298 " my $prefix = $_[0];\n"
2299 " return\n"
2300 "\t[ \"hash\", $prefix . \"s\",\n"
2301 "\t {\n"
2302 "\t members =>\n"
2303 "\t [ \"list\", $prefix . \"List\",\n"
2304 "\t\t[ \"hash\", $prefix,\n"
2305 "\t\t {\n"
2306 "\t\t kind => [ \"string\", $prefix . \"Kind\" ],\n"
2307 "\t\t name => [ \"string\", $prefix . \"Name\" ],\n"
2308 "\t\t static => [ \"string\", $prefix . \"Static\" ],\n"
2309 "\t\t virtualness => [ \"string\", $prefix . \"Virtualness\" ],\n"
2310 "\t\t protection => [ \"string\", $prefix . \"Protection\" ],\n"
2311 "\t\t type => [ \"string\", $prefix . \"Type\" ],\n"
2312 "\t\t parameters =>\n"
2313 "\t\t [ \"list\", $prefix . \"Params\",\n"
2314 "\t\t\t[ \"hash\", $prefix . \"Param\",\n"
2315 "\t\t\t {\n"
2316 "\t\t\t declaration_name => [ \"string\", $prefix . \"ParamName\" ],\n"
2317 "\t\t\t type => [ \"string\", $prefix . \"ParamType\" ],\n"
2318 "\t\t\t },\n"
2319 "\t\t\t],\n"
2320 "\t\t ],\n"
2321 "\t\t detailed =>\n"
2322 "\t\t [ \"hash\", $prefix . \"Detailed\",\n"
2323 "\t\t\t{\n"
2324 "\t\t\t doc => [ \"doc\", $prefix . \"DetailedDoc\" ],\n"
2325 "\t\t\t return => [ \"doc\", $prefix . \"Return\" ],\n"
2326 "\t\t\t see => [ \"doc\", $prefix . \"See\" ],\n"
2327 "\t\t\t params =>\n"
2328 "\t\t\t [ \"list\", $prefix . \"PDBlocks\",\n"
2329 "\t\t\t [ \"hash\", $prefix . \"PDBlock\",\n"
2330 "\t\t\t\t{\n"
2331 "\t\t\t\t parameters =>\n"
2332 "\t\t\t\t [ \"list\", $prefix . \"PDParams\",\n"
2333 "\t\t\t\t [ \"hash\", $prefix . \"PDParam\",\n"
2334 "\t\t\t\t\t{\n"
2335 "\t\t\t\t\t name => [ \"string\", $prefix . \"PDParamName\" ],\n"
2336 "\t\t\t\t\t},\n"
2337 "\t\t\t\t ],\n"
2338 "\t\t\t\t ],\n"
2339 "\t\t\t\t doc => [ \"doc\", $prefix . \"PDDoc\" ],\n"
2340 "\t\t\t\t},\n"
2341 "\t\t\t ],\n"
2342 "\t\t\t ],\n"
2343 "\t\t\t},\n"
2344 "\t\t ],\n"
2345 "\t\t },\n"
2346 "\t\t],\n"
2347 "\t ],\n"
2348 "\t },\n"
2349 "\t];\n"
2350 "}\n"
2351 "\n"
2352 "$doxystructure =\n"
2353 " [ \"hash\", \"Root\",\n"
2354 " {\n"
2355 "\tfiles =>\n"
2356 "\t [ \"list\", \"Files\",\n"
2357 "\t [ \"hash\", \"File\",\n"
2358 "\t {\n"
2359 "\t\tname => [ \"string\", \"FileName\" ],\n"
2360 "\t\ttypedefs => memberlist(\"FileTypedef\"),\n"
2361 "\t\tvariables => memberlist(\"FileVariable\"),\n"
2362 "\t\tfunctions => memberlist(\"FileFunction\"),\n"
2363 "\t\tdetailed =>\n"
2364 "\t\t [ \"hash\", \"FileDetailed\",\n"
2365 "\t\t {\n"
2366 "\t\t doc => [ \"doc\", \"FileDetailedDoc\" ],\n"
2367 "\t\t },\n"
2368 "\t\t ],\n"
2369 "\t },\n"
2370 "\t ],\n"
2371 "\t ],\n"
2372 "\tpages =>\n"
2373 "\t [ \"list\", \"Pages\",\n"
2374 "\t [ \"hash\", \"Page\",\n"
2375 "\t {\n"
2376 "\t\tname => [ \"string\", \"PageName\" ],\n"
2377 "\t\tdetailed =>\n"
2378 "\t\t [ \"hash\", \"PageDetailed\",\n"
2379 "\t\t {\n"
2380 "\t\t doc => [ \"doc\", \"PageDetailedDoc\" ],\n"
2381 "\t\t },\n"
2382 "\t\t ],\n"
2383 "\t },\n"
2384 "\t ],\n"
2385 "\t ],\n"
2386 "\tclasses =>\n"
2387 "\t [ \"list\", \"Classes\",\n"
2388 "\t [ \"hash\", \"Class\",\n"
2389 "\t {\n"
2390 "\t\tname => [ \"string\", \"ClassName\" ],\n"
2391 "\t\tpublic_typedefs => memberlist(\"ClassPublicTypedef\"),\n"
2392 "\t\tpublic_methods => memberlist(\"ClassPublicMethod\"),\n"
2393 "\t\tpublic_members => memberlist(\"ClassPublicMember\"),\n"
2394 "\t\tprotected_typedefs => memberlist(\"ClassProtectedTypedef\"),\n"
2395 "\t\tprotected_methods => memberlist(\"ClassProtectedMethod\"),\n"
2396 "\t\tprotected_members => memberlist(\"ClassProtectedMember\"),\n"
2397 "\t\tprivate_typedefs => memberlist(\"ClassPrivateTypedef\"),\n"
2398 "\t\tprivate_methods => memberlist(\"ClassPrivateMethod\"),\n"
2399 "\t\tprivate_members => memberlist(\"ClassPrivateMember\"),\n"
2400 "\t\tdetailed =>\n"
2401 "\t\t [ \"hash\", \"ClassDetailed\",\n"
2402 "\t\t {\n"
2403 "\t\t doc => [ \"doc\", \"ClassDetailedDoc\" ],\n"
2404 "\t\t },\n"
2405 "\t\t ],\n"
2406 "\t },\n"
2407 "\t ],\n"
2408 "\t ],\n"
2409 "\tgroups =>\n"
2410 "\t [ \"list\", \"Groups\",\n"
2411 "\t [ \"hash\", \"Group\",\n"
2412 "\t {\n"
2413 "\t\tname => [ \"string\", \"GroupName\" ],\n"
2414 "\t\ttitle => [ \"string\", \"GroupTitle\" ],\n"
2415 "\t\tfiles =>\n"
2416 "\t\t [ \"list\", \"Files\",\n"
2417 "\t\t [ \"hash\", \"File\",\n"
2418 "\t\t {\n"
2419 "\t\t name => [ \"string\", \"Filename\" ]\n"
2420 "\t\t }\n"
2421 "\t\t ],\n"
2422 "\t\t ],\n"
2423 "\t\tclasses =>\n"
2424 "\t\t [ \"list\", \"Classes\",\n"
2425 "\t\t [ \"hash\", \"Class\",\n"
2426 "\t\t {\n"
2427 "\t\t name => [ \"string\", \"Classname\" ]\n"
2428 "\t\t }\n"
2429 "\t\t ],\n"
2430 "\t\t ],\n"
2431 "\t\tnamespaces =>\n"
2432 "\t\t [ \"list\", \"Namespaces\",\n"
2433 "\t\t [ \"hash\", \"Namespace\",\n"
2434 "\t\t {\n"
2435 "\t\t name => [ \"string\", \"NamespaceName\" ]\n"
2436 "\t\t }\n"
2437 "\t\t ],\n"
2438 "\t\t ],\n"
2439 "\t\tpages =>\n"
2440 "\t\t [ \"list\", \"Pages\",\n"
2441 "\t\t [ \"hash\", \"Page\","
2442 "\t\t {\n"
2443 "\t\t title => [ \"string\", \"PageName\" ]\n"
2444 "\t\t }\n"
2445 "\t\t ],\n"
2446 "\t\t ],\n"
2447 "\t\tgroups =>\n"
2448 "\t\t [ \"list\", \"Groups\",\n"
2449 "\t\t [ \"hash\", \"Group\",\n"
2450 "\t\t {\n"
2451 "\t\t title => [ \"string\", \"GroupName\" ]\n"
2452 "\t\t }\n"
2453 "\t\t ],\n"
2454 "\t\t ],\n"
2455 "\t\tfunctions => memberlist(\"GroupFunction\"),\n"
2456 "\t\tdetailed =>\n"
2457 "\t\t [ \"hash\", \"GroupDetailed\",\n"
2458 "\t\t {\n"
2459 "\t\t doc => [ \"doc\", \"GroupDetailedDoc\" ],\n"
2460 "\t\t },\n"
2461 "\t\t ],\n"
2462 "\t }\n"
2463 "\t ],\n"
2464 "\t ],\n"
2465 " },\n"
2466 " ];\n"
2467 "\n"
2468 "1;\n";
2469
2470 return true;
2471}

References createOutputFile(), and pathDoxyStructurePM.

Referenced by generate().

◆ generateMakefile()

bool PerlModGenerator::generateMakefile ( )

Definition at line 2569 of file perlmodgen.cpp.

2570{
2571 std::ofstream makefileStream;
2572 if (!createOutputFile(makefileStream, pathMakefile))
2573 return false;
2574
2575 bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
2576 DString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
2577
2578 makefileStream <<
2579 ".PHONY: default clean" << (perlmodLatex ? " pdf" : "") << "\n"
2580 "default: " << (perlmodLatex ? "pdf" : "clean") << "\n"
2581 "\n"
2582 "include " << pathDoxyRules << "\n"
2583 "\n"
2584 "clean: clean-perlmod\n";
2585
2586 if (perlmodLatex) {
2587 makefileStream <<
2588 "pdf: $(" << prefix << "DOXYLATEX_PDF)\n"
2589 "dvi: $(" << prefix << "DOXYLATEX_DVI)\n";
2590 }
2591
2592 return true;
2593}

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

Referenced by generate().

◆ generatePerlModForClass()

void PerlModGenerator::generatePerlModForClass ( const ClassDef * cd)

Definition at line 1761 of file perlmodgen.cpp.

1762{
1763 // + brief description
1764 // + detailed description
1765 // + template argument list(s)
1766 // - include file
1767 // + member groups
1768 // + inheritance diagram
1769 // + list of direct super classes
1770 // + list of direct sub classes
1771 // + list of inner classes
1772 // + collaboration diagram
1773 // + list of all members
1774 // + user defined member sections
1775 // + standard member sections
1776 // + detailed member documentation
1777 // - examples using the class
1778
1779 if (cd->isReference()) return; // skip external references.
1780 if (cd->isAnonymous()) return; // skip anonymous compounds.
1781 if (cd->isImplicitTemplateInstance()) return; // skip generated template instances.
1782
1784 .addFieldQuotedString("name", cd->name());
1785 /* DGA: fix # #7547 Perlmod does not generate "kind" information to discriminate struct/union */
1787 m_output.addFieldBoolean("final", cd->isFinal())
1788 .addFieldBoolean("sealed", cd->isSealed())
1789 .addFieldBoolean("abstract", cd->isAbstract())
1790 .addFieldBoolean("ref", cd->isRef());
1791
1792 if (!cd->baseClasses().empty())
1793 {
1794 m_output.openList("base");
1795 for (const auto &bcd : cd->baseClasses())
1796 {
1798 .addFieldQuotedString("name", bcd.classDef->displayName())
1799 .addFieldQuotedString("virtualness", getVirtualnessName(bcd.virt))
1800 .addFieldQuotedString("protection", getProtectionName(bcd.prot))
1801 .closeHash();
1802 }
1804 }
1805
1806 if (!cd->subClasses().empty())
1807 {
1808 m_output.openList("derived");
1809 for (const auto &bcd : cd->subClasses())
1810 {
1812 .addFieldQuotedString("name", bcd.classDef->displayName())
1813 .addFieldQuotedString("virtualness", getVirtualnessName(bcd.virt))
1814 .addFieldQuotedString("protection", getProtectionName(bcd.prot))
1815 .closeHash();
1816 }
1818 }
1819
1820 {
1821 m_output.openList("inner");
1822 for (const auto &icd : cd->getClasses())
1824 .addFieldQuotedString("name", icd->name())
1825 .closeHash();
1827 }
1828
1830
1834
1835 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubTypes()),"public_typedefs");
1836 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubMethods()),"public_methods");
1837 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubAttribs()),"public_members");
1838 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubSlots()),"public_slots");
1839 generatePerlModSection(cd,cd->getMemberList(MemberListType::Signals()),"signals");
1840 generatePerlModSection(cd,cd->getMemberList(MemberListType::DcopMethods()),"dcop_methods");
1841 generatePerlModSection(cd,cd->getMemberList(MemberListType::Properties()),"properties");
1842 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubStaticMethods()),"public_static_methods");
1843 generatePerlModSection(cd,cd->getMemberList(MemberListType::PubStaticAttribs()),"public_static_members");
1844 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProTypes()),"protected_typedefs");
1845 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProMethods()),"protected_methods");
1846 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProAttribs()),"protected_members");
1847 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProSlots()),"protected_slots");
1848 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProStaticMethods()),"protected_static_methods");
1849 generatePerlModSection(cd,cd->getMemberList(MemberListType::ProStaticAttribs()),"protected_static_members");
1850 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriTypes()),"private_typedefs");
1851 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriMethods()),"private_methods");
1852 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriAttribs()),"private_members");
1853 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriSlots()),"private_slots");
1854 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriStaticMethods()),"private_static_methods");
1855 generatePerlModSection(cd,cd->getMemberList(MemberListType::PriStaticAttribs()),"private_static_members");
1856 generatePerlModSection(cd,cd->getMemberList(MemberListType::Friends()),"friend_methods");
1857 generatePerlModSection(cd,cd->getMemberList(MemberListType::Related()),"related_methods");
1858
1859 addPerlModDocBlock(m_output,"brief",cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1860 addPerlModDocBlock(m_output,"detailed",cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1861
1862#if 0
1863 DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance);
1864 if (!inheritanceGraph.isTrivial())
1865 {
1866 t << " <inheritancegraph>" << endl;
1867 inheritanceGraph.writePerlMod(t);
1868 t << " </inheritancegraph>" << endl;
1869 }
1870 DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation);
1871 if (!collaborationGraph.isTrivial())
1872 {
1873 t << " <collaborationgraph>" << endl;
1874 collaborationGraph.writePerlMod(t);
1875 t << " </collaborationgraph>" << endl;
1876 }
1877 t << " <location file=\""
1878 << cd->getDefFileName() << "\" line=\""
1879 << cd->getDefLine() << "\"";
1880 if (cd->getStartBodyLine()!=-1)
1881 {
1882 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1883 << cd->getEndBodyLine() << "\"";
1884 }
1885 t << "/>" << endl;
1886#endif
1887
1889}
virtual bool isAbstract() const =0
Returns true if there is at least one pure virtual member in this class.
virtual bool isFinal() const =0
Returns true if this class is marked as final.
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual bool isSealed() const =0
Returns true if this class is marked as sealed.
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 bool isRef() const =0
Returns true if this class is a C# ref struct or a C++/CLI ref 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::addFieldBoolean(), 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(), ClassDef::isAbstract(), Definition::isAnonymous(), ClassDef::isFinal(), ClassDef::isImplicitTemplateInstance(), ClassDef::isRef(), Definition::isReference(), ClassDef::isSealed(), 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 2018 of file perlmodgen.cpp.

2019{
2020 // + includes files
2021 // + includedby files
2022 // - include graph
2023 // - included by graph
2024 // - contained class definitions
2025 // - contained namespace definitions
2026 // - member groups
2027 // + normal members
2028 // + brief desc
2029 // + detailed desc
2030 // - source code
2031 // - location
2032 // - number of lines
2033
2034 if (fd->isReference()) return;
2035
2037 .addFieldQuotedString("name", fd->name());
2038
2039 m_output.openList("includes");
2040 for (const auto &inc: fd->includeFileList())
2041 {
2043 .addFieldQuotedString("name", inc.includeName);
2044 if (inc.fileDef && !inc.fileDef->isReference())
2045 {
2046 m_output.addFieldQuotedString("ref", inc.fileDef->getOutputFileBase());
2047 }
2049 }
2051
2052 m_output.openList("included_by");
2053 for (const auto &inc : fd->includedByFileList())
2054 {
2056 .addFieldQuotedString("name", inc.includeName);
2057 if (inc.fileDef && !inc.fileDef->isReference())
2058 {
2059 m_output.addFieldQuotedString("ref", inc.fileDef->getOutputFileBase());
2060 }
2062 }
2064
2066
2067 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecDefineMembers()),"defines");
2068 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecProtoMembers()),"prototypes");
2069 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
2070 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecEnumMembers()),"enums");
2071 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecFuncMembers()),"functions");
2072 generatePerlModSection(fd,fd->getMemberList(MemberListType::DecVarMembers()),"variables");
2073
2074 addPerlModDocBlock(m_output,"brief",fd->briefFile(),fd->briefLine(),nullptr,nullptr,fd->briefDescription());
2075 addPerlModDocBlock(m_output,"detailed",fd->docFile(),fd->docLine(),nullptr,nullptr,fd->documentation());
2076
2078}
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 2080 of file perlmodgen.cpp.

2081{
2082 // + members
2083 // + member groups
2084 // + files
2085 // + classes
2086 // + namespaces
2087 // - packages
2088 // + pages
2089 // + child groups
2090 // - examples
2091 // + brief description
2092 // + detailed description
2093
2094 if (gd->isReference()) return; // skip external references
2095
2097 .addFieldQuotedString("name", gd->name())
2098 .addFieldQuotedString("title", gd->groupTitle());
2099
2100 if (!gd->getFiles().empty())
2101 {
2102 m_output.openList("files");
2103 for (const auto &fd : gd->getFiles())
2105 .addFieldQuotedString("name", fd->name())
2106 .closeHash();
2108 }
2109
2110 if (!gd->getClasses().empty())
2111 {
2112 m_output.openList("classes");
2113 for (const auto &cd : gd->getClasses())
2115 .addFieldQuotedString("name", cd->name())
2116 .closeHash();
2118 }
2119
2120 if (!gd->getConcepts().empty())
2121 {
2122 m_output.openList("concepts");
2123 for (const auto &cd : gd->getConcepts())
2125 .addFieldQuotedString("name", cd->name())
2126 .closeHash();
2128 }
2129
2130 if (!gd->getModules().empty())
2131 {
2132 m_output.openList("modules");
2133 for (const auto &mod : gd->getModules())
2135 .addFieldQuotedString("name", mod->name())
2136 .closeHash();
2138 }
2139
2140 if (!gd->getNamespaces().empty())
2141 {
2142 m_output.openList("namespaces");
2143 for (const auto &nd : gd->getNamespaces())
2145 .addFieldQuotedString("name", nd->name())
2146 .closeHash();
2148 }
2149
2150 if (!gd->getPages().empty())
2151 {
2152 m_output.openList("pages");
2153 for (const auto &pd : gd->getPages())
2155 .addFieldQuotedString("title", pd->title())
2156 .closeHash();
2158 }
2159
2160 if (!gd->getSubGroups().empty())
2161 {
2162 m_output.openList("groups");
2163 for (const auto &sgd : gd->getSubGroups())
2165 .addFieldQuotedString("title", sgd->groupTitle())
2166 .closeHash();
2168 }
2169
2171
2172 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecDefineMembers()),"defines");
2173 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecProtoMembers()),"prototypes");
2174 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
2175 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecEnumMembers()),"enums");
2176 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecFuncMembers()),"functions");
2177 generatePerlModSection(gd,gd->getMemberList(MemberListType::DecVarMembers()),"variables");
2178
2179 addPerlModDocBlock(m_output,"brief",gd->briefFile(),gd->briefLine(),nullptr,nullptr,gd->briefDescription());
2180 addPerlModDocBlock(m_output,"detailed",gd->docFile(),gd->docLine(),nullptr,nullptr,gd->documentation());
2181
2183}
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 1503 of file perlmodgen.cpp.

1504{
1505 // + declaration/definition arg lists
1506 // + reimplements
1507 // + reimplementedBy
1508 // + exceptions
1509 // + const/volatile specifiers
1510 // - examples
1511 // - source definition
1512 // - source references
1513 // - source referenced by
1514 // - body code
1515 // - template arguments
1516 // (templateArguments(), definitionTemplateParameterLists())
1517
1518 DString memType = to_string_lower(md->memberType());
1519 DString name;
1520 bool isFunc=to_isFunction(md->memberType());
1521
1522 bool isFortran = md->getLanguage()==SrcLangExt::Fortran;
1523 name = md->name();
1524 if (md->isAnonymous()) name = "__unnamed" + name.mid(1)+"__";
1525
1527 .addFieldQuotedString("kind", memType)
1528 .addFieldQuotedString("name", name)
1531 .addFieldBoolean("static", md->isStatic());
1532
1533 if (md->memberType()==MemberType::Property)
1534 {
1535 m_output.addFieldBoolean("readable", md->isReadable())
1536 .addFieldBoolean("writable", md->isWritable())
1537 .addFieldBoolean("gettable", md->isGettable())
1538 .addFieldBoolean("private_gettable", md->isPrivateGettable())
1539 .addFieldBoolean("protected_gettable", md->isProtectedGettable())
1540 .addFieldBoolean("settable", md->isSettable())
1541 .addFieldBoolean("private_settable", md->isPrivateSettable())
1542 .addFieldBoolean("protected_settable", md->isProtectedSettable())
1543 .addFieldBoolean("initonly", md->isInitonly());
1544 }
1545
1547 addPerlModDocBlock(m_output,"detailed",md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
1548 if (md->memberType()!=MemberType::Define &&
1549 md->memberType()!=MemberType::Enumeration)
1551
1552 const ArgumentList &al = md->argumentList();
1553 if (isFunc) //function
1554 {
1556 .addFieldBoolean("volatile", al.volatileSpecifier());
1557
1558 m_output.openList("parameters");
1559 const ArgumentList &declAl = md->declArgumentList();
1560 if (!declAl.empty())
1561 {
1562 auto defIt = al.begin();
1563 for (const Argument &a : declAl)
1564 {
1565 const Argument *defArg = nullptr;
1566 if (defIt!=al.end())
1567 {
1568 defArg = &(*defIt);
1569 ++defIt;
1570 }
1572
1573 if (!a.name.empty())
1574 m_output.addFieldQuotedString("declaration_name", a.name);
1575
1576 if (defArg && !defArg->name.empty() && defArg->name!=a.name)
1577 m_output.addFieldQuotedString("definition_name", defArg->name);
1578
1579 if (isFortran && defArg && !defArg->type.empty())
1580 m_output.addFieldQuotedString("type", defArg->type);
1581 else if (!a.type.empty())
1582 m_output.addFieldQuotedString("type", a.type);
1583
1584 if (!a.array.empty())
1585 m_output.addFieldQuotedString("array", a.array);
1586
1587 if (!a.defval.empty())
1588 m_output.addFieldQuotedString("default_value", a.defval);
1589
1590 if (!a.attrib.empty())
1591 m_output.addFieldQuotedString("attributes", a.attrib);
1592
1594 }
1595 }
1597 }
1598 else if (md->memberType()==MemberType::Define &&
1599 md->argsString()!=nullptr) // define
1600 {
1601 m_output.openList("parameters");
1602 for (const Argument &a : al)
1603 {
1605 .addFieldQuotedString("name", a.type)
1606 .closeHash();
1607 }
1609 }
1610 else if (md->argsString()!=nullptr)
1611 {
1612 m_output.addFieldQuotedString("arguments", md->argsString());
1613 }
1614
1615 if (!md->initializer().empty())
1616 m_output.addFieldQuotedString("initializer", md->initializer());
1617
1618 if (!md->excpString().empty())
1619 m_output.addFieldQuotedString("exceptions", md->excpString());
1620
1621 if (md->memberType()==MemberType::Enumeration) // enum
1622 {
1623 const MemberVector &enumFields = md->enumFieldList();
1625 if (!enumFields.empty())
1626 {
1627 m_output.openList("values");
1628 for (const auto &emd : enumFields)
1629 {
1631 .addFieldQuotedString("name", emd->name());
1632
1633 if (!emd->initializer().empty())
1634 m_output.addFieldQuotedString("initializer", emd->initializer());
1635
1636 addPerlModDocBlock(m_output,"brief",emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
1637
1638 addPerlModDocBlock(m_output,"detailed",emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
1639
1641 }
1643 }
1644 }
1645
1646 if (md->memberType() == MemberType::Variable && !md->bitfieldString().empty())
1647 {
1648 DString bitfield = md->bitfieldString();
1649 if (bitfield.at(0) == ':') bitfield = bitfield.mid(1);
1650 m_output.addFieldQuotedString("bitfield", bitfield);
1651 }
1652
1653 const MemberDef *rmd = md->reimplements();
1654 if (rmd)
1655 m_output.openHash("reimplements")
1656 .addFieldQuotedString("name", rmd->name())
1657 .closeHash();
1658
1659 const MemberVector &rbml = md->reimplementedBy();
1660 if (!rbml.empty())
1661 {
1662 m_output.openList("reimplemented_by");
1663 for (const auto &rbmd : rbml)
1665 .addFieldQuotedString("name", rbmd->name())
1666 .closeHash();
1668 }
1669
1671}
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 bool isInitonly() const =0
virtual DString argsString() const =0
virtual DString excpString() const =0
virtual const DString & initializer() const =0
virtual bool isSettable() const =0
virtual const MemberVector & enumFieldList() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isWritable() const =0
virtual bool isPrivateGettable() 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 bool isPrivateSettable() const =0
virtual bool isProtectedSettable() const =0
virtual bool isProtectedGettable() const =0
virtual Protection protection() const =0
virtual bool isGettable() const =0
virtual MemberType memberType() const =0
virtual bool isReadable() 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
const char * name(int level)
Definition latexgen.h:368

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::isGettable(), MemberDef::isInitonly(), MemberDef::isPrivateGettable(), MemberDef::isPrivateSettable(), MemberDef::isProtectedGettable(), MemberDef::isProtectedSettable(), MemberDef::isReadable(), MemberDef::isSettable(), MemberDef::isStatic(), MemberDef::isWritable(), 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 1907 of file perlmodgen.cpp.

1908{
1909 // + contained class definitions
1910 // + contained concept definitions
1911 // + member groups
1912 // + normal members
1913 // + brief desc
1914 // + detailed desc
1915 // + location (file_id, line, column)
1916 // - exports
1917 // + used files
1918
1919 if (mod->isReference()) return; // skip external references
1920
1922 .addFieldQuotedString("name", mod->name());
1923
1925
1926 if (!mod->getClasses().empty())
1927 {
1928 m_output.openList("classes");
1929 for (const auto &cd : mod->getClasses())
1931 .addFieldQuotedString("name", cd->name())
1932 .closeHash();
1934 }
1935
1936 if (!mod->getConcepts().empty())
1937 {
1938 m_output.openList("concepts");
1939 for (const auto &cd : mod->getConcepts())
1941 .addFieldQuotedString("name", cd->name())
1942 .closeHash();
1944 }
1945
1946 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
1947 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecEnumMembers()),"enums");
1948 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecFuncMembers()),"functions");
1949 generatePerlModSection(mod,mod->getMemberList(MemberListType::DecVarMembers()),"variables");
1950
1951 addPerlModDocBlock(m_output,"brief",mod->briefFile(),mod->briefLine(),nullptr,nullptr,mod->briefDescription());
1952 addPerlModDocBlock(m_output,"detailed",mod->docFile(),mod->docLine(),nullptr,nullptr,mod->documentation());
1953
1954 if (!mod->getUsedFiles().empty())
1955 {
1956 m_output.openList("files");
1957 for (const auto &fd : mod->getUsedFiles())
1959 .addFieldQuotedString("name", fd->name())
1960 .closeHash();
1962 }
1963
1965}
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 1967 of file perlmodgen.cpp.

1968{
1969 // + contained class definitions
1970 // + contained namespace definitions
1971 // + member groups
1972 // + normal members
1973 // + brief desc
1974 // + detailed desc
1975 // + location
1976 // - files containing (parts of) the namespace definition
1977
1978 if (nd->isReference()) return; // skip external references
1979
1981 .addFieldQuotedString("name", nd->name());
1982
1983 if (!nd->getClasses().empty())
1984 {
1985 m_output.openList("classes");
1986 for (const auto &cd : nd->getClasses())
1988 .addFieldQuotedString("name", cd->name())
1989 .closeHash();
1991 }
1992
1993 if (!nd->getNamespaces().empty())
1994 {
1995 m_output.openList("namespaces");
1996 for (const auto &ind : nd->getNamespaces())
1998 .addFieldQuotedString("name", ind->name())
1999 .closeHash();
2001 }
2002
2004
2005 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecDefineMembers()),"defines");
2006 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecProtoMembers()),"prototypes");
2007 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecTypedefMembers()),"typedefs");
2008 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecEnumMembers()),"enums");
2009 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecFuncMembers()),"functions");
2010 generatePerlModSection(nd,nd->getMemberList(MemberListType::DecVarMembers()),"variables");
2011
2012 addPerlModDocBlock(m_output,"brief",nd->briefFile(),nd->briefLine(),nullptr,nullptr,nd->briefDescription());
2013 addPerlModDocBlock(m_output,"detailed",nd->docFile(),nd->docLine(),nullptr,nullptr,nd->documentation());
2014
2016}
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 2185 of file perlmodgen.cpp.

2186{
2187 // + name
2188 // + title
2189 // + documentation
2190
2191 if (pd->isReference()) return;
2192
2194 .addFieldQuotedString("name", pd->name());
2195
2196 const SectionInfo *si = SectionManager::instance().find(pd->name());
2197 if (si)
2199
2200 addPerlModDocBlock(m_output,"detailed",pd->docFile(),pd->docLine(),nullptr,nullptr,pd->documentation());
2202}
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:4590

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 2204 of file perlmodgen.cpp.

2205{
2206 std::ofstream outputFileStream;
2207 if (!createOutputFile(outputFileStream, pathDoxyDocsPM))
2208 return false;
2209
2210 PerlModOutputStream outputStream(outputFileStream);
2211 m_output.setPerlModOutputStream(&outputStream);
2212 m_output.add("$doxydocs=").openHash();
2213
2214 m_output.openList("classes");
2215 for (const auto &cd : *Doxygen::classLinkedMap)
2216 generatePerlModForClass(cd.get());
2218
2219 m_output.openList("concepts");
2220 for (const auto &cd : *Doxygen::conceptLinkedMap)
2221 generatePerlModForConcept(cd.get());
2223
2224 m_output.openList("modules");
2225 for (const auto &mod : ModuleManager::instance().modules())
2226 generatePerlModForModule(mod.get());
2228
2229 m_output.openList("namespaces");
2230 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2233
2234 m_output.openList("files");
2235 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2236 {
2237 for (const auto &fd : *fn)
2238 {
2239 generatePerlModForFile(fd.get());
2240 }
2241 }
2243
2244 m_output.openList("groups");
2245 for (const auto &gd : *Doxygen::groupLinkedMap)
2246 {
2247 generatePerlModForGroup(gd.get());
2248 }
2250
2251 m_output.openList("pages");
2252 for (const auto &pd : *Doxygen::pageLinkedMap)
2253 {
2254 generatePerlModForPage(pd.get());
2255 }
2257 {
2259 }
2261
2262 m_output.closeHash().add(";\n1;\n");
2263 m_output.reset();
2264 return true;
2265}
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 1673 of file perlmodgen.cpp.

1675{
1676 if (ml==nullptr) return; // empty list
1677
1678 m_output.openHash(name);
1679
1680 if (!header.empty())
1681 m_output.addFieldQuotedString("header", header);
1682
1683 m_output.openList("members");
1684 for (const auto &md : *ml)
1685 {
1687 }
1689 .closeHash();
1690}
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 1717 of file perlmodgen.cpp.

1718{
1719 if (!mgl.empty())
1720 {
1721 m_output.openList("user_defined");
1722 for (const auto &mg : mgl)
1723 {
1725 if (!mg->header().empty())
1726 {
1727 m_output.addFieldQuotedString("header", mg->header());
1728 }
1729
1730 if (!mg->members().empty())
1731 {
1732 m_output.openList("members");
1733 for (const auto &md : mg->members())
1734 {
1736 }
1738 }
1740 }
1742 }
1743}

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 1467 of file perlmodgen.cpp.

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

◆ pathDoxyDocsTex

DString PerlModGenerator::pathDoxyDocsTex

Definition at line 1461 of file perlmodgen.cpp.

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

◆ pathDoxyFormatTex

DString PerlModGenerator::pathDoxyFormatTex

Definition at line 1462 of file perlmodgen.cpp.

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

◆ pathDoxyLatexDVI

DString PerlModGenerator::pathDoxyLatexDVI

Definition at line 1464 of file perlmodgen.cpp.

Referenced by generate(), and generateDoxyRules().

◆ pathDoxyLatexPDF

DString PerlModGenerator::pathDoxyLatexPDF

Definition at line 1465 of file perlmodgen.cpp.

Referenced by generate(), and generateDoxyRules().

◆ pathDoxyLatexPL

DString PerlModGenerator::pathDoxyLatexPL

Definition at line 1468 of file perlmodgen.cpp.

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

◆ pathDoxyLatexStructurePL

DString PerlModGenerator::pathDoxyLatexStructurePL

Definition at line 1469 of file perlmodgen.cpp.

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

◆ pathDoxyLatexTex

DString PerlModGenerator::pathDoxyLatexTex

Definition at line 1463 of file perlmodgen.cpp.

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

◆ pathDoxyRules

DString PerlModGenerator::pathDoxyRules

Definition at line 1470 of file perlmodgen.cpp.

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

◆ pathDoxyStructurePM

DString PerlModGenerator::pathDoxyStructurePM

Definition at line 1460 of file perlmodgen.cpp.

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

◆ pathDoxyStructureTex

DString PerlModGenerator::pathDoxyStructureTex

Definition at line 1466 of file perlmodgen.cpp.

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

◆ pathMakefile

DString PerlModGenerator::pathMakefile

Definition at line 1471 of file perlmodgen.cpp.

Referenced by generate(), and generateMakefile().


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