summaryrefslogtreecommitdiffstats
ModeNameSize
-rw-r--r--.autom4te.cfg827logstatsplain
-rw-r--r--.h5chkright.ini1718logstatsplain
-rw-r--r--COPYING4239logstatsplain
-rw-r--r--MANIFEST52546logstatsplain
-rwxr-xr-xMakefile.am6736logstatsplain
-rw-r--r--Makefile.dist1297logstatsplain
-rw-r--r--Makefile.in31058logstatsplain
-rw-r--r--README.txt1600logstatsplain
-rw-r--r--aclocal.m4246402logstatsplain
-rw-r--r--acsite.m42800logstatsplain
d---------bin1303logstatsplain
d---------c++209logstatsplain
d---------config1886logstatsplain
-rwxr-xr-xconfigure1581069logstatsplain
-rw-r--r--configure.in122029logstatsplain
d---------examples733logstatsplain
d---------fortran243logstatsplain
d---------hl305logstatsplain
d---------perform781logstatsplain
d---------release_docs912logstatsplain
d---------src10275logstatsplain
d---------test4677logstatsplain
d---------testpar663logstatsplain
d---------tools442logstatsplain
d---------vms263logstatsplain
d---------windows1126logstatsplain
div class=\"ah\">  " << s +// << "  "; +//} -void HtmlGenerator::startDotFile(const char *name,bool hasCaption) -{ - QCString baseName=name; - int i; - if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) - { - baseName=baseName.right(baseName.length()-i-1); - } - QCString outDir = Config_getString("HTML_OUTPUT"); - writeDotGraphFromFile(name,outDir,baseName,BITMAP); - t << "
" << endl; - t << "\""" << endl; - if (hasCaption) - { - t << "

"; - } -} +//void HtmlGenerator::startImage(const char *name,const char *,bool hasCaption) +//{ +// QCString baseName=name; +// int i; +// if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) +// { +// baseName=baseName.right(baseName.length()-i-1); +// } +// t << "

" << endl; +// t << "\""" << endl; +// if (hasCaption) +// { +// t << "

"; +// } +//} -void HtmlGenerator::endDotFile(bool hasCaption) -{ - if (hasCaption) - { - t << "

" << endl; - } - t << "
" << endl; -} +//void HtmlGenerator::endImage(bool hasCaption) +//{ +// if (hasCaption) +// { +// t << "

" << endl; +// } +// t << "
" << endl; +//} +//void HtmlGenerator::startDotFile(const char *name,bool hasCaption) +//{ +// QCString baseName=name; +// int i; +// if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) +// { +// baseName=baseName.right(baseName.length()-i-1); +// } +// QCString outDir = Config_getString("HTML_OUTPUT"); +// writeDotGraphFromFile(name,outDir,baseName,BITMAP); +// t << "
" << endl; +// t << "\""" << endl; +// if (hasCaption) +// { +// t << "

"; +// } +//} +// +//void HtmlGenerator::endDotFile(bool hasCaption) +//{ +// if (hasCaption) +// { +// t << "

" << endl; +// } +// t << "
" << endl; +//} +// void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const char *) { DBG_HTML(t << "" << endl;) @@ -1235,17 +1235,17 @@ void HtmlGenerator::endParamList() t << ""; } -void HtmlGenerator::startSectionRefList() -{ - t << "" << endl; - t << "" << endl; +// t << "" << endl; +//} void HtmlGenerator::printDoc(DocNode *n) diff --git a/src/htmlgen.h b/src/htmlgen.h index 6297fc0..aac81f6 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -75,11 +75,11 @@ class HtmlGenerator : public OutputGenerator void endIndexValue(const char *,bool); void startItemList() { t << "" << endl; } - void startEnumList() { t << "
    " << endl; } - void endEnumList() { t << "
" << endl; } - void startAlphabeticalIndexList(); - void endAlphabeticalIndexList(); - void writeIndexHeading(const char *s); + //void startEnumList() { t << "
    " << endl; } + //void endEnumList() { t << "
" << endl; } + //void startAlphabeticalIndexList(); + //void endAlphabeticalIndexList(); + //void writeIndexHeading(const char *s); void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); void codify(const char *text); @@ -91,7 +91,7 @@ class HtmlGenerator : public OutputGenerator void endTextLink(); void startHtmlLink(const char *url); void endHtmlLink(); - void writeMailLink(const char *url); + //void writeMailLink(const char *url); void startTypewriter() { t << ""; } void endTypewriter() { t << ""; } void startGroupHeader(); @@ -125,10 +125,10 @@ class HtmlGenerator : public OutputGenerator { t << ""; } void startCodeFragment() { t << "
"; }
     void endCodeFragment()   { t << "
"; } - void startPreFragment() { t << "
"; }
-    void endPreFragment()   { t << "
"; } - void startVerbatimFragment() { t << "
"; }
-    void endVerbatimFragment()   { t << "
"; } + //void startPreFragment() { t << "
"; }
+    //void endPreFragment()   { t << "
"; } + //void startVerbatimFragment() { t << "
"; }
+    //void endVerbatimFragment()   { t << "
"; } void writeLineNumber(const char *,const char *,const char *,int); void startCodeLine() { col=0; } void endCodeLine() { codify("\n"); } @@ -166,44 +166,44 @@ class HtmlGenerator : public OutputGenerator void endCenter() { t << "" << endl; } void startSmall() { t << "" << endl; } void endSmall() { t << "" << endl; } - void startSubscript() { t << ""; } - void endSubscript() { t << ""; } - void startSuperscript() { t << ""; } - void endSuperscript() { t << ""; } - void startTable(bool,int) - { t << ""; } - void endTable(bool hasCaption) - { if (!hasCaption) t << ""; - t << "
" << endl; - } - void startCaption() { t << ""; } - void endCaption() { t << "" << endl; } - void nextTableRow() { t << ""; } - void endTableRow() { t << "" << endl; } - void nextTableColumn() { t << ""; } - void endTableColumn() { t << ""; } - void writeCopyright() { t << "©"; } - void writeQuote() { t << """; } - void writeUmlaut(char c) { t << "&" << c << "uml;"; } - void writeAcute(char c) { t << "&" << c << "acute;"; } - void writeGrave(char c) { t << "&" << c << "grave;"; } - void writeCirc(char c) { t << "&" << c << "circ;"; } - void writeTilde(char c) { t << "&" << c << "tilde;"; } - void writeRing(char c) { t << "&" << c << "ring;"; } - void writeSharpS() { t << "ß"; } - void writeCCedil(char c) { t << "&" << c << "cedil;"; } + //void startSubscript() { t << ""; } + //void endSubscript() { t << ""; } + //void startSuperscript() { t << ""; } + //void endSuperscript() { t << ""; } + //void startTable(bool,int) + // { t << ""; } + //void endTable(bool hasCaption) + // { if (!hasCaption) t << ""; + // t << "
" << endl; + // } + //void startCaption() { t << ""; } + //void endCaption() { t << "" << endl; } + //void nextTableRow() { t << ""; } + //void endTableRow() { t << "" << endl; } + //void nextTableColumn() { t << ""; } + //void endTableColumn() { t << ""; } + //void writeCopyright() { t << "©"; } + //void writeQuote() { t << """; } + //void writeUmlaut(char c) { t << "&" << c << "uml;"; } + //void writeAcute(char c) { t << "&" << c << "acute;"; } + //void writeGrave(char c) { t << "&" << c << "grave;"; } + //void writeCirc(char c) { t << "&" << c << "circ;"; } + //void writeTilde(char c) { t << "&" << c << "tilde;"; } + //void writeRing(char c) { t << "&" << c << "ring;"; } + //void writeSharpS() { t << "ß"; } + //void writeCCedil(char c) { t << "&" << c << "cedil;"; } void startDescList(SectionTypes) { t << "
" << endl; } void endDescList() { t << "
"; } void startSimpleSect(SectionTypes,const char *,const char *,const char *); void endSimpleSect(); void startParamList(ParamListTypes,const char *); void endParamList(); - void endDescTitle() { t << ""; } + //void endDescTitle() { t << ""; } void writeDescItem() { t << "
" << endl; } void startSection(const char *,const char *,SectionInfo::SectionType); void endSection(const char *,SectionInfo::SectionType); - void writeSectionRef(const char *,const char *,const char *,const char *); - void writeSectionRefItem(const char *,const char *,const char *); + //void writeSectionRef(const char *,const char *,const char *,const char *); + //void writeSectionRefItem(const char *,const char *,const char *); //void writeSectionRefAnchor(const char *,const char *,const char *); void addIndexItem(const char *,const char *); void startIndent(); @@ -217,12 +217,12 @@ class HtmlGenerator : public OutputGenerator void endPageRef(const char *,const char *) {} void startQuickIndexItem(const char *,const char *); void endQuickIndexItem(); - void writeFormula(const char *,const char *); + //void writeFormula(const char *,const char *); void writeNonBreakableSpace(int); - void startImage(const char *,const char *,bool); - void endImage(bool); - void startDotFile(const char *,bool); - void endDotFile(bool); + //void startImage(const char *,const char *,bool); + //void endImage(bool); + //void startDotFile(const char *,bool); + //void endDotFile(bool); void startDescTable() { t << "" << endl; } @@ -262,13 +262,13 @@ class HtmlGenerator : public OutputGenerator void startFontClass(const char *s) { t << ""; } void endFontClass() { t << ""; } - void startHtmlOnly() {} - void endHtmlOnly() {} - void startLatexOnly() {} - void endLatexOnly() {} + //void startHtmlOnly() {} + //void endHtmlOnly() {} + //void startLatexOnly() {} + //void endLatexOnly() {} - void startSectionRefList(); - void endSectionRefList(); + //void startSectionRefList(); + //void endSectionRefList(); void writeCodeAnchor(const char *anchor) { t << ""; } diff --git a/src/index.cpp b/src/index.cpp index bc75138..2073bb7 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1285,7 +1285,8 @@ void writeAnnotatedClassList(OutputList &ol) // write an alphabetical index of all class with a header for each letter void writeAlphabeticalClassList(OutputList &ol) { - ol.startAlphabeticalIndexList(); + //ol.startAlphabeticalIndexList(); + ol.writeString("
\n"); // first count the number of headers ClassSDict::Iterator cli(Doxygen::classSDict); @@ -1363,12 +1364,14 @@ void writeAlphabeticalClassList(OutputList &ol) // generate table for (i=0;i"); // the last column may contain less items then the others int colsInRow = (i"); ClassDef *cd = colIterators[j]->current(); //printf("columns [%d] cd=%p\n",j,cd); if (cd==(ClassDef *)8) // the class pointer is really a header @@ -1380,7 +1383,16 @@ void writeAlphabeticalClassList(OutputList &ol) int index = getPrefixIndex(cd->className()); startLetter=toupper(cd->className().at(index)); char s[2]; s[0]=startLetter; s[1]=0; - ol.writeIndexHeading(s); + //ol.writeIndexHeading(s); + ol.writeString("
" + "" + "" + "" + "
  "); + ol.writeString(s); + ol.writeString( "  " + "
\n"); + } } else if (cd) // a real class, insert a link @@ -1410,12 +1422,15 @@ void writeAlphabeticalClassList(OutputList &ol) //printf("item ClassDef=%p %s\n",cd,cd ? cd->name().data() : ""); ++(*colIterators[j]); } - ol.endTableColumn(); - if (j"); + //if (j"); } - ol.endAlphabeticalIndexList(); + //ol.endAlphabeticalIndexList(); + ol.writeString(""); // release the temporary memory for (i=0;iurl() << "}"; } - m_t << "{\\tt " << u->url() << "}"; + m_t << "{\\tt "; + filter(u->url()); + m_t << "}"; } void LatexDocVisitor::visit(DocLineBreak *) @@ -398,6 +400,10 @@ void LatexDocVisitor::visitPre(DocSimpleSect *s) { m_t << ":]"; } + else + { + m_insideItem=TRUE; + } } void LatexDocVisitor::visitPost(DocSimpleSect *) @@ -411,6 +417,7 @@ void LatexDocVisitor::visitPre(DocTitle *) void LatexDocVisitor::visitPost(DocTitle *) { + m_insideItem=FALSE; m_t << "]"; } @@ -517,10 +524,12 @@ void LatexDocVisitor::visitPost(DocHtmlDescList *) void LatexDocVisitor::visitPre(DocHtmlDescTitle *) { m_t << "\\item["; + m_insideItem=TRUE; } void LatexDocVisitor::visitPost(DocHtmlDescTitle *) { + m_insideItem=FALSE; m_t << "]"; } @@ -829,7 +838,9 @@ void LatexDocVisitor::visitPre(DocParamList *pl) for (li.toFirst();(s=li.current());++li) { if (!first) m_t << ","; else first=FALSE; - m_t << s; + m_insideItem=TRUE; + filter(s); + m_insideItem=FALSE; } m_t << "}]"; } @@ -850,7 +861,9 @@ void LatexDocVisitor::visitPre(DocXRefItem *x) { m_t << "{\\bf "; } + m_insideItem=TRUE; filter(x->title()); + m_insideItem=FALSE; m_t << "}]"; } @@ -888,7 +901,7 @@ void LatexDocVisitor::visitPost(DocText *) void LatexDocVisitor::filter(const char *str) { - filterLatexString(m_t,str,FALSE,m_insidePre); + filterLatexString(m_t,str,FALSE,m_insidePre,m_insideItem); } void LatexDocVisitor::startLink(const QString &ref,const QString &file,const QString &anchor) diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index 3ca3bfc..fbd2e3b 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -144,6 +144,7 @@ class LatexDocVisitor : public DocVisitor QTextStream &m_t; BaseCodeDocInterface &m_ci; bool m_insidePre; + bool m_insideItem; bool m_hide; }; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 5c49d23..ec74944 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -899,18 +899,18 @@ void LatexGenerator::endHtmlLink() t << "}"; } -void LatexGenerator::writeMailLink(const char *url) -{ - if (Config_getBool("PDF_HYPERLINKS")) - { - t << "\\href{mailto:"; - t << url; - t << "}"; - } - t << "{\\tt "; - docify(url); - t << "}"; -} +//void LatexGenerator::writeMailLink(const char *url) +//{ +// if (Config_getBool("PDF_HYPERLINKS")) +// { +// t << "\\href{mailto:"; +// t << url; +// t << "}"; +// } +// t << "{\\tt "; +// docify(url); +// t << "}"; +//} void LatexGenerator::writeStartAnnoItem(const char *,const char *, const char *path,const char *name) @@ -1238,49 +1238,49 @@ void LatexGenerator::endSection(const char *lab,SectionInfo::SectionType) t << "}\\label{" << lab << "}" << endl; } -void LatexGenerator::writeSectionRef(const char *ref,const char *, - const char *lab,const char *text) -{ - if (ref) // external reference - { - docify(text); - } - else // local reference - { - if (text && Config_getBool("PDF_HYPERLINKS")) - { - t << "\\hyperlink{"; - if (lab) t << lab; - t << "}{"; - docify(text); - t << "}"; - //t << " {\\rm (p.\\,\\pageref{" << lab << "})}"; - } - else - { - if (strcmp(lab,text)!=0) // lab!=text - { - // todo: don't hardcode p. here! - t << "{\\bf "; - docify(text); - t << "} {\\rm (p.\\,\\pageref{" << lab << "})}"; - } - else - { - t << "\\ref{" << lab << "}"; - } - } - } -} - -void LatexGenerator::writeSectionRefItem(const char *,const char *lab, - const char *title) -{ - t << "\\item \\contentsline{section}{"; - docify(title); - t << "}{\\ref{" << lab << "}}{}" << endl; -} - +//void LatexGenerator::writeSectionRef(const char *ref,const char *, +// const char *lab,const char *text) +//{ +// if (ref) // external reference +// { +// docify(text); +// } +// else // local reference +// { +// if (text && Config_getBool("PDF_HYPERLINKS")) +// { +// t << "\\hyperlink{"; +// if (lab) t << lab; +// t << "}{"; +// docify(text); +// t << "}"; +// //t << " {\\rm (p.\\,\\pageref{" << lab << "})}"; +// } +// else +// { +// if (strcmp(lab,text)!=0) // lab!=text +// { +// // todo: don't hardcode p. here! +// t << "{\\bf "; +// docify(text); +// t << "} {\\rm (p.\\,\\pageref{" << lab << "})}"; +// } +// else +// { +// t << "\\ref{" << lab << "}"; +// } +// } +// } +//} +// +//void LatexGenerator::writeSectionRefItem(const char *,const char *lab, +// const char *title) +//{ +// t << "\\item \\contentsline{section}{"; +// docify(title); +// t << "}{\\ref{" << lab << "}}{}" << endl; +//} +// // TODO: remove this function //void LatexGenerator::writeSectionRefAnchor(const char *,const char *lab, // const char *title) @@ -1420,10 +1420,10 @@ void LatexGenerator::endClassDiagram(ClassDiagram &d, d.writeFigure(t,dir,fileName); } -void LatexGenerator::writeFormula(const char *,const char *text) -{ - t << text; -} +//void LatexGenerator::writeFormula(const char *,const char *text) +//{ +// t << text; +//} void LatexGenerator::startMemberItem(int annType) { @@ -1479,86 +1479,86 @@ void LatexGenerator::endMemberList() t << "\\end{CompactItemize}" << endl; } -void LatexGenerator::startImage(const char *name,const char *size,bool hasCaption) -{ - if (hasCaption) - { - t << "\\begin{figure}[H]" << endl; - t << "\\begin{center}" << endl; - } - else - { - t << "\\mbox{"; - } - QCString gfxName = name; - if (gfxName.right(4)==".eps") gfxName.left(gfxName.length()-4); - // "\\epsfig{file=" << name; - t << "\\includegraphics"; - if (size) t << "[" << size << "]"; - t << "{" << gfxName << "}"; - if (hasCaption) - { - t << "\\caption{"; - } - else - { - t << "}" << endl; - } -} - -void LatexGenerator::endImage(bool hasCaption) -{ - if (hasCaption) - { - t << "}" << endl; - t << "\\end{center}" << endl; - t << "\\end{figure}" << endl; - } -} - -void LatexGenerator::startDotFile(const char *name,bool hasCaption) -{ - QCString baseName=name; - int i; - if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) - { - baseName=baseName.right(baseName.length()-i-1); - } - QCString outDir = Config_getString("LATEX_OUTPUT"); - writeDotGraphFromFile(name,outDir,baseName,EPS); - if (hasCaption) - { - t << "\\begin{figure}[H]" << endl; - t << "\\begin{center}" << endl; - } - else - t << "\\mbox{"; - t << "\\includegraphics"; - if( Config_getBool("USE_PDFLATEX") ) - { - t << "{" << baseName << ".pdf}"; - } - else - { - t << "{" << baseName << ".eps}"; - } - - if (hasCaption) - t << "\\caption{"; - else - t << "}" << endl; -} - -void LatexGenerator::endDotFile(bool hasCaption) -{ - if (hasCaption) - { - t << "}" << endl; - t << "\\end{center}" << endl; - t << "\\end{figure}" << endl; - } -} - +//void LatexGenerator::startImage(const char *name,const char *size,bool hasCaption) +//{ +// if (hasCaption) +// { +// t << "\\begin{figure}[H]" << endl; +// t << "\\begin{center}" << endl; +// } +// else +// { +// t << "\\mbox{"; +// } +// QCString gfxName = name; +// if (gfxName.right(4)==".eps") gfxName.left(gfxName.length()-4); +// // "\\epsfig{file=" << name; +// t << "\\includegraphics"; +// if (size) t << "[" << size << "]"; +// t << "{" << gfxName << "}"; +// if (hasCaption) +// { +// t << "\\caption{"; +// } +// else +// { +// t << "}" << endl; +// } +//} +// +//void LatexGenerator::endImage(bool hasCaption) +//{ +// if (hasCaption) +// { +// t << "}" << endl; +// t << "\\end{center}" << endl; +// t << "\\end{figure}" << endl; +// } +//} +// +//void LatexGenerator::startDotFile(const char *name,bool hasCaption) +//{ +// QCString baseName=name; +// int i; +// if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) +// { +// baseName=baseName.right(baseName.length()-i-1); +// } +// QCString outDir = Config_getString("LATEX_OUTPUT"); +// writeDotGraphFromFile(name,outDir,baseName,EPS); +// if (hasCaption) +// { +// t << "\\begin{figure}[H]" << endl; +// t << "\\begin{center}" << endl; +// } +// else +// t << "\\mbox{"; +// t << "\\includegraphics"; +// if( Config_getBool("USE_PDFLATEX") ) +// { +// t << "{" << baseName << ".pdf}"; +// } +// else +// { +// t << "{" << baseName << ".eps}"; +// } +// +// if (hasCaption) +// t << "\\caption{"; +// else +// t << "}" << endl; +//} +// +//void LatexGenerator::endDotFile(bool hasCaption) +//{ +// if (hasCaption) +// { +// t << "}" << endl; +// t << "\\end{center}" << endl; +// t << "\\end{figure}" << endl; +// } +//} +// void LatexGenerator::startMemberGroupHeader(bool hasHeader) { @@ -1671,19 +1671,19 @@ void LatexGenerator::endParamList() t << "\\end{Desc}" << endl; } -void LatexGenerator::startSectionRefList() -{ - t << "\\footnotesize" << endl; - t << "\\begin{multicols}{2}" << endl; - t << "\\begin{CompactList}" << endl; -} +//void LatexGenerator::startSectionRefList() +//{ +// t << "\\footnotesize" << endl; +// t << "\\begin{multicols}{2}" << endl; +// t << "\\begin{CompactList}" << endl; +//} -void LatexGenerator::endSectionRefList() -{ - t << "\\end{CompactList}" << endl; - t << "\\end{multicols}" << endl; - t << "\\normalsize" << endl; -} +//void LatexGenerator::endSectionRefList() +//{ +// t << "\\end{CompactList}" << endl; +// t << "\\end{multicols}" << endl; +// t << "\\normalsize" << endl; +//} void LatexGenerator::printDoc(DocNode *n) { diff --git a/src/latexgen.h b/src/latexgen.h index 11a0516..d6c9d67 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -71,11 +71,11 @@ class LatexGenerator : public OutputGenerator void endIndexValue(const char *,bool); void startItemList() { t << "\\begin{CompactItemize}" << endl; } void endItemList() { t << "\\end{CompactItemize}" << endl; } - void startEnumList() { t << "\\begin{enumerate}" << endl; } - void endEnumList() { t << "\\end{enumerate}" << endl; } - void startAlphabeticalIndexList() {} - void endAlphabeticalIndexList() {} - void writeIndexHeading(const char *) {} + //void startEnumList() { t << "\\begin{enumerate}" << endl; } + //void endEnumList() { t << "\\end{enumerate}" << endl; } + //void startAlphabeticalIndexList() {} + //void endAlphabeticalIndexList() {} + //void writeIndexHeading(const char *) {} void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); void codify(const char *text); @@ -87,7 +87,7 @@ class LatexGenerator : public OutputGenerator void endTextLink(); void startHtmlLink(const char *url); void endHtmlLink(); - void writeMailLink(const char *url); + //void writeMailLink(const char *url); void startTypewriter() { t << "{\\tt "; } void endTypewriter() { t << "}"; } void startGroupHeader(); @@ -118,14 +118,14 @@ class LatexGenerator : public OutputGenerator void writeAnchor(const char *fileName,const char *name); void startCodeFragment() { t << endl << endl << "\\footnotesize\\begin{verbatim}"; } void endCodeFragment() { t << "\\end{verbatim}\\normalsize " << endl; } - void startPreFragment() { t << "\\small\\begin{alltt}"; - insidePre=TRUE; - } - void endPreFragment() { t << "\\end{alltt}\\normalsize " << endl; - insidePre=FALSE; - } - void startVerbatimFragment() { t << endl << endl << "\\footnotesize\\begin{verbatim}"; } - void endVerbatimFragment() { t << "\\end{verbatim}\\normalsize " << endl; } + //void startPreFragment() { t << "\\small\\begin{alltt}"; + // insidePre=TRUE; + // } + //void endPreFragment() { t << "\\end{alltt}\\normalsize " << endl; + // insidePre=FALSE; + // } + //void startVerbatimFragment() { t << endl << endl << "\\footnotesize\\begin{verbatim}"; } + //void endVerbatimFragment() { t << "\\end{verbatim}\\normalsize " << endl; } void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; } void startCodeLine() { col=0; } void endCodeLine() { codify("\n"); } @@ -160,52 +160,52 @@ class LatexGenerator : public OutputGenerator void endCenter() { t << "\\end{center}" << endl; } void startSmall() { t << "\\footnotesize "; } void endSmall() { t << "\\normalsize "; } - void startSubscript() { t << "$_{\\mbox{"; } - void endSubscript() { t << "}}$"; } - void startSuperscript() { t << "$^{\\mbox{"; } - void endSuperscript() { t << "}}$"; } - void startTable(bool hasCaption,int c) - { - if (hasCaption) t << "\\begin{table}[h]"; - t << "\\begin{TabularC}{" << c << "}\n\\hline\n"; - } - void endTable(bool hasCaption) - { - if (hasCaption) - { - t << "\\end{table}\n"; - } - else - { - t << "\\\\\\hline\n\\end{TabularC}\n"; - } - } - void startCaption() { t << "\\\\\\hline\n\\end{TabularC}\n" - "\\centering\n\\caption{"; - } - void endCaption() { t << "}\n"; } - void nextTableRow() {} - void endTableRow() { t << "\\\\\\hline\n"; } - void nextTableColumn() { t << "&"; } - void endTableColumn() {} - void writeCopyright() { t << "\\copyright"; } - void writeQuote() { t << "''"; } - void writeUmlaut(char c) { if (c=='i') t << "\\\"{\\i}"; else - t << "\\\"{" << c << "}"; - } - void writeAcute(char c) { if (c=='i') t << "\\'{\\i}"; else - t << "\\'{" << c << "}"; - } - void writeGrave(char c) { if (c=='i') t << "\\`{\\i}"; else - t << "\\`{" << c << "}"; - } - void writeCirc(char c) { if (c=='i') t << "\\^{\\i}"; else - t << "\\^{" << c << "}"; - } - void writeTilde(char c) { t << "\\~{" << c << "}"; } - void writeRing(char c) { t << "\\" << c << c; } - void writeSharpS() { t << "\"s"; } - void writeCCedil(char c) { t << "\\c{" << c << "}"; } + //void startSubscript() { t << "$_{\\mbox{"; } + //void endSubscript() { t << "}}$"; } + //void startSuperscript() { t << "$^{\\mbox{"; } + //void endSuperscript() { t << "}}$"; } + //void startTable(bool hasCaption,int c) + // { + // if (hasCaption) t << "\\begin{table}[h]"; + // t << "\\begin{TabularC}{" << c << "}\n\\hline\n"; + // } + //void endTable(bool hasCaption) + // { + // if (hasCaption) + // { + // t << "\\end{table}\n"; + // } + // else + // { + // t << "\\\\\\hline\n\\end{TabularC}\n"; + // } + // } + //void startCaption() { t << "\\\\\\hline\n\\end{TabularC}\n" + // "\\centering\n\\caption{"; + // } + //void endCaption() { t << "}\n"; } + //void nextTableRow() {} + //void endTableRow() { t << "\\\\\\hline\n"; } + //void nextTableColumn() { t << "&"; } + //void endTableColumn() {} + //void writeCopyright() { t << "\\copyright"; } + //void writeQuote() { t << "''"; } + //void writeUmlaut(char c) { if (c=='i') t << "\\\"{\\i}"; else + // t << "\\\"{" << c << "}"; + // } + //void writeAcute(char c) { if (c=='i') t << "\\'{\\i}"; else + // t << "\\'{" << c << "}"; + // } + //void writeGrave(char c) { if (c=='i') t << "\\`{\\i}"; else + // t << "\\`{" << c << "}"; + // } + //void writeCirc(char c) { if (c=='i') t << "\\^{\\i}"; else + // t << "\\^{" << c << "}"; + // } + //void writeTilde(char c) { t << "\\~{" << c << "}"; } + //void writeRing(char c) { t << "\\" << c << c; } + //void writeSharpS() { t << "\"s"; } + //void writeCCedil(char c) { t << "\\c{" << c << "}"; } void startMemberDescription() { t << "\\begin{CompactList}\\small\\item\\em "; } void endMemberDescription() { t << "\\item\\end{CompactList}"; } void startDescList(SectionTypes) { t << "\\begin{Desc}\n\\item["; } @@ -214,12 +214,12 @@ class LatexGenerator : public OutputGenerator void endSimpleSect(); void startParamList(ParamListTypes,const char *title); void endParamList(); - void endDescTitle() { t << "]"; } + //void endDescTitle() { t << "]"; } void writeDescItem() { t << "\\par" << endl; } void startSection(const char *,const char *,SectionInfo::SectionType); void endSection(const char *,SectionInfo::SectionType); - void writeSectionRef(const char *,const char *,const char *,const char *); - void writeSectionRefItem(const char *,const char *,const char *); + //void writeSectionRef(const char *,const char *,const char *,const char *); + //void writeSectionRefItem(const char *,const char *,const char *); //void writeSectionRefAnchor(const char *,const char *,const char *); void addIndexItem(const char *,const char *); void startIndent() {} @@ -234,12 +234,12 @@ class LatexGenerator : public OutputGenerator void endPageRef(const char *,const char *); void startQuickIndexItem(const char *,const char *) {} void endQuickIndexItem() {} - void writeFormula(const char *,const char *); + //void writeFormula(const char *,const char *); void writeNonBreakableSpace(int); - void startImage(const char *,const char *,bool); - void endImage(bool); - void startDotFile(const char *,bool); - void endDotFile(bool); + //void startImage(const char *,const char *,bool); + //void endImage(bool); + //void startDotFile(const char *,bool); + //void endDotFile(bool); void startDescTable() { t << "\\begin{description}" << endl; } @@ -278,13 +278,13 @@ class LatexGenerator : public OutputGenerator void startFontClass(const char *) {} void endFontClass() {} - void startHtmlOnly() {} - void endHtmlOnly() {} - void startLatexOnly() {} - void endLatexOnly() {} + //void startHtmlOnly() {} + //void endHtmlOnly() {} + //void startLatexOnly() {} + //void endLatexOnly() {} - void startSectionRefList(); - void endSectionRefList(); + //void startSectionRefList(); + //void endSectionRefList(); void writeCodeAnchor(const char *) {} diff --git a/src/mangen.cpp b/src/mangen.cpp index a048b5e..cc55ebe 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -213,10 +213,10 @@ void ManGenerator::endHtmlLink() { } -void ManGenerator::writeMailLink(const char *url) -{ - docify(url); -} +//void ManGenerator::writeMailLink(const char *url) +//{ +// docify(url); +//} void ManGenerator::startGroupHeader() { @@ -451,11 +451,11 @@ void ManGenerator::startDescItem() firstCol=FALSE; } -void ManGenerator::endDescTitle() -{ - endBold(); - paragraph=TRUE; -} +//void ManGenerator::endDescTitle() +//{ +// endBold(); +// paragraph=TRUE; +//} void ManGenerator::writeDescItem() { diff --git a/src/mangen.h b/src/mangen.h index 3f81dfc..72f9b02 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -69,11 +69,11 @@ class ManGenerator : public OutputGenerator void endIndexValue(const char *,bool) {} void startItemList() {} void endItemList() { newParagraph(); } - void startEnumList() {} - void endEnumList() { newParagraph(); } - void startAlphabeticalIndexList() {} - void endAlphabeticalIndexList() {} - void writeIndexHeading(const char *) {} + //void startEnumList() {} + //void endEnumList() { newParagraph(); } + //void startAlphabeticalIndexList() {} + //void endAlphabeticalIndexList() {} + //void writeIndexHeading(const char *) {} void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); void codify(const char *text); @@ -85,7 +85,7 @@ class ManGenerator : public OutputGenerator void endTextLink() {} void startHtmlLink(const char *url); void endHtmlLink(); - void writeMailLink(const char *url); + //void writeMailLink(const char *url); void startTypewriter() { t << "\\fC"; firstCol=FALSE; } void endTypewriter() { t << "\\fP"; firstCol=FALSE; } void startGroupHeader(); @@ -114,10 +114,10 @@ class ManGenerator : public OutputGenerator void writeAnchor(const char *,const char *) {} void startCodeFragment(); void endCodeFragment(); - void startPreFragment() { startCodeFragment(); } - void endPreFragment() { endCodeFragment(); } - void startVerbatimFragment() { startCodeFragment(); } - void endVerbatimFragment() { endCodeFragment(); } + //void startPreFragment() { startCodeFragment(); } + //void endPreFragment() { endCodeFragment(); } + //void startVerbatimFragment() { startCodeFragment(); } + //void endVerbatimFragment() { endCodeFragment(); } void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; } void startCodeLine() {} void endCodeLine() { codify("\n"); col=0; } @@ -152,33 +152,33 @@ class ManGenerator : public OutputGenerator void endCenter() {} void startSmall() {} void endSmall() {} - void startSubscript() { t << "\\*<"; firstCol=FALSE; } - void endSubscript() { t << "\\*>"; firstCol=FALSE; } - void startSuperscript() { t << "\\*{"; firstCol=FALSE; } - void endSuperscript() { t << "\\*}"; firstCol=FALSE; } - void startTable(bool,int) {} - void endTable(bool) {} - void startCaption() {} - void endCaption() {} - void nextTableRow() {} - void endTableRow() {} - void nextTableColumn() {} - void endTableColumn() {} - void writeCopyright() { t << "(c)"; firstCol=FALSE; } - void writeQuote() { t << "`"; firstCol=FALSE; } - void writeUmlaut(char c) { t << c << "\\*'"; firstCol=FALSE; } - void writeAcute(char c) { t << c << "\\*`"; firstCol=FALSE; } - void writeGrave(char c) { t << c << "\\*:"; firstCol=FALSE; } - void writeCirc(char c) { t << c << "\\*^"; firstCol=FALSE; } - void writeTilde(char c) { t << c << "\\*~"; firstCol=FALSE; } - void writeRing(char c) { t << c << "\\*0"; /* just a wild guess, - need to check! */ - firstCol=FALSE; } - void writeSharpS() { t << "s\\*:"; /* just a wild guess, - need to check! */ - firstCol=FALSE; } - void writeCCedil(char c) { t << c; /* TODO: fix this */ - firstCol=FALSE; } + //void startSubscript() { t << "\\*<"; firstCol=FALSE; } + //void endSubscript() { t << "\\*>"; firstCol=FALSE; } + //void startSuperscript() { t << "\\*{"; firstCol=FALSE; } + //void endSuperscript() { t << "\\*}"; firstCol=FALSE; } + //void startTable(bool,int) {} + //void endTable(bool) {} + //void startCaption() {} + //void endCaption() {} + //void nextTableRow() {} + //void endTableRow() {} + //void nextTableColumn() {} + //void endTableColumn() {} + //void writeCopyright() { t << "(c)"; firstCol=FALSE; } + //void writeQuote() { t << "`"; firstCol=FALSE; } + //void writeUmlaut(char c) { t << c << "\\*'"; firstCol=FALSE; } + //void writeAcute(char c) { t << c << "\\*`"; firstCol=FALSE; } + //void writeGrave(char c) { t << c << "\\*:"; firstCol=FALSE; } + //void writeCirc(char c) { t << c << "\\*^"; firstCol=FALSE; } + //void writeTilde(char c) { t << c << "\\*~"; firstCol=FALSE; } + //void writeRing(char c) { t << c << "\\*0"; /* just a wild guess, + // need to check! */ + // firstCol=FALSE; } + //void writeSharpS() { t << "s\\*:"; /* just a wild guess, + // need to check! */ + // firstCol=FALSE; } + //void writeCCedil(char c) { t << c; /* TODO: fix this */ + // firstCol=FALSE; } void startMemberDescription() { t << "\n.RI \"\\fI"; firstCol=FALSE; } void endMemberDescription() { t << "\\fP\""; firstCol=FALSE; } void startDescList(SectionTypes); @@ -187,12 +187,12 @@ class ManGenerator : public OutputGenerator void endSimpleSect(); void startParamList(ParamListTypes,const char *title); void endParamList(); - void endDescTitle(); + //void endDescTitle(); void writeDescItem(); void startSection(const char *,const char *,SectionInfo::SectionType); void endSection(const char *,SectionInfo::SectionType); - void writeSectionRef(const char *,const char *,const char *,const char *) {} - void writeSectionRefItem(const char *,const char *,const char *) {} + //void writeSectionRef(const char *,const char *,const char *,const char *) {} + //void writeSectionRefItem(const char *,const char *,const char *) {} //void writeSectionRefAnchor(const char *,const char *,const char *) {} void addIndexItem(const char *,const char *) {} void startIndent() {} @@ -207,12 +207,12 @@ class ManGenerator : public OutputGenerator void endPageRef(const char *,const char *) {} void startQuickIndexItem(const char *,const char *) {} void endQuickIndexItem() {} - void writeFormula(const char *,const char *) {} + //void writeFormula(const char *,const char *) {} void writeNonBreakableSpace(int n) { int i; for (i=0;ienumDecl(); + getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd); + //ol+=*getAnonymousEnumType()->enumDecl(); linkifyText(TextGeneratorOLImpl(ol),cname,name(),ltype.right(ltype.length()-i-l),TRUE); } else @@ -1053,7 +1055,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, htmlHelp->addIndexItem(cname,name(),cfname,anchor()); } linkifyText(TextGeneratorOLImpl(ol),scopeName,name(),ldef.left(i)); - ol+=*vmd->enumDecl(); + //ol+=*vmd->enumDecl(); + vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef()); linkifyText(TextGeneratorOLImpl(ol),scopeName,name(),ldef.right(ldef.length()-i-l)); found=TRUE; @@ -1169,7 +1172,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, isFriend() || isRelated() || isExplicit() || isMutable() || (isInline() && Config_getBool("INLINE_INFO")) || isSignal() || isSlot() || - isStatic() || (classDef && classDef!=container) + isStatic() || (classDef && classDef!=container) || + isSettable() || isGettable() ) { // write the member specifier list @@ -1186,6 +1190,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (isExplicit()) sl.append("explicit"); if (isMutable()) sl.append("mutable"); if (isStatic()) sl.append("static"); + if (isGettable()) sl.append("get"); + if (isSettable()) sl.append("set"); if (protection()==Protected) sl.append("protected"); else if (protection()==Private) sl.append("private"); if (lvirt==Virtual) sl.append("virtual"); @@ -1585,11 +1591,11 @@ bool MemberDef::isLinkable() const } } -void MemberDef::setEnumDecl(OutputList &ed) -{ - enumDeclList=new OutputList(&ed); - *enumDeclList+=ed; -} +//void MemberDef::setEnumDecl(OutputList &ed) +//{ +// enumDeclList=new OutputList(&ed); +// *enumDeclList+=ed; +//} bool MemberDef::isDocumentedFriendClass() const { @@ -1706,6 +1712,7 @@ MemberDef *MemberDef::createTemplateInstanceMember( imd->def = substituteTemplateArgumentsInString(def,formalArgs,actualArgs); imd->setBodyDef(getBodyDef()); imd->setBodySegment(getStartBodyLine(),getEndBodyLine()); + imd->setBodyMember(this); // TODO: init other member variables (if needed). // TODO: reimplemented info @@ -1796,3 +1803,122 @@ bool MemberDef::isDestructor() const return name().find('~')!=-1 && name().find("operator")==-1; } +void MemberDef::writeEnumDeclaration(OutputList &typeDecl, + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd) +{ + int enumMemCount=0; + + QList *fmdl=enumFieldList(); + uint numVisibleEnumValues=0; + if (fmdl) + { + MemberDef *fmd=fmdl->first(); + while (fmd) + { + if (fmd->isBriefSectionVisible()) numVisibleEnumValues++; + fmd=fmdl->next(); + } + } + if (numVisibleEnumValues==0 && !isBriefSectionVisible()) return; + + QCString n = name(); + int i=n.findRev("::"); + if (i!=-1) n=n.right(n.length()-i-2); // strip scope (TODO: is this needed?) + if (n[0]!='@') // not an anonymous enum + { + if (isLinkableInProject() || hasDocumentedEnumValues()) + { + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + Doxygen::tagFile << " " << endl; + Doxygen::tagFile << " " << convertToXML(name()) << "" << endl; + Doxygen::tagFile << " " << convertToXML(anchor()) << "" << endl; + Doxygen::tagFile << " " << convertToXML(argsString()) << "" << endl; + Doxygen::tagFile << " " << endl; + } + writeLink(typeDecl,cd,nd,fd,gd); + } + else + { + typeDecl.startBold(); + typeDecl.docify(n); + typeDecl.endBold(); + } + typeDecl.writeChar(' '); + } + + if (numVisibleEnumValues>0) + { + uint enumValuesPerLine = (uint)Config_getInt("ENUM_VALUES_PER_LINE"); + typeDecl.docify("{ "); + if (fmdl) + { + MemberDef *fmd=fmdl->first(); + bool fmdVisible = fmd->isBriefSectionVisible(); + while (fmd) + { + if (fmdVisible) + { + /* in html we start a new line after a number of items */ + if (numVisibleEnumValues>enumValuesPerLine + && (enumMemCount%enumValuesPerLine)==0 + ) + { + typeDecl.pushGeneratorState(); + typeDecl.disableAllBut(OutputGenerator::Html); + typeDecl.lineBreak(); + typeDecl.writeString("  "); + typeDecl.popGeneratorState(); + } + + if (fmd->hasDocumentation()) // enum value has docs + { + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + Doxygen::tagFile << " " << endl; + Doxygen::tagFile << " " << convertToXML(fmd->name()) << "" << endl; + Doxygen::tagFile << " " << convertToXML(fmd->anchor()) << "" << endl; + Doxygen::tagFile << " " << convertToXML(fmd->argsString()) << "" << endl; + Doxygen::tagFile << " " << endl; + } + fmd->writeLink(typeDecl,cd,nd,fd,gd); + } + else // no docs for this enum value + { + typeDecl.startBold(); + typeDecl.docify(fmd->name()); + typeDecl.endBold(); + } + if (fmd->hasOneLineInitializer()) // enum value has initializer + { + typeDecl.writeString(" = "); + typeDecl.parseText(fmd->initializer()); + } + } + + bool prevVisible = fmdVisible; + fmd=fmdl->next(); + if (fmd && (fmdVisible=fmd->isBriefSectionVisible())) + { + typeDecl.writeString(", "); + } + if (prevVisible) + { + typeDecl.disable(OutputGenerator::Man); + typeDecl.writeString("\n"); // to prevent too long lines in LaTeX + typeDecl.enable(OutputGenerator::Man); + enumMemCount++; + } + } + if (numVisibleEnumValues>enumValuesPerLine) + { + typeDecl.pushGeneratorState(); + typeDecl.disableAllBut(OutputGenerator::Html); + typeDecl.lineBreak(); + typeDecl.popGeneratorState(); + } + } + typeDecl.docify(" }"); + } +} + diff --git a/src/memberdef.h b/src/memberdef.h index 8755f4e..5be5285 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -60,7 +60,8 @@ class MemberDef : public Definition Slot, Friend, DCOP, - Property + Property, + Event }; MemberDef(const char *defFileName,int defLine, @@ -114,11 +115,14 @@ class MemberDef : public Definition bool isFriend() const { return mtype==Friend; } bool isDCOP() const { return mtype==DCOP; } bool isProperty() const { return mtype==Property; } + bool isEvent() const { return mtype==Event; } bool isRelated() const { return related; } bool isStatic() const { return stat; } bool isInline() const { return (memSpec&Entry::Inline)!=0; } bool isExplicit() const { return (memSpec&Entry::Explicit)!=0; } bool isMutable() const { return (memSpec&Entry::Mutable)!=0; } + bool isGettable() const { return (memSpec&Entry::Gettable)!=0; } + bool isSettable() const { return (memSpec&Entry::Settable)!=0; } bool isExternal() const { return explExt; } bool isConstructor() const; bool isDestructor() const; @@ -173,10 +177,10 @@ class MemberDef : public Definition void insertEnumField(MemberDef *md); void setEnumScope(MemberDef *md); MemberDef *getEnumScope() const { return enumScope; } - void setEnumDecl(OutputList &ed); //void setEnumUsed() { eUsed=TRUE; } //bool enumUsed() const { return eUsed; } - OutputList *enumDecl() const { return enumDeclList; } + //void setEnumDecl(OutputList &ed); + //OutputList *enumDecl() const { return enumDeclList; } MemberList *enumFieldList() const { return enumFields; } void setDocumentedEnumValues(bool value) { docEnumValues=value; } bool hasDocumentedEnumValues() const { return docEnumValues; } @@ -252,6 +256,10 @@ class MemberDef : public Definition MemberDef *memberDefinition() const { return memDef; } MemberDef *memberDeclaration() const { return memDec; } + void writeEnumDeclaration(OutputList &typeDecl, + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); + + bool visited; private: diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 6c718e7..8f748a0 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -66,6 +66,7 @@ void MemberList::countDecMembers() switch(md->memberType()) { case MemberDef::Variable: // fall through + case MemberDef::Event: // fall through case MemberDef::Property: m_varCnt++,m_numDecMembers++; break; case MemberDef::Function: // fall through @@ -189,7 +190,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, case MemberDef::Signal: // fall through case MemberDef::Slot: // fall through case MemberDef::DCOP: // fall through - case MemberDef::Property: + case MemberDef::Property: // fall through + case MemberDef::Event: { if (first) ol.startMemberList(),first=FALSE; md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); @@ -198,6 +200,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, case MemberDef::Enumeration: { if (first) ol.startMemberList(),first=FALSE; +#if 0 OutputList typeDecl(&ol); QCString name(md->name()); int i=name.findRev("::"); @@ -313,9 +316,13 @@ void MemberList::writePlainDeclarations(OutputList &ol, typeDecl.docify(" }"); md->setEnumDecl(typeDecl); } +#endif int enumVars=0; MemberListIterator vmli(*this); MemberDef *vmd; + QCString name(md->name()); + int i=name.findRev("::"); + if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) if (name[0]=='@') // anonymous enum => append variables { for ( ; (vmd=vmli.current()) ; ++vmli) @@ -335,7 +342,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, ol.startMemberItem(0); ol.writeString("enum "); ol.insertMemberAlign(); - ol+=typeDecl; // append the enum values. + //ol+=typeDecl; // append the enum values. + md->writeEnumDeclaration(ol,cd,nd,fd,gd); ol.endMemberItem(FALSE); if (!md->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { diff --git a/src/outputgen.h b/src/outputgen.h index bd432ca..104a09b 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -66,12 +66,13 @@ class BaseCodeDocInterface virtual void writeCodeAnchor(const char *name) = 0; }; -/*! \brief Base Interface used for generating documentation. +/*! \brief Base Interface used for generating output outside of the + * comment blocks. * - * This abstract class is used by the documentation block - * parser to generate the output for a specific format, + * This abstract class is used by output generation functions + * to generate the output for a specific format, * or a list of formats (see OutputList). This interface - * contains functions that generate output. + * contains functions that generate fragments of the output. */ class BaseOutputDocInterface : public BaseCodeDocInterface { @@ -232,62 +233,10 @@ class BaseOutputDocInterface : public BaseCodeDocInterface virtual void endTextLink() = 0; virtual void startPageRef() = 0; virtual void endPageRef(const char *,const char *) = 0; - - - /********************* Functions to remove *******************************/ - - virtual void writeMailLink(const char *url) = 0; - virtual void startPreFragment() = 0; - virtual void endPreFragment() = 0; - virtual void startVerbatimFragment() = 0; - virtual void endVerbatimFragment() = 0; virtual void startSubsection() = 0; virtual void endSubsection() = 0; virtual void startSubsubsection() = 0; virtual void endSubsubsection() = 0; - virtual void startSubscript() = 0; - virtual void endSubscript() = 0; - virtual void startSuperscript() = 0; - virtual void endSuperscript() = 0; - virtual void startTable(bool hasCaption,int cols) = 0; - virtual void endTable(bool hasCaption) = 0; - virtual void startCaption() = 0; - virtual void endCaption() = 0; - virtual void nextTableRow() = 0; - virtual void endTableRow() = 0; - virtual void nextTableColumn() = 0; - virtual void endTableColumn() = 0; - virtual void writeQuote() = 0; - virtual void writeCopyright() = 0; - virtual void writeUmlaut(char) = 0; - virtual void writeAcute(char) = 0; - virtual void writeGrave(char) = 0; - virtual void writeCirc(char) = 0; - virtual void writeTilde(char) = 0; - virtual void writeRing(char) = 0; - virtual void writeSharpS() = 0; - virtual void writeCCedil(char) = 0; - virtual void endDescTitle() = 0; - virtual void writeSectionRef(const char *,const char *, - const char *,const char *) = 0; - virtual void writeSectionRefItem(const char *,const char *,const char *) = 0; - virtual void startEnumList() = 0; - - virtual void endEnumList() = 0; - virtual void startImage(const char *,const char *,bool) = 0; - virtual void endImage(bool) = 0; - virtual void startDotFile(const char *,bool) = 0; - virtual void endDotFile(bool) = 0; - virtual void writeFormula(const char *,const char *) = 0; - virtual void startHtmlOnly() = 0; - virtual void endHtmlOnly() = 0; - virtual void startLatexOnly() = 0; - virtual void endLatexOnly() = 0; - virtual void startSectionRefList() = 0; - virtual void endSectionRefList() = 0; - - /************************************************************************/ - }; /*! \brief Abstract output generator. @@ -306,7 +255,7 @@ class OutputGenerator : public BaseOutputDocInterface // generic generator methods /////////////////////////////////////////////////////////////// virtual OutputGenerator *copy() = 0; - virtual void append(const OutputGenerator *) = 0; + //virtual void append(const OutputGenerator *) = 0; virtual void enable() = 0; virtual void disable() = 0; virtual void enableIf(OutputType o) = 0; @@ -314,8 +263,8 @@ class OutputGenerator : public BaseOutputDocInterface virtual void disableIfNot(OutputType o) = 0; virtual bool isEnabled(OutputType o) = 0; virtual OutputGenerator *get(OutputType o) = 0; - void clear() { b.close(); a.resize(0); b.setBuffer(a); - b.open(IO_WriteOnly); t.setDevice(&b); } + //void clear() { b.close(); a.resize(0); b.setBuffer(a); + // b.open(IO_WriteOnly); t.setDevice(&b); } void startPlainFile(const char *name); void endPlainFile(); QCString getContents() const; @@ -345,9 +294,6 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endIndexKey() = 0; virtual void startIndexValue(bool) = 0; virtual void endIndexValue(const char *,bool) = 0; - virtual void startAlphabeticalIndexList() = 0; - virtual void endAlphabeticalIndexList() = 0; - virtual void writeIndexHeading(const char *s) = 0; virtual void writeIndexItem(const char *ref,const char *file, const char *text) = 0; virtual void startGroupHeader() = 0; @@ -466,7 +412,7 @@ class OutputDocInterface : public BaseOutputDocInterface /*! Appends the output generated by generator \a g to this * generator. */ - virtual void append(const OutputDocInterface *g) = 0; + //virtual void append(const OutputDocInterface *g) = 0; /*! Pushes the state of the current generator (or list of * generators) on a stack. diff --git a/src/outputlist.cpp b/src/outputlist.cpp index 8b9781b..b580a58 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -156,20 +156,20 @@ bool OutputList::isEnabled(OutputGenerator::OutputType o) return result; } -OutputList &OutputList::operator+=(const OutputList &outputList) -{ - OutputList *ol=(OutputList *)&outputList; - OutputGenerator *ogsrc=ol->outputs->first(); - OutputGenerator *ogdst=outputs->first(); - //printf("OutputList::operator+= src=%d dst=%d\n",outputs->count(),ol->outputs->count()); - while (ogdst && ogsrc) - { - ogdst->append(ogsrc); - ogsrc=ol->outputs->next(); - ogdst=outputs->next(); - } - return *this; -} +//OutputList &OutputList::operator+=(const OutputList &outputList) +//{ +// OutputList *ol=(OutputList *)&outputList; +// OutputGenerator *ogsrc=ol->outputs->first(); +// OutputGenerator *ogdst=outputs->first(); +// //printf("OutputList::operator+= src=%d dst=%d\n",outputs->count(),ol->outputs->count()); +// while (ogdst && ogsrc) +// { +// ogdst->append(ogsrc); +// ogsrc=ol->outputs->next(); +// ogdst=outputs->next(); +// } +// return *this; +//} void OutputList::pushGeneratorState() { diff --git a/src/outputlist.h b/src/outputlist.h index ced3fb4..3bdf21e 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -44,7 +44,7 @@ class OutputList : public OutputDocInterface virtual ~OutputList(); OutputList(const OutputList *ol); OutputList &operator=(const OutputList &ol); - OutputList &operator+=(const OutputList &ol); + //OutputList &operator+=(const OutputList &ol); void add(const OutputGenerator *); @@ -72,10 +72,10 @@ class OutputList : public OutputDocInterface { return new OutputList(this); } - void append(const OutputDocInterface *g) - { - operator+=(*(OutputList *)g); - } + //void append(const OutputDocInterface *g) + //{ + // operator+=(*(OutputList *)g); + //} //void writeIndex() //{ forall(&OutputGenerator::writeIndex); } @@ -124,16 +124,16 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startItemList); } void endItemList() { forall(&OutputGenerator::endItemList); } - void startEnumList() - { forall(&OutputGenerator::startEnumList); } - void endEnumList() - { forall(&OutputGenerator::endEnumList); } - void startAlphabeticalIndexList() - { forall(&OutputGenerator::startAlphabeticalIndexList); } - void endAlphabeticalIndexList() - { forall(&OutputGenerator::endAlphabeticalIndexList); } - void writeIndexHeading(const char *s) - { forall(&OutputGenerator::writeIndexHeading,s); } + //void startEnumList() + //{ forall(&OutputGenerator::startEnumList); } + //void endEnumList() + //{ forall(&OutputGenerator::endEnumList); } + //void startAlphabeticalIndexList() + //{ forall(&OutputGenerator::startAlphabeticalIndexList); } + //void endAlphabeticalIndexList() + //{ forall(&OutputGenerator::endAlphabeticalIndexList); } + //void writeIndexHeading(const char *s) + //{ forall(&OutputGenerator::writeIndexHeading,s); } void writeIndexItem(const char *ref,const char *file,const char *text) { forall(&OutputGenerator::writeIndexItem,ref,file,text); } void docify(const char *s) @@ -154,8 +154,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startHtmlLink,url); } void endHtmlLink() { forall(&OutputGenerator::endHtmlLink); } - void writeMailLink(const char *url) - { forall(&OutputGenerator::writeMailLink,url); } + //void writeMailLink(const char *url) + //{ forall(&OutputGenerator::writeMailLink,url); } void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name) { forall(&OutputGenerator::writeStartAnnoItem,type,file,path,name); } @@ -213,14 +213,14 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startCodeFragment); } void endCodeFragment() { forall(&OutputGenerator::endCodeFragment); } - void startPreFragment() - { forall(&OutputGenerator::startPreFragment); } - void endPreFragment() - { forall(&OutputGenerator::endPreFragment); } - void startVerbatimFragment() - { forall(&OutputGenerator::startVerbatimFragment); } - void endVerbatimFragment() - { forall(&OutputGenerator::endVerbatimFragment); } + //void startPreFragment() + //{ forall(&OutputGenerator::startPreFragment); } + //void endPreFragment() + //{ forall(&OutputGenerator::endPreFragment); } + //void startVerbatimFragment() + //{ forall(&OutputGenerator::startVerbatimFragment); } + //void endVerbatimFragment() + //{ forall(&OutputGenerator::endVerbatimFragment); } void startCodeLine() { forall(&OutputGenerator::startCodeLine); } void endCodeLine() @@ -280,56 +280,56 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startSmall); } void endSmall() { forall(&OutputGenerator::endSmall); } - void startSubscript() - { forall(&OutputGenerator::startSubscript); } - void endSubscript() - { forall(&OutputGenerator::endSubscript); } - void startSuperscript() - { forall(&OutputGenerator::startSuperscript); } - void endSuperscript() - { forall(&OutputGenerator::endSuperscript); } - void startTable(bool hasCaption,int cols) - { forall(&OutputGenerator::startTable,hasCaption,cols); } - void endTable(bool hasCaption) - { forall(&OutputGenerator::endTable,hasCaption); } - void startCaption() - { forall(&OutputGenerator::startCaption); } - void endCaption() - { forall(&OutputGenerator::endCaption); } - void nextTableRow() - { forall(&OutputGenerator::nextTableRow); } - void endTableRow() - { forall(&OutputGenerator::endTableRow); } - void nextTableColumn() - { forall(&OutputGenerator::nextTableColumn); } - void endTableColumn() - { forall(&OutputGenerator::endTableColumn); } + //void startSubscript() + //{ forall(&OutputGenerator::startSubscript); } + //void endSubscript() + //{ forall(&OutputGenerator::endSubscript); } + //void startSuperscript() + //{ forall(&OutputGenerator::startSuperscript); } + //void endSuperscript() + //{ forall(&OutputGenerator::endSuperscript); } + //void startTable(bool hasCaption,int cols) + //{ forall(&OutputGenerator::startTable,hasCaption,cols); } + //void endTable(bool hasCaption) + //{ forall(&OutputGenerator::endTable,hasCaption); } + //void startCaption() + //{ forall(&OutputGenerator::startCaption); } + //void endCaption() + //{ forall(&OutputGenerator::endCaption); } + //void nextTableRow() + //{ forall(&OutputGenerator::nextTableRow); } + //void endTableRow() + //{ forall(&OutputGenerator::endTableRow); } + //void nextTableColumn() + //{ forall(&OutputGenerator::nextTableColumn); } + //void endTableColumn() + //{ forall(&OutputGenerator::endTableColumn); } void lineBreak() { forall(&OutputGenerator::lineBreak); } void startBold() { forall(&OutputGenerator::startBold); } void endBold() { forall(&OutputGenerator::endBold); } - void writeCopyright() - { forall(&OutputGenerator::writeCopyright); } - void writeQuote() - { forall(&OutputGenerator::writeQuote); } - void writeUmlaut(char c) - { forall(&OutputGenerator::writeUmlaut,c); } - void writeAcute(char c) - { forall(&OutputGenerator::writeAcute,c); } - void writeGrave(char c) - { forall(&OutputGenerator::writeGrave,c); } - void writeCirc(char c) - { forall(&OutputGenerator::writeCirc,c); } - void writeTilde(char c) - { forall(&OutputGenerator::writeTilde,c); } - void writeRing(char c) - { forall(&OutputGenerator::writeRing,c); } - void writeSharpS() - { forall(&OutputGenerator::writeSharpS); } - void writeCCedil(char c) - { forall(&OutputGenerator::writeCCedil,c); } + //void writeCopyright() + //{ forall(&OutputGenerator::writeCopyright); } + //void writeQuote() + //{ forall(&OutputGenerator::writeQuote); } + //void writeUmlaut(char c) + //{ forall(&OutputGenerator::writeUmlaut,c); } + //void writeAcute(char c) + //{ forall(&OutputGenerator::writeAcute,c); } + //void writeGrave(char c) + //{ forall(&OutputGenerator::writeGrave,c); } + //void writeCirc(char c) + //{ forall(&OutputGenerator::writeCirc,c); } + //void writeTilde(char c) + //{ forall(&OutputGenerator::writeTilde,c); } + //void writeRing(char c) + //{ forall(&OutputGenerator::writeRing,c); } + //void writeSharpS() + //{ forall(&OutputGenerator::writeSharpS); } + //void writeCCedil(char c) + //{ forall(&OutputGenerator::writeCCedil,c); } void startMemberDescription() { forall(&OutputGenerator::startMemberDescription); } void endMemberDescription() @@ -343,8 +343,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startParamList,t,title); } void endParamList() { forall(&OutputGenerator::endParamList); } - void endDescTitle() - { forall(&OutputGenerator::endDescTitle); } + //void endDescTitle() + //{ forall(&OutputGenerator::endDescTitle); } void writeDescItem() { forall(&OutputGenerator::writeDescItem); } void startIndent() @@ -355,11 +355,11 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startSection,lab,title,t); } void endSection(const char *lab,SectionInfo::SectionType t) { forall(&OutputGenerator::endSection,lab,t); } - void writeSectionRef(const char *ref,const char *file, - const char *anchor, const char *title) - { forall(&OutputGenerator::writeSectionRef,ref,file,anchor,title); } - void writeSectionRefItem(const char *page,const char *lab, const char *title) - { forall(&OutputGenerator::writeSectionRefItem,page,lab,title); } + //void writeSectionRef(const char *ref,const char *file, + // const char *anchor, const char *title) + //{ forall(&OutputGenerator::writeSectionRef,ref,file,anchor,title); } + //void writeSectionRefItem(const char *page,const char *lab, const char *title) + //{ forall(&OutputGenerator::writeSectionRefItem,page,lab,title); } //void writeSectionRefAnchor(const char *page,const char *lab, const char *title) //{ forall(&OutputGenerator::writeSectionRefAnchor,page,lab,title); } void addIndexItem(const char *s1,const char *s2) @@ -382,18 +382,18 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startQuickIndexItem,s,l); } void endQuickIndexItem() { forall(&OutputGenerator::endQuickIndexItem); } - void writeFormula(const char *n,const char *t) - { forall(&OutputGenerator::writeFormula,n,t); } + //void writeFormula(const char *n,const char *t) + //{ forall(&OutputGenerator::writeFormula,n,t); } void writeNonBreakableSpace(int num) { forall(&OutputGenerator::writeNonBreakableSpace,num); } - void startImage(const char *n,const char *s,bool c) - { forall(&OutputGenerator::startImage,n,s,c); } - void endImage(bool c) - { forall(&OutputGenerator::endImage,c); } - void startDotFile(const char *n,bool c) - { forall(&OutputGenerator::startDotFile,n,c); } - void endDotFile(bool c) - { forall(&OutputGenerator::endDotFile,c); } + //void startImage(const char *n,const char *s,bool c) + //{ forall(&OutputGenerator::startImage,n,s,c); } + //void endImage(bool c) + //{ forall(&OutputGenerator::endImage,c); } + //void startDotFile(const char *n,bool c) + //{ forall(&OutputGenerator::startDotFile,n,c); } + //void endDotFile(bool c) + //{ forall(&OutputGenerator::endDotFile,c); } void startDescTable() { forall(&OutputGenerator::startDescTable); } @@ -450,19 +450,19 @@ class OutputList : public OutputDocInterface void endFontClass() { forall(&OutputGenerator::endFontClass); } - void startHtmlOnly() - { forall(&OutputGenerator::startHtmlOnly); } - void endHtmlOnly() - { forall(&OutputGenerator::endHtmlOnly); } - void startLatexOnly() - { forall(&OutputGenerator::startLatexOnly); } - void endLatexOnly() - { forall(&OutputGenerator::endLatexOnly); } + //void startHtmlOnly() + //{ forall(&OutputGenerator::startHtmlOnly); } + //void endHtmlOnly() + //{ forall(&OutputGenerator::endHtmlOnly); } + //void startLatexOnly() + //{ forall(&OutputGenerator::startLatexOnly); } + //void endLatexOnly() + //{ forall(&OutputGenerator::endLatexOnly); } - void startSectionRefList() - { forall(&OutputGenerator::startSectionRefList); } - void endSectionRefList() - { forall(&OutputGenerator::endSectionRefList); } + //void startSectionRefList() + //{ forall(&OutputGenerator::startSectionRefList); } + //void endSectionRefList() + //{ forall(&OutputGenerator::endSectionRefList); } void writeCodeAnchor(const char *name) { forall(&OutputGenerator::writeCodeAnchor,name); } diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index e322595..377488b 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -122,9 +122,13 @@ public: inline PerlModOutput &close(char c = 0) { iclose(c); return *this; } inline PerlModOutput &addField(const char *s) { iaddField(s); return *this; } - inline PerlModOutput &addFieldQuoted(const char *field, const char *content) + inline PerlModOutput &addFieldQuotedString(const char *field, const char *content) { - iaddFieldQuoted(field, content); return *this; + iaddFieldQuotedString(field, content); return *this; + } + inline PerlModOutput &addFieldBoolean(const char *field, bool content) + { + return addFieldQuotedString(field, content ? "yes" : "no"); } inline PerlModOutput &openList(const char *s = 0) { open('[', s); return *this; } inline PerlModOutput &closeList() { close(']'); return *this; } @@ -140,7 +144,7 @@ protected: void decIndent(); void iaddQuoted(const char *); - void iaddFieldQuoted(const char *, const char *); + void iaddFieldQuotedString(const char *, const char *); void iaddField(const char *); void iopen(char, const char *); @@ -202,8 +206,10 @@ inline void PerlModOutput::iaddField(const char *s) m_stream->add(" => "); } -void PerlModOutput::iaddFieldQuoted(const char *field, const char *content) +void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content) { + if (content == 0) + return; iaddField(field); m_stream->add('\''); iaddQuoted(content); @@ -230,7 +236,7 @@ void PerlModOutput::iclose(char c) m_stream->add(",\n"); } -/*! @brief Concrete visitor implementation for Perl output. */ +/*! @brief Concrete visitor implementation for PerlMod output. */ class PerlModDocVisitor : public DocVisitor { public: @@ -339,7 +345,7 @@ private: // helper functions //-------------------------------------- - void addLink(const QString &ref,const QString &file, + void addLink(const QString &ref, const QString &file, const QString &anchor); void enterText(); @@ -378,13 +384,13 @@ void PerlModDocVisitor::addLink(const QString &,const QString &file,const QStrin QString link = file; if (!anchor.isEmpty()) (link += "_1") += anchor; - m_output.addFieldQuoted("link", link); + m_output.addFieldQuotedString("link", link); } void PerlModDocVisitor::openItem(const char *name) { leaveText(); - m_output.openHash().addFieldQuoted("type", name); + m_output.openHash().addFieldQuotedString("type", name); } void PerlModDocVisitor::closeItem() @@ -437,7 +443,7 @@ void PerlModDocVisitor::visit(DocLinkedWord *w) { openItem("url"); addLink(w->ref(), w->file(), w->anchor()); - m_output.addFieldQuoted("content", w->word()); + m_output.addFieldQuotedString("content", w->word()); closeItem(); } @@ -525,7 +531,7 @@ void PerlModDocVisitor::visit(DocVerbatim *s) case DocVerbatim::LatexOnly: type = "latexonly"; break; } openItem(type); - m_output.addFieldQuoted("content", s->text()); + m_output.addFieldQuotedString("content", s->text()); closeItem(); } @@ -533,7 +539,7 @@ void PerlModDocVisitor::visit(DocAnchor *anc) { QString anchor = anc->file() + "_1" + anc->anchor(); openItem("anchor"); - m_output.addFieldQuoted("id", anchor); + m_output.addFieldQuotedString("id", anchor); closeItem(); } @@ -554,7 +560,7 @@ void PerlModDocVisitor::visit(DocInclude *inc) case DocInclude::VerbInclude: type = "preformatted"; break; } openItem(type); - m_output.addFieldQuoted("content", inc->text()); + m_output.addFieldQuotedString("content", inc->text()); closeItem(); } @@ -587,7 +593,7 @@ void PerlModDocVisitor::visit(DocFormula *f) openItem("formula"); QString id; id += f->id(); - m_output.addFieldQuoted("id", id).addFieldQuoted("content", f->text()); + m_output.addFieldQuotedString("id", id).addFieldQuotedString("content", f->text()); closeItem(); } @@ -933,7 +939,7 @@ void PerlModDocVisitor::visitPre(DocRef *ref) { openItem("ref"); if (!ref->hasLinkText()) - m_output.addFieldQuoted("text", ref->targetTitle()); + m_output.addFieldQuotedString("text", ref->targetTitle()); } void PerlModDocVisitor::visitPost(DocRef *) @@ -972,7 +978,7 @@ void PerlModDocVisitor::visitPost(DocSecRefList *) void PerlModDocVisitor::visitPre(DocLanguage *l) { openItem("language"); - m_output.addFieldQuoted("id", l->id()); + m_output.addFieldQuotedString("id", l->id()); } void PerlModDocVisitor::visitPost(DocLanguage *) @@ -1012,7 +1018,7 @@ void PerlModDocVisitor::visitPre(DocParamList *pl) for (li.toFirst();(s=li.current());++li) { m_output.openHash() - .addFieldQuoted("name", s) + .addFieldQuotedString("name", s) .closeHash(); } m_output.closeList() @@ -1074,8 +1080,7 @@ void PerlModDocVisitor::visitPost(DocText *) { } -static void addTemplateArgumentList(ArgumentList *al, - PerlModOutput &output,const char * /*name*/) +static void addTemplateArgumentList(ArgumentList *al,PerlModOutput &output,const char *) { QCString indentStr; if (!al) @@ -1087,26 +1092,24 @@ static void addTemplateArgumentList(ArgumentList *al, { output.openHash(); if (!a->type.isEmpty()) - output.addFieldQuoted("type", a->type); + output.addFieldQuotedString("type", a->type); if (!a->name.isEmpty()) - output.addFieldQuoted("declaration_name", a->name) - .addFieldQuoted("definition_name", a->name); + output.addFieldQuotedString("declaration_name", a->name) + .addFieldQuotedString("definition_name", a->name); if (!a->defval.isEmpty()) - output.addFieldQuoted("default", a->defval); + output.addFieldQuotedString("default", a->defval); output.closeHash(); } output.closeList(); } -/* -static void addMemberTemplateLists(MemberDef *md,PerlModOutput &output) -{ - ClassDef *cd = md->getClassDef(); - const char *cname = cd ? cd->name().data() : 0; - if (md->templateArguments()) // function template prefix - addTemplateArgumentList(md->templateArguments(),output,cname); -} -*/ +//static void addMemberTemplateLists(MemberDef *md,PerlModOutput &output) +//{ +// ClassDef *cd = md->getClassDef(); +// const char *cname = cd ? cd->name().data() : 0; +// if (md->templateArguments()) // function template prefix +// addTemplateArgumentList(md->templateArguments(),output,cname); +//} static void addTemplateList(ClassDef *cd,PerlModOutput &output) { @@ -1123,11 +1126,8 @@ static void addPerlModDocBlock(PerlModOutput &output, { QCString stext = text.stripWhiteSpace(); if (stext.isEmpty()) - { output.addField(name).add("{},\n"); - } - else - { + else { DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,stext,FALSE); output.openHash(name); PerlModDocVisitor *visitor = new PerlModDocVisitor(output); @@ -1161,7 +1161,7 @@ static const char *getVirtualnessName(Specifier virt) return 0; } -static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition *) +static void generatePerlModForMember(MemberDef *md,PerlModOutput &output,Definition *) { // + declaration/definition arg lists @@ -1184,6 +1184,7 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition case MemberDef::Define: memType="define"; break; case MemberDef::EnumValue: ASSERT(0); break; case MemberDef::Property: memType="property"; break; + case MemberDef::Event: memType="event"; break; case MemberDef::Variable: memType="variable"; break; case MemberDef::Typedef: memType="typedef"; break; case MemberDef::Enumeration: memType="enum"; break; @@ -1202,23 +1203,24 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition scopeName=md->getNamespaceDef()->name(); output.openHash() - .addFieldQuoted("kind", memType) - .addFieldQuoted("name", md->name()) - .addFieldQuoted("virtualness", getVirtualnessName(md->virtualness())) - .addFieldQuoted("protection", getProtectionName(md->protection())); - + .addFieldQuotedString("kind", memType) + .addFieldQuotedString("name", md->name()) + .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) + .addFieldQuotedString("protection", getProtectionName(md->protection())) + .addFieldBoolean("static", md->isStatic()); + addPerlModDocBlock(output,"brief",md->getDefFileName(),md->getDefLine(),scopeName,md,md->briefDescription()); addPerlModDocBlock(output,"detailed",md->getDefFileName(),md->getDefLine(),scopeName,md,md->documentation()); if (md->memberType()!=MemberDef::Define && md->memberType()!=MemberDef::Enumeration) - output.addFieldQuoted("type", md->typeString()); + output.addFieldQuotedString("type", md->typeString()); if (isFunc) //function { ArgumentList *al = md->argumentList(); - output.addFieldQuoted("const", (al && al->constSpecifier) ? "yes" : "no") - .addFieldQuoted("volatile", (al && al->volatileSpecifier) ? "yes" : "no"); - + output.addFieldBoolean("const", al && al->constSpecifier) + .addFieldBoolean("volatile", al && al->volatileSpecifier); + output.openList("parameters"); ArgumentList *declAl = md->declArgumentList(); ArgumentList *defAl = md->argumentList(); @@ -1233,22 +1235,22 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition output.openHash(); if (!a->name.isEmpty()) - output.addFieldQuoted("declaration_name", a->name); + output.addFieldQuotedString("declaration_name", a->name); if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name) - output.addFieldQuoted("definition_name", defArg->name); + output.addFieldQuotedString("definition_name", defArg->name); if (!a->type.isEmpty()) - output.addFieldQuoted("type", a->type); + output.addFieldQuotedString("type", a->type); if (!a->array.isEmpty()) - output.addFieldQuoted("array", a->array); + output.addFieldQuotedString("array", a->array); if (!a->defval.isEmpty()) - output.addFieldQuoted("default_value", a->defval); + output.addFieldQuotedString("default_value", a->defval); if (!a->attrib.isEmpty()) - output.addFieldQuoted("attributes", a->attrib); + output.addFieldQuotedString("attributes", a->attrib); output.closeHash(); if (defArg) ++defAli; @@ -1265,16 +1267,16 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition for (ali.toFirst();(a=ali.current());++ali) { output.openHash() - .addFieldQuoted("name", a->type) + .addFieldQuotedString("name", a->type) .closeHash(); } output.closeList(); } if (!md->initializer().isEmpty()) - output.addFieldQuoted("initializer", md->initializer()); + output.addFieldQuotedString("initializer", md->initializer()); if (md->excpString()) - output.addFieldQuoted("exceptions", md->excpString()); + output.addFieldQuotedString("exceptions", md->excpString()); if (md->memberType()==MemberDef::Enumeration) // enum { @@ -1286,10 +1288,10 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition for (emli.toFirst();(emd=emli.current());++emli) { output.openHash() - .addFieldQuoted("name", emd->name()); + .addFieldQuotedString("name", emd->name()); if (!emd->initializer().isEmpty()) - output.addFieldQuoted("initializer", emd->initializer()); + output.addFieldQuotedString("initializer", emd->initializer()); addPerlModDocBlock(output,"brief",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->briefDescription()); @@ -1304,7 +1306,7 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition MemberDef *rmd = md->reimplements(); if (rmd) output.openHash("reimplements") - .addFieldQuoted("name", rmd->name()) + .addFieldQuotedString("name", rmd->name()) .closeHash(); MemberList *rbml = md->reimplementedBy(); @@ -1314,7 +1316,7 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition output.openList("reimplemented_by"); for (mli.toFirst();(rmd=mli.current());++mli) output.openHash() - .addFieldQuoted("name", rmd->name()) + .addFieldQuotedString("name", rmd->name()) .closeHash(); output.closeList(); } @@ -1322,7 +1324,7 @@ static void generatePerlForMember(MemberDef *md,PerlModOutput &output,Definition output.closeHash(); } -static void generatePerlSection(Definition *d,PerlModOutput &output, +static void generatePerlModSection(Definition *d,PerlModOutput &output, MemberList *ml,const char *name,const char *header=0) { if (ml->count()==0) return; // empty list @@ -1330,14 +1332,14 @@ static void generatePerlSection(Definition *d,PerlModOutput &output, output.openHash(name); if (header) - output.addFieldQuoted("header", header); + output.addFieldQuotedString("header", header); output.openList("members"); MemberListIterator mli(*ml); MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { - generatePerlForMember(md,output,d); + generatePerlModForMember(md,output,d); } output.closeList() .closeHash(); @@ -1360,21 +1362,21 @@ static void addListOfAllMembers(ClassDef *cd, PerlModOutput &output) if (d==0) d = cd; output.openHash() - .addFieldQuoted("name", md->name()) - .addFieldQuoted("virtualness", getVirtualnessName(md->virtualness())) - .addFieldQuoted("protection", getProtectionName(mi->prot)); + .addFieldQuotedString("name", md->name()) + .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) + .addFieldQuotedString("protection", getProtectionName(mi->prot)); if (!mi->ambiguityResolutionScope.isEmpty()) - output.addFieldQuoted("ambiguity_scope", mi->ambiguityResolutionScope); + output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); - output.addFieldQuoted("scope", cd->name()) + output.addFieldQuotedString("scope", cd->name()) .closeHash(); } } output.closeList(); } -static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) +static void generatePerlModForClass(ClassDef *cd, PerlModOutput &output) { // + brief description // + detailed description @@ -1397,7 +1399,7 @@ static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) if (cd->templateMaster()!=0) return; // skip generated template instances. output.openHash() - .addFieldQuoted("name", cd->name()); + .addFieldQuotedString("name", cd->name()); if (cd->baseClasses()->count()>0) { @@ -1406,9 +1408,9 @@ static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) output.openHash() - .addFieldQuoted("name", bcd->classDef->displayName()) - .addFieldQuoted("virtualness", getVirtualnessName(bcd->virt)) - .addFieldQuoted("protection", getProtectionName(bcd->prot)) + .addFieldQuotedString("name", bcd->classDef->displayName()) + .addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt)) + .addFieldQuotedString("protection", getProtectionName(bcd->prot)) .closeHash(); output.closeList(); } @@ -1420,9 +1422,9 @@ static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) output.openHash() - .addFieldQuoted("name", bcd->classDef->displayName()) - .addFieldQuoted("virtualness", getVirtualnessName(bcd->virt)) - .addFieldQuoted("protection", getProtectionName(bcd->prot)) + .addFieldQuotedString("name", bcd->classDef->displayName()) + .addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt)) + .addFieldQuotedString("protection", getProtectionName(bcd->prot)) .closeHash(); output.closeList(); } @@ -1435,7 +1437,7 @@ static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) output.openHash() - .addFieldQuoted("name", cd->name()) + .addFieldQuotedString("name", cd->name()) .closeHash(); output.closeList(); } @@ -1452,8 +1454,8 @@ static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references t << " id=\"" << ii->fileDef->getOutputFileBase() << "\""; #endif - output.addFieldQuoted("local", ii->local ? "yes" : "no") - .addFieldQuoted("name", nm) + output.addFieldBoolean("local", ii->local) + .addFieldQuotedString("name", nm) .closeHash(); } } @@ -1463,31 +1465,31 @@ static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) - generatePerlSection(cd,output,mg->members(),"user_defined",mg->header()); - - generatePerlSection(cd,output,&cd->pubTypes,"public_typedefs"); - generatePerlSection(cd,output,&cd->pubMethods,"public_methods"); - generatePerlSection(cd,output,&cd->pubAttribs,"public_members"); - generatePerlSection(cd,output,&cd->pubSlots,"public_slots"); - generatePerlSection(cd,output,&cd->signals,"signals"); - generatePerlSection(cd,output,&cd->dcopMethods,"dcop_methods"); - generatePerlSection(cd,output,&cd->properties,"properties"); - generatePerlSection(cd,output,&cd->pubStaticMethods,"public_static_methods"); - generatePerlSection(cd,output,&cd->pubStaticAttribs,"public_static_members"); - generatePerlSection(cd,output,&cd->proTypes,"protected_typedefs"); - generatePerlSection(cd,output,&cd->proMethods,"protected_methods"); - generatePerlSection(cd,output,&cd->proAttribs,"protected_members"); - generatePerlSection(cd,output,&cd->proSlots,"protected_slots"); - generatePerlSection(cd,output,&cd->proStaticMethods,"protected_static_methods"); - generatePerlSection(cd,output,&cd->proStaticAttribs,"protected_static_members"); - generatePerlSection(cd,output,&cd->priTypes,"private_typedefs"); - generatePerlSection(cd,output,&cd->priMethods,"private_methods"); - generatePerlSection(cd,output,&cd->priAttribs,"private_members"); - generatePerlSection(cd,output,&cd->priSlots,"private_slots"); - generatePerlSection(cd,output,&cd->priStaticMethods,"private_static_methods"); - generatePerlSection(cd,output,&cd->priStaticAttribs,"private_static_members"); - generatePerlSection(cd,output,&cd->friends,"friend_methods"); - generatePerlSection(cd,output,&cd->related,"related_methods"); + generatePerlModSection(cd,output,mg->members(),"user_defined",mg->header()); + + generatePerlModSection(cd,output,&cd->pubTypes,"public_typedefs"); + generatePerlModSection(cd,output,&cd->pubMethods,"public_methods"); + generatePerlModSection(cd,output,&cd->pubAttribs,"public_members"); + generatePerlModSection(cd,output,&cd->pubSlots,"public_slots"); + generatePerlModSection(cd,output,&cd->signals,"signals"); + generatePerlModSection(cd,output,&cd->dcopMethods,"dcop_methods"); + generatePerlModSection(cd,output,&cd->properties,"properties"); + generatePerlModSection(cd,output,&cd->pubStaticMethods,"public_static_methods"); + generatePerlModSection(cd,output,&cd->pubStaticAttribs,"public_static_members"); + generatePerlModSection(cd,output,&cd->proTypes,"protected_typedefs"); + generatePerlModSection(cd,output,&cd->proMethods,"protected_methods"); + generatePerlModSection(cd,output,&cd->proAttribs,"protected_members"); + generatePerlModSection(cd,output,&cd->proSlots,"protected_slots"); + generatePerlModSection(cd,output,&cd->proStaticMethods,"protected_static_methods"); + generatePerlModSection(cd,output,&cd->proStaticAttribs,"protected_static_members"); + generatePerlModSection(cd,output,&cd->priTypes,"private_typedefs"); + generatePerlModSection(cd,output,&cd->priMethods,"private_methods"); + generatePerlModSection(cd,output,&cd->priAttribs,"private_members"); + generatePerlModSection(cd,output,&cd->priSlots,"private_slots"); + generatePerlModSection(cd,output,&cd->priStaticMethods,"private_static_methods"); + generatePerlModSection(cd,output,&cd->priStaticAttribs,"private_static_members"); + generatePerlModSection(cd,output,&cd->friends,"friend_methods"); + generatePerlModSection(cd,output,&cd->related,"related_methods"); addPerlModDocBlock(output,"brief",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->briefDescription()); addPerlModDocBlock(output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->documentation()); @@ -1497,14 +1499,14 @@ static void generatePerlForClass(ClassDef *cd, PerlModOutput &output) if (!inheritanceGraph.isTrivial()) { t << " " << endl; - inheritanceGraph.writePerl(t); + inheritanceGraph.writePerlMod(t); t << " " << endl; } DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation); if (!collaborationGraph.isTrivial()) { t << " " << endl; - collaborationGraph.writePerl(t); + collaborationGraph.writePerlMod(t); t << " " << endl; } t << " isReference()) return; // skip external references output.openHash() - .addFieldQuoted("name", nd->name()); + .addFieldQuotedString("name", nd->name()); ClassSDict *cl = nd->classSDict; if (cl) @@ -1545,7 +1547,7 @@ static void generatePerlForNamespace(NamespaceDef *nd, PerlModOutput &output) ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) output.openHash() - .addFieldQuoted("name", cd->name()) + .addFieldQuotedString("name", cd->name()) .closeHash(); output.closeList(); } @@ -1558,7 +1560,7 @@ static void generatePerlForNamespace(NamespaceDef *nd, PerlModOutput &output) NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) output.openHash() - .addFieldQuoted("name", nd->name()) + .addFieldQuotedString("name", nd->name()) .closeHash(); output.closeList(); } @@ -1566,14 +1568,14 @@ static void generatePerlForNamespace(NamespaceDef *nd, PerlModOutput &output) MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) - generatePerlSection(nd,output,mg->members(),"user-defined",mg->header()); + generatePerlModSection(nd,output,mg->members(),"user-defined",mg->header()); - generatePerlSection(nd,output,&nd->decDefineMembers,"defines"); - generatePerlSection(nd,output,&nd->decProtoMembers,"prototypes"); - generatePerlSection(nd,output,&nd->decTypedefMembers,"typedefs"); - generatePerlSection(nd,output,&nd->decEnumMembers,"enums"); - generatePerlSection(nd,output,&nd->decFuncMembers,"functions"); - generatePerlSection(nd,output,&nd->decVarMembers,"variables"); + generatePerlModSection(nd,output,&nd->decDefineMembers,"defines"); + generatePerlModSection(nd,output,&nd->decProtoMembers,"prototypes"); + generatePerlModSection(nd,output,&nd->decTypedefMembers,"typedefs"); + generatePerlModSection(nd,output,&nd->decEnumMembers,"enums"); + generatePerlModSection(nd,output,&nd->decFuncMembers,"functions"); + generatePerlModSection(nd,output,&nd->decVarMembers,"variables"); addPerlModDocBlock(output,"brief",nd->getDefFileName(),nd->getDefLine(),0,0,nd->briefDescription()); addPerlModDocBlock(output,"detailed",nd->getDefFileName(),nd->getDefLine(),0,0,nd->documentation()); @@ -1581,7 +1583,7 @@ static void generatePerlForNamespace(NamespaceDef *nd, PerlModOutput &output) output.closeHash(); } -static void generatePerlForFile(FileDef *fd, PerlModOutput &output) +static void generatePerlModForFile(FileDef *fd, PerlModOutput &output) { // + includes files // + includedby files @@ -1600,7 +1602,7 @@ static void generatePerlForFile(FileDef *fd, PerlModOutput &output) if (fd->isReference()) return; output.openHash() - .addFieldQuoted("name", fd->name()); + .addFieldQuotedString("name", fd->name()); QListIterator ili1(*fd->includeFileList()); IncludeInfo *inc; @@ -1608,10 +1610,10 @@ static void generatePerlForFile(FileDef *fd, PerlModOutput &output) for (ili1.toFirst();(inc=ili1.current());++ili1) { output.openHash() - .addFieldQuoted("name", inc->includeName); + .addFieldQuotedString("name", inc->includeName); if (inc->fileDef && !inc->fileDef->isReference()) { - output.addFieldQuoted("ref", inc->fileDef->getOutputFileBase()); + output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); } output.closeHash(); } @@ -1622,21 +1624,21 @@ static void generatePerlForFile(FileDef *fd, PerlModOutput &output) for (ili2.toFirst();(inc=ili2.current());++ili2) { output.openHash() - .addFieldQuoted("name => ", inc->includeName); + .addFieldQuotedString("name => ", inc->includeName); if (inc->fileDef && !inc->fileDef->isReference()) { - output.addFieldQuoted("ref", inc->fileDef->getOutputFileBase()); + output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); } output.closeHash(); } output.closeList(); - generatePerlSection(fd,output,&fd->decDefineMembers,"defines"); - generatePerlSection(fd,output,&fd->decProtoMembers,"prototypes"); - generatePerlSection(fd,output,&fd->decTypedefMembers,"typedefs"); - generatePerlSection(fd,output,&fd->decEnumMembers,"enums"); - generatePerlSection(fd,output,&fd->decFuncMembers,"functions"); - generatePerlSection(fd,output,&fd->decVarMembers,"variables"); + generatePerlModSection(fd,output,&fd->decDefineMembers,"defines"); + generatePerlModSection(fd,output,&fd->decProtoMembers,"prototypes"); + generatePerlModSection(fd,output,&fd->decTypedefMembers,"typedefs"); + generatePerlModSection(fd,output,&fd->decEnumMembers,"enums"); + generatePerlModSection(fd,output,&fd->decFuncMembers,"functions"); + generatePerlModSection(fd,output,&fd->decVarMembers,"variables"); addPerlModDocBlock(output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription()); addPerlModDocBlock(output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation()); @@ -1644,7 +1646,7 @@ static void generatePerlForFile(FileDef *fd, PerlModOutput &output) output.closeHash(); } -static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) +static void generatePerlModForGroup(GroupDef *gd, PerlModOutput &output) { // + members // + member groups @@ -1661,8 +1663,8 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) if (gd->isReference()) return; // skip external references output.openHash() - .addFieldQuoted("name", gd->name()) - .addFieldQuoted("title", gd->groupTitle()); + .addFieldQuotedString("name", gd->name()) + .addFieldQuotedString("title", gd->groupTitle()); FileList *fl = gd->getFiles(); if (fl) @@ -1672,7 +1674,7 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) FileDef *fd = fl->first(); for (fli.toFirst();(fd=fli.current());++fli) output.openHash() - .addFieldQuoted("name", fd->name()) + .addFieldQuotedString("name", fd->name()) .closeHash(); output.closeList(); } @@ -1685,7 +1687,7 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) output.openHash() - .addFieldQuoted("name", cd->name()) + .addFieldQuotedString("name", cd->name()) .closeHash(); output.closeList(); } @@ -1698,7 +1700,7 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) output.openHash() - .addFieldQuoted("name", nd->name()) + .addFieldQuotedString("name", nd->name()) .closeHash(); output.closeList(); } @@ -1711,7 +1713,7 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) PageInfo *pi; for (pli.toFirst();(pi=pli.current());++pli) output.openHash() - .addFieldQuoted("title", pi->title) + .addFieldQuotedString("title", pi->title) .closeHash(); output.closeList(); } @@ -1724,7 +1726,7 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) GroupDef *sgd; for (gli.toFirst();(sgd=gli.current());++gli) output.openHash() - .addFieldQuoted("title", gd->groupTitle()) + .addFieldQuotedString("title", gd->groupTitle()) .closeHash(); output.closeList(); } @@ -1732,14 +1734,14 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) - generatePerlSection(gd,output,mg->members(),"user-defined",mg->header()); + generatePerlModSection(gd,output,mg->members(),"user-defined",mg->header()); - generatePerlSection(gd,output,&gd->decDefineMembers,"defines"); - generatePerlSection(gd,output,&gd->decProtoMembers,"prototypes"); - generatePerlSection(gd,output,&gd->decTypedefMembers,"typedefs"); - generatePerlSection(gd,output,&gd->decEnumMembers,"enums"); - generatePerlSection(gd,output,&gd->decFuncMembers,"functions"); - generatePerlSection(gd,output,&gd->decVarMembers,"variables"); + generatePerlModSection(gd,output,&gd->decDefineMembers,"defines"); + generatePerlModSection(gd,output,&gd->decProtoMembers,"prototypes"); + generatePerlModSection(gd,output,&gd->decTypedefMembers,"typedefs"); + generatePerlModSection(gd,output,&gd->decEnumMembers,"enums"); + generatePerlModSection(gd,output,&gd->decFuncMembers,"functions"); + generatePerlModSection(gd,output,&gd->decVarMembers,"variables"); addPerlModDocBlock(output,"brief",gd->getDefFileName(),gd->getDefLine(),0,0,gd->briefDescription()); addPerlModDocBlock(output,"detailed",gd->getDefFileName(),gd->getDefLine(),0,0,gd->documentation()); @@ -1747,7 +1749,7 @@ static void generatePerlForGroup(GroupDef *gd, PerlModOutput &output) output.closeHash(); } -static void generatePerlForPage(PageInfo *pi, PerlModOutput &output) +static void generatePerlModForPage(PageInfo *pi, PerlModOutput &output) { // + name // + title @@ -1756,11 +1758,11 @@ static void generatePerlForPage(PageInfo *pi, PerlModOutput &output) if (pi->isReference()) return; output.openHash() - .addFieldQuoted("name", pi->name); + .addFieldQuotedString("name", pi->name); SectionInfo *si = Doxygen::sectionDict.find(pi->name); if (si) - output.addFieldQuoted("title", si->title); + output.addFieldQuotedString("title", si->title); addPerlModDocBlock(output,"detailed",pi->defFileName,pi->defLine,0,0,pi->doc); } @@ -1813,7 +1815,14 @@ void generatePerlMod() } } - QCString fileName=outputDirectory+"/DoxyDocs.pm"; + QDir perlmodDir(outputDirectory+"/perlmod"); + if (!perlmodDir.exists() && !perlmodDir.mkdir(outputDirectory+"/perlmod")) + { + err("Could not create perlmod directory in %s\n",outputDirectory.data()); + return; + } + + QCString fileName=outputDirectory+"/perlmod/DoxyDocs.pm"; QFile f(fileName); if (!f.open(IO_WriteOnly)) { @@ -1830,14 +1839,14 @@ void generatePerlMod() ClassSDict::Iterator cli(Doxygen::classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) - generatePerlForClass(cd,output); + generatePerlModForClass(cd,output); output.closeList(); output.openList("namespaces"); NamespaceSDict::Iterator nli(Doxygen::namespaceSDict); NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) - generatePerlForNamespace(nd,output); + generatePerlModForNamespace(nd,output); output.closeList(); output.openList("files"); @@ -1848,7 +1857,7 @@ void generatePerlMod() FileNameIterator fni(*fn); FileDef *fd; for (;(fd=fni.current());++fni) - generatePerlForFile(fd,output); + generatePerlModForFile(fd,output); } output.closeList(); @@ -1856,16 +1865,16 @@ void generatePerlMod() GroupSDict::Iterator gli(Doxygen::groupSDict); GroupDef *gd; for (;(gd=gli.current());++gli) - generatePerlForGroup(gd,output); + generatePerlModForGroup(gd,output); output.closeList(); output.openList("pages"); PageSDict::Iterator pdi(*Doxygen::pageSDict); PageInfo *pi=0; for (pdi.toFirst();(pi=pdi.current());++pdi) - generatePerlForPage(pi,output); + generatePerlModForPage(pi,output); if (Doxygen::mainPage) - generatePerlForPage(Doxygen::mainPage,output); + generatePerlModForPage(Doxygen::mainPage,output); output.closeList(); output.closeHash().add(";\n1;\n"); diff --git a/src/pre.l b/src/pre.l index 903b69e..8123ae2 100644 --- a/src/pre.l +++ b/src/pre.l @@ -2049,7 +2049,7 @@ void preprocessFile(const char *fileName,BufStr &output) } else { - QCString cmd = inputFilter+" "+fileName; + QCString cmd = inputFilter+" \""+fileName+"\""; preYYin = popen(cmd,"r"); if (!preYYin) { diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index a072318..bf2731a 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -910,7 +910,7 @@ void RTFDocVisitor::visitPre(DocParamList *pl) for (li.toFirst();(s=li.current());++li) { if (!first) m_t << ","; else first=FALSE; - m_t << s; + filter(s); } m_t << "} "; } diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index eaae2d7..af35b80 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -882,25 +882,25 @@ void RTFGenerator::endItemList() m_omitParagraph = TRUE; } -/*! start enumeration list */ -void RTFGenerator::startEnumList() // starts an enumeration list -{ - DBG_RTF(t << "{\\comment (startEnumList)}" << endl) - t << "{" << endl; - incrementIndentLevel(); - rtf_listItemInfo[m_listLevel].isEnum = TRUE; - rtf_listItemInfo[m_listLevel].number = 1; -} - -/*! end enumeration list */ -void RTFGenerator::endEnumList() -{ - newParagraph(); - DBG_RTF(t << "{\\comment (endEnumList)}" << endl) - t << "}"; - decrementIndentLevel(); - m_omitParagraph = TRUE; -} +///*! start enumeration list */ +//void RTFGenerator::startEnumList() // starts an enumeration list +//{ +// DBG_RTF(t << "{\\comment (startEnumList)}" << endl) +// t << "{" << endl; +// incrementIndentLevel(); +// rtf_listItemInfo[m_listLevel].isEnum = TRUE; +// rtf_listItemInfo[m_listLevel].number = 1; +//} +// +///*! end enumeration list */ +//void RTFGenerator::endEnumList() +//{ +// newParagraph(); +// DBG_RTF(t << "{\\comment (endEnumList)}" << endl) +// t << "}"; +// decrementIndentLevel(); +// m_omitParagraph = TRUE; +//} /*! write bullet or enum item */ void RTFGenerator::writeListItem() @@ -976,12 +976,12 @@ void RTFGenerator::endHtmlLink() } } -void RTFGenerator::writeMailLink(const char *url) -{ - startTypewriter(); - docify(url); - endTypewriter(); -} +//void RTFGenerator::writeMailLink(const char *url) +//{ +// startTypewriter(); +// docify(url); +// endTypewriter(); +//} void RTFGenerator::writeStartAnnoItem(const char *,const char *f, const char *path,const char *name) @@ -1096,73 +1096,73 @@ void RTFGenerator::endSubsubsection() // t << "}"; //} -void RTFGenerator::startTable(bool,int colNumbers) -{ - DBG_RTF(t << "{\\comment startTable}\n";) - m_numCols=colNumbers; - t << "\\par\n"; -} - -void RTFGenerator::endTable(bool hasCaption) -{ - DBG_RTF(t << "{\\comment endTable}\n";) - if (!hasCaption) - t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n"; - t << "\\pard\n" << endl; -} - -void RTFGenerator::startCaption() -{ - DBG_RTF(t << "{\\comment startCaption}\n";) - endTableRow(); - t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10" << endl; - t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<0 && m_numCols<25); - uint columnWidth=rtf_pageWidth/m_numCols; - t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 " - "\\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 " - "\\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 " - "\\trbrdrv\\brdrs\\brdrw10 "<0 && m_numCols<25); +// uint columnWidth=rtf_pageWidth/m_numCols; +// t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 " +// "\\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 " +// "\\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 " +// "\\trbrdrv\\brdrs\\brdrw10 "<trPageAbbreviation()); - writeRTFReference(lab); - t << ")" << endl; - } -} - -void RTFGenerator::writeSectionRefItem(const char *,const char *lab, - const char *title) -{ - docify(title); - t << "\\tab"; - writeRTFReference(lab); - t << endl; -} - +//void RTFGenerator::writeSectionRef(const char *ref,const char *, +// const char *lab,const char *title) +//{ +// if (ref) +// { +// docify(title); +// } +// else +// { +// startBold(); +// docify(title); +// endBold(); +// t << " ("; +// docify(theTranslator->trPageAbbreviation()); +// writeRTFReference(lab); +// t << ")" << endl; +// } +//} +// +//void RTFGenerator::writeSectionRefItem(const char *,const char *lab, +// const char *title) +//{ +// docify(title); +// t << "\\tab"; +// writeRTFReference(lab); +// t << endl; +//} +// //void RTFGenerator::writeSectionRefAnchor(const char *name,const char *lab, // const char *title) //{ @@ -1711,10 +1711,10 @@ void RTFGenerator::endClassDiagram(ClassDiagram &d, t << "}" << endl; } -void RTFGenerator::writeFormula(const char *,const char *text) -{ - t << text; -} +//void RTFGenerator::writeFormula(const char *,const char *text) +//{ +// t << text; +//} void RTFGenerator::startMemberItem(int) { @@ -1802,46 +1802,46 @@ void RTFGenerator::endMemberList() #endif } -void RTFGenerator::startImage(const char *name,const char *,bool) -{ - newParagraph(); - t << "{" << endl; - t << rtf_Style_Reset << endl; - t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; - t << name; - t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; - t << "}" << endl; -} - -void RTFGenerator::endImage(bool) -{ - // not yet implemented -} - -void RTFGenerator::startDotFile(const char *name,bool) -{ - QCString baseName=name; - int i; - if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) - { - baseName=baseName.right(baseName.length()-i-1); - } - QCString outDir = Config_getString("RTF_OUTPUT"); - writeDotGraphFromFile(name,outDir,baseName,BITMAP); - newParagraph(); - t << "{" << endl; - t << rtf_Style_Reset << endl; - t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; - t << outDir << "\\" << baseName; - t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; - t << "}" << endl; -} - -void RTFGenerator::endDotFile(bool) -{ - // not yet implemented -} - +//void RTFGenerator::startImage(const char *name,const char *,bool) +//{ +// newParagraph(); +// t << "{" << endl; +// t << rtf_Style_Reset << endl; +// t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; +// t << name; +// t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; +// t << "}" << endl; +//} +// +//void RTFGenerator::endImage(bool) +//{ +// // not yet implemented +//} +// +//void RTFGenerator::startDotFile(const char *name,bool) +//{ +// QCString baseName=name; +// int i; +// if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) +// { +// baseName=baseName.right(baseName.length()-i-1); +// } +// QCString outDir = Config_getString("RTF_OUTPUT"); +// writeDotGraphFromFile(name,outDir,baseName,BITMAP); +// newParagraph(); +// t << "{" << endl; +// t << rtf_Style_Reset << endl; +// t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; +// t << outDir << "\\" << baseName; +// t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; +// t << "}" << endl; +//} +// +//void RTFGenerator::endDotFile(bool) +//{ +// // not yet implemented +//} +// void RTFGenerator::startDescTable() { DBG_RTF(t << "{\\comment (startDescTable) }" << endl) @@ -1993,116 +1993,116 @@ void RTFGenerator::endMemberSubtitle() t << "}" << endl; } -void RTFGenerator::writeUmlaut(char c) -{ - switch(c) - { - case 'A' : t << '\304'; break; - case 'E' : t << '\313'; break; - case 'I' : t << '\317'; break; - case 'O' : t << '\326'; break; - case 'U' : t << '\334'; break; - case 'Y' : t << 'Y'; break; - case 'a' : t << '\344'; break; - case 'e' : t << '\353'; break; - case 'i' : t << '\357'; break; - case 'o' : t << '\366'; break; - case 'u' : t << '\374'; break; - case 'y' : t << '\377'; break; - default: t << '?'; break; - } -} - -void RTFGenerator::writeAcute(char c) -{ - switch(c) - { - case 'A' : t << '\301'; break; - case 'E' : t << '\311'; break; - case 'I' : t << '\315'; break; - case 'O' : t << '\323'; break; - case 'U' : t << '\332'; break; - case 'Y' : t << '\335'; break; - case 'a' : t << '\341'; break; - case 'e' : t << '\351'; break; - case 'i' : t << '\355'; break; - case 'o' : t << '\363'; break; - case 'u' : t << '\372'; break; - case 'y' : t << '\375'; break; - default: t << '?'; break; - } -} - -void RTFGenerator::writeGrave(char c) -{ - switch(c) - { - case 'A' : t << '\300'; break; - case 'E' : t << '\310'; break; - case 'I' : t << '\314'; break; - case 'O' : t << '\322'; break; - case 'U' : t << '\331'; break; - case 'a' : t << '\340'; break; - case 'e' : t << '\350'; break; - case 'i' : t << '\354'; break; - case 'o' : t << '\362'; break; - case 'u' : t << '\371'; break; - default: t << '?'; break; - } -} - -void RTFGenerator::writeCirc(char c) -{ - switch(c) - { - case 'A' : t << '\302'; break; - case 'E' : t << '\312'; break; - case 'I' : t << '\316'; break; - case 'O' : t << '\324'; break; - case 'U' : t << '\333'; break; - case 'a' : t << '\342'; break; - case 'e' : t << '\352'; break; - case 'i' : t << '\356'; break; - case 'o' : t << '\364'; break; - case 'u' : t << '\373'; break; - default: t << '?'; break; - } -} - -void RTFGenerator::writeTilde(char c) -{ - switch(c) - { - case 'A' : t << '\303'; break; - case 'N' : t << '\321'; break; - case 'O' : t << '\325'; break; - case 'a' : t << '\343'; break; - case 'n' : t << '\361'; break; - case 'o' : t << '\365'; break; - default: t << '?'; break; - } -} - -void RTFGenerator::writeRing(char c) -{ - switch(c) - { - case 'A' : t << '\305'; break; - case 'a' : t << '\345'; break; - default: t << '?'; break; - } -} - -void RTFGenerator::writeCCedil(char c) -{ - switch(c) - { - case 'C' : t << '\307'; break; - case 'c' : t << '\347'; break; - default: t << '?'; break; - } -} - +//void RTFGenerator::writeUmlaut(char c) +//{ +// switch(c) +// { +// case 'A' : t << '\304'; break; +// case 'E' : t << '\313'; break; +// case 'I' : t << '\317'; break; +// case 'O' : t << '\326'; break; +// case 'U' : t << '\334'; break; +// case 'Y' : t << 'Y'; break; +// case 'a' : t << '\344'; break; +// case 'e' : t << '\353'; break; +// case 'i' : t << '\357'; break; +// case 'o' : t << '\366'; break; +// case 'u' : t << '\374'; break; +// case 'y' : t << '\377'; break; +// default: t << '?'; break; +// } +//} +// +//void RTFGenerator::writeAcute(char c) +//{ +// switch(c) +// { +// case 'A' : t << '\301'; break; +// case 'E' : t << '\311'; break; +// case 'I' : t << '\315'; break; +// case 'O' : t << '\323'; break; +// case 'U' : t << '\332'; break; +// case 'Y' : t << '\335'; break; +// case 'a' : t << '\341'; break; +// case 'e' : t << '\351'; break; +// case 'i' : t << '\355'; break; +// case 'o' : t << '\363'; break; +// case 'u' : t << '\372'; break; +// case 'y' : t << '\375'; break; +// default: t << '?'; break; +// } +//} +// +//void RTFGenerator::writeGrave(char c) +//{ +// switch(c) +// { +// case 'A' : t << '\300'; break; +// case 'E' : t << '\310'; break; +// case 'I' : t << '\314'; break; +// case 'O' : t << '\322'; break; +// case 'U' : t << '\331'; break; +// case 'a' : t << '\340'; break; +// case 'e' : t << '\350'; break; +// case 'i' : t << '\354'; break; +// case 'o' : t << '\362'; break; +// case 'u' : t << '\371'; break; +// default: t << '?'; break; +// } +//} +// +//void RTFGenerator::writeCirc(char c) +//{ +// switch(c) +// { +// case 'A' : t << '\302'; break; +// case 'E' : t << '\312'; break; +// case 'I' : t << '\316'; break; +// case 'O' : t << '\324'; break; +// case 'U' : t << '\333'; break; +// case 'a' : t << '\342'; break; +// case 'e' : t << '\352'; break; +// case 'i' : t << '\356'; break; +// case 'o' : t << '\364'; break; +// case 'u' : t << '\373'; break; +// default: t << '?'; break; +// } +//} +// +//void RTFGenerator::writeTilde(char c) +//{ +// switch(c) +// { +// case 'A' : t << '\303'; break; +// case 'N' : t << '\321'; break; +// case 'O' : t << '\325'; break; +// case 'a' : t << '\343'; break; +// case 'n' : t << '\361'; break; +// case 'o' : t << '\365'; break; +// default: t << '?'; break; +// } +//} +// +//void RTFGenerator::writeRing(char c) +//{ +// switch(c) +// { +// case 'A' : t << '\305'; break; +// case 'a' : t << '\345'; break; +// default: t << '?'; break; +// } +//} +// +//void RTFGenerator::writeCCedil(char c) +//{ +// switch(c) +// { +// case 'C' : t << '\307'; break; +// case 'c' : t << '\347'; break; +// default: t << '?'; break; +// } +//} +// /** * VERY brittle routine inline RTF's included by other RTF's. * it is recursive and ugly. diff --git a/src/rtfgen.h b/src/rtfgen.h index a3aec7a..07f8ae7 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -72,11 +72,11 @@ class RTFGenerator : public OutputGenerator void endIndexValue(const char *,bool); void startItemList(); void endItemList(); - void startEnumList(); - void endEnumList(); - void startAlphabeticalIndexList() {} - void endAlphabeticalIndexList() {} - void writeIndexHeading(const char *) {} + //void startEnumList(); + //void endEnumList(); + //void startAlphabeticalIndexList() {} + //void endAlphabeticalIndexList() {} + //void writeIndexHeading(const char *) {} void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); void codify(const char *text); @@ -88,7 +88,7 @@ class RTFGenerator : public OutputGenerator void endTextLink(); void startHtmlLink(const char *url); void endHtmlLink(); - void writeMailLink(const char *url); + //void writeMailLink(const char *url); void startTypewriter() { t << "{\\f2 "; } void endTypewriter() { t << "}"; } void startGroupHeader(); @@ -114,10 +114,10 @@ class RTFGenerator : public OutputGenerator void writeAnchor(const char *fileName,const char *name); void startCodeFragment(); void endCodeFragment(); - void startPreFragment() { startCodeFragment(); } - void endPreFragment() { endCodeFragment(); } - void startVerbatimFragment() { startCodeFragment(); } - void endVerbatimFragment() { endCodeFragment(); } + //void startPreFragment() { startCodeFragment(); } + //void endPreFragment() { endCodeFragment(); } + //void startVerbatimFragment() { startCodeFragment(); } + //void endVerbatimFragment() { endCodeFragment(); } void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; } void startCodeLine() { col=0; } void endCodeLine() { lineBreak(); } @@ -152,43 +152,43 @@ class RTFGenerator : public OutputGenerator void endCenter() { t << "}"; } void startSmall() { t << "{\\sub "; } void endSmall() { t << "}"; } - void startSubscript() { t << "{\\sub " << endl;} - void endSubscript() { t << "}"; } - void startSuperscript() { t << "{\\super " << endl;} - void endSuperscript() { t << "}"; } - void startTable(bool,int); - void endTable(bool); - void startCaption(); - void endCaption(); - void nextTableRow(); - void endTableRow(); - void nextTableColumn(); - void endTableColumn(); - void writeCopyright() { t << "\251"; } - void writeQuote() { t << "\""; } - void writeUmlaut(char c); - void writeAcute(char c); - void writeGrave(char c); - void writeCirc(char c); - void writeTilde(char c); - void writeRing(char c); - void writeSharpS() { t << "\337"; } - void writeCCedil(char c); + //void startSubscript() { t << "{\\sub " << endl;} + //void endSubscript() { t << "}"; } + //void startSuperscript() { t << "{\\super " << endl;} + //void endSuperscript() { t << "}"; } + //void startTable(bool,int); + //void endTable(bool); + //void startCaption(); + //void endCaption(); + //void nextTableRow(); + //void endTableRow(); + //void nextTableColumn(); + //void endTableColumn(); + //void writeCopyright() { t << "\251"; } + //void writeQuote() { t << "\""; } + //void writeUmlaut(char c); + //void writeAcute(char c); + //void writeGrave(char c); + //void writeCirc(char c); + //void writeTilde(char c); + //void writeRing(char c); + //void writeSharpS() { t << "\337"; } + //void writeCCedil(char c); void startMemberDescription(); void endMemberDescription(); void startDescList(SectionTypes); - void endDescList(); + //void endDescList(); void startSimpleSect(SectionTypes,const char *,const char *,const char *); void endSimpleSect(); void startParamList(ParamListTypes,const char *); void endParamList(); - void endDescTitle(); + //void endDescTitle(); void writeDescItem(); void startSection(const char *,const char *,SectionInfo::SectionType); void endSection(const char *,SectionInfo::SectionType); - void writeSectionRef(const char *,const char *,const char *,const char *); - void writeSectionRefItem(const char *,const char *,const char *); + //void writeSectionRef(const char *,const char *,const char *,const char *); + //void writeSectionRefItem(const char *,const char *,const char *); //void writeSectionRefAnchor(const char *,const char *,const char *); void addIndexItem(const char *,const char *); void startIndent(); @@ -203,12 +203,12 @@ class RTFGenerator : public OutputGenerator void endPageRef(const char *,const char *); void startQuickIndexItem(const char *,const char *) {} void endQuickIndexItem() {} - void writeFormula(const char *,const char *); + //void writeFormula(const char *,const char *); void writeNonBreakableSpace(int); - void startImage(const char *,const char *,bool); - void endImage(bool); - void startDotFile(const char *,bool); - void endDotFile(bool); + //void startImage(const char *,const char *,bool); + //void endImage(bool); + //void startDotFile(const char *,bool); + //void endDotFile(bool); void startDescTable(); void endDescTable(); @@ -248,13 +248,13 @@ class RTFGenerator : public OutputGenerator void startFontClass(const char *) {} void endFontClass() {} - void startHtmlOnly() {} - void endHtmlOnly() {} - void startLatexOnly() {} - void endLatexOnly() {} + //void startHtmlOnly() {} + //void endHtmlOnly() {} + //void startLatexOnly() {} + //void endLatexOnly() {} - void startSectionRefList() {} - void endSectionRefList() {} + //void startSectionRefList() {} + //void endSectionRefList() {} void writeCodeAnchor(const char *) {} diff --git a/src/scanner.l b/src/scanner.l index 59c656c..a3d2c76 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -122,6 +122,7 @@ static QCString formulaText; static bool useOverrideCommands = FALSE; static bool insideIDL = FALSE; static bool insideJava = FALSE; +static bool insideCS = FALSE; static bool insidePHP = FALSE; static bool insidePHPCode = FALSE; static bool insideCppQuote = FALSE; @@ -391,7 +392,8 @@ static void setContext() QCString fileName = yyFileName; insideIDL = fileName.right(4)==".idl" || fileName.right(4)==".odl"; insideJava = fileName.right(5)==".java"; - insidePHP = fileName.right(4)==".php" || fileName.right(4)==".inc"; + insideCS = fileName.right(3)==".cs"; + insidePHP = fileName.right(4)==".php" || fileName.right(4)==".inc"; if ( insidePHP ) { useOverrideCommands = TRUE; @@ -510,6 +512,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* LABELID [a-z_A-Z][a-z_A-Z0-9\-]* SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?) SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) +CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID}) ATTR ({B}+[^>\n]*)? A [aA] BR [bB][rR] @@ -653,6 +656,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) %x PackageName %x GetCallType %x JavaImport +%x CSAccessorDecl %% @@ -1277,25 +1281,21 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) insideTryBlock=FALSE; BEGIN(TryFunctionBlock); } -// else if ( insidePHP && strcmp(yytext,"function")==0 ) -// { -// BEGIN( -// } else { if (YY_START==FindMembers) { addType( current ) ; } - if (insideJava && strcmp(yytext,"public")==0) + if ((insideJava || insideCS) && strcmp(yytext,"public")==0) { current->protection = Public; } - else if (insideJava && strcmp(yytext,"protected")==0) + else if ((insideJava || insideCS) && strcmp(yytext,"protected")==0) { current->protection = Protected; } - else if (insideJava && strcmp(yytext,"private")==0) + else if ((insideJava || insideCS) && strcmp(yytext,"private")==0) { current->protection = Private; } @@ -1318,7 +1318,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } } "." { - if (insideJava) + if (insideJava || insideCS) { current->name+="."; } @@ -2727,6 +2727,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) lineCount(); BEGIN( ClassVar ); } +{CSSCOPENAME} { // C# style scope + current->name = substitute(yytext,".","::"); + lineCount(); + BEGIN( ClassVar ); + } {SCOPENAME}{BN}*/"(" { if (insideIDL && strncmp(yytext,"switch",6)==0 && !isId(yytext[6])) { @@ -2792,7 +2797,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } ":" { current->type.resize(0); - if (current->section == Entry::INTERFACE_SEC || current->section == Entry::STRUCT_SEC || insidePHP) + if (current->section == Entry::INTERFACE_SEC || + current->section == Entry::STRUCT_SEC || + insidePHP || insideCS + ) baseProt=Public; else baseProt=Private; @@ -2889,7 +2897,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) current->extends->append( new BaseInfo(baseName,baseProt,baseVirt) ); - if (current->section == Entry::INTERFACE_SEC || insideJava || insidePHP) + if (current->section == Entry::INTERFACE_SEC || insideJava || insidePHP || insideCS) baseProt=Public; else baseProt=Private; @@ -3040,23 +3048,59 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) lineCount(); } "{" { - if (insideJava && current->stat && current->name.isEmpty() && current->type.isEmpty()) + if (insideCS && !current->name.isEmpty() && !current->type.isEmpty()) { - // static Java initializer - needsSemi = FALSE; + if (current->type.left(6)=="event " || current->type.find("event")!=-1) // event + { + current->mtype = mtype = Event; + } + else // property + { + current->mtype = mtype = Property; + } + current->bodyLine = yyLineNr; + curlyCount=0; + BEGIN(CSAccessorDecl); } else { - needsSemi = TRUE; + if ((insideJava || insideCS) && + current->stat && + current->name.isEmpty() && + current->type.isEmpty() + ) + { + // static Java initializer + needsSemi = FALSE; + } + else + { + needsSemi = TRUE; + } + current->type.resize(0); + current->name.resize(0); + current->args.resize(0); + current->argList->clear(); + curlyCount=0; + BEGIN( SkipCurlyBlock ); } - cur