From 6c380ba91ae41c6d5c409a5163119318932ae2a3 Mon Sep 17 00:00:00 2001 From: Dmitry Soloviev Date: Mon, 13 Feb 2017 15:30:52 +0100 Subject: Add support for std::shared_ptr --- src/doxygen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index d3554cf..e6d655c 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -342,6 +342,7 @@ static STLInfo g_stlinfo[] = { "auto_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // deprecated { "smart_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 { "unique_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 + { "shared_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++14 { "weak_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 { "ios_base", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 { "error_code", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 @@ -515,7 +516,7 @@ static void addSTLClasses(EntryNav *rootNav) { addSTLMember(classEntryNav,info->templType2,info->templName2); } - if (fullName=="std::auto_ptr" || fullName=="std::smart_ptr" || + if (fullName=="std::auto_ptr" || fullName=="std::smart_ptr" || fullName=="std::shared_ptr" || fullName=="std::unique_ptr" || fullName=="std::weak_ptr") { Entry *memEntry = new Entry; -- cgit v0.12 From 65a3129eea3d3f807fa6a641087c26c3d0100eac Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 18 Jun 2018 18:51:21 +0200 Subject: Bug 734308 - Error message when using memberof in a C macro Made a better warning message, a 'define' is a global setting and cannot be made a member of a struct / class. --- src/classdef.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/classdef.cpp b/src/classdef.cpp index 4977760..1af4700 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -671,6 +671,10 @@ void ClassDef::internalInsertMember(MemberDef *md, case MemberType_Variable: addMemberToList(MemberListType_variableMembers,md,FALSE); break; + case MemberType_Define: + warn(md->getDefFileName(),md->getDefLine()-1,"A define (%s) cannot be made a member of %s", + md->name().data(), this->name().data()); + break; default: err("Unexpected member type %d found!\n",md->memberType()); } -- cgit v0.12 From 657a6b5348d453fd1351b8c3238426e25acdbbb9 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 14 Jul 2018 16:43:17 +0200 Subject: Bug 520975 - Unnamed parameters parsed incorrectly Added "signed" and "unsigned" to the list of "special types" analogous to "const" and "volatile" Created a function for this that would make it possible to have also constructs like "const const" recognized. --- src/defargs.l | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/defargs.l b/src/defargs.l index 7f1e1bb..f925ffb 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -52,6 +52,7 @@ #include #include #include +#include #include "defargs.h" #include "entry.h" @@ -102,6 +103,17 @@ static int yyread(char *buf,int max_size) return c; } +/* bug_520975 */ +static bool checkSpecialType(QCString &typ) +{ + QStringList qsl=QStringList::split(' ',typ); + for(uint j=0;jtype.mid(sv)=="union" || a->type.mid(sv)=="class" || a->type.mid(sv)=="typename" || - a->type=="const" || - a->type=="volatile" + checkSpecialType(a->type) ) { a->type = a->type + " " + a->name; -- cgit v0.12 From 7ef7b137d38d7ddcbcef787704317531b44c2baf Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 14 Jul 2018 19:28:02 +0200 Subject: Bug 436883 - Handling of unnamed parameters (C/C++) unclear Also the name should not be a reserved type of word. --- src/defargs.l | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/defargs.l b/src/defargs.l index f925ffb..47fa763 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -104,8 +104,10 @@ static int yyread(char *buf,int max_size) } /* bug_520975 */ -static bool checkSpecialType(QCString &typ) +static bool checkSpecialType(QCString &typ, QCString &nam) { + if (nam == "unsigned" || nam == "signed" || + nam == "volatile" || nam == "const") return TRUE; QStringList qsl=QStringList::split(' ',typ); for(uint j=0;jtype.mid(sv)=="union" || a->type.mid(sv)=="class" || a->type.mid(sv)=="typename" || - checkSpecialType(a->type) + checkSpecialType(a->type, a->name) ) { a->type = a->type + " " + a->name; -- cgit v0.12 From fb7592546b89471e62f68892c945ab7db98875b6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 9 Aug 2018 12:55:44 +0200 Subject: Possibility to have a \image command inside a tag Enable the possibility to have a `\image` command inside a tag --- src/docparser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e050b3..2f77a31 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1561,6 +1561,9 @@ reparsetoken: doctokenizerYYsetStatePara(); } break; + case CMD_IMAGE: + ((DocPara *)parent) -> handleImage("image"); + break; default: return FALSE; } -- cgit v0.12 From fcb7d9fb380b714e1db9a279ceeba5af4cf59965 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 10 Aug 2018 14:33:14 +0200 Subject: Correcting labels for citations The labels for RTF and XML were incorrect due to the fact that the wrong branch was chosen in the code (the newAnchor was set for the results of the `\cite ` command as well). Small readability issue with XML (when there are a lot of citations). --- src/docparser.cpp | 11 ++++++----- src/xmldocvisitor.cpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e050b3..0a9a10c 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1877,11 +1877,8 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label"); } - if (newAnchor) // found - { - m_anchor = id; - } - else if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix) + + if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix) { CiteInfo *cite = Doxygen::citeDict->find(id.mid(CiteConsts::anchorPrefix.length())); if (cite) @@ -1896,6 +1893,10 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) m_file = "invalid"; } } + else if (newAnchor) // found + { + m_anchor = id; + } else // found \anchor label { SectionInfo *sec = Doxygen::sectionDict->find(id); diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 93765b1..adb2e33 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -488,7 +488,7 @@ void XmlDocVisitor::visitPre(DocPara *) void XmlDocVisitor::visitPost(DocPara *) { if (m_hide) return; - m_t << ""; + m_t << "" << endl; } void XmlDocVisitor::visitPre(DocRoot *) -- cgit v0.12 From e2306e7ff24e72d49893eb9ebc568b468298e236 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 10 Aug 2018 14:44:13 +0200 Subject: Correcting labels for citations Corrected change in test. --- testing/012/citelist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/012/citelist.xml b/testing/012/citelist.xml index 96b94a3..f415968 100644 --- a/testing/012/citelist.xml +++ b/testing/012/citelist.xml @@ -9,7 +9,7 @@ - [1] + [1] DonaldE. Knuth. Tex and Metafont, New Directions in Typesetting. American Mathematical Society and Digital Press, Stanford, 1979. -- cgit v0.12 From 09af3e03a55a5b02ebb6254c39a09877c8bd671b Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 11 Aug 2018 11:35:40 +0200 Subject: Bug 748927 - Navigation incorrect with escaped symbols Due to the fact that constructs like `` in a page title are seen as an XML-tag (with a resulting warning) the `<` should be escaped but this leads to the fact that the escape sign is shown in the bars on top of a HTML page. The basic problem is due to the fact that page titles are not really interpreted by doxygen (as "nothing" can be, generically, handled in the title of a page. --- src/commentscan.l | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commentscan.l b/src/commentscan.l index e40d80f..6d3bec0 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1588,8 +1588,12 @@ RCSTAG "$"{ID}":"[^\n$]+"$" . { // ignore other stuff } .*"\n" { // second argument; page title - yyLineNr++; - current->args = yytext; + yyLineNr++; + // bug 748927 + QCString tmp = yytext; + tmp = substitute(substitute(tmp,"@<","<"),"@>",">"); + tmp = substitute(substitute(tmp,"\\<","<"),"\\>",">"); + current->args = tmp; addOutput('\n'); BEGIN( Comment ); } -- cgit v0.12 From ed562f3ed5e3208a1351387441028c7831ad14fd Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 15 Aug 2018 14:40:07 +0200 Subject: Markdown list wrong displayed In some, rare, cases a markdown list was wrongly displayed (regression due to change of place of markdown handling) /** @mainpage * * * elem1 * * elem2 * Some text (actually found due to a table) */ --- src/markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index 0ca95a4..ab145c8 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1949,7 +1949,7 @@ void writeOneLineHeaderOrRuler(GrowBuf &out,const char *data,int size) out.addStr(data,size); if (hasLineBreak(data,size)) { - out.addStr("
"); + out.addStr("\n"); } } } -- cgit v0.12 From 0fc16d17963c50caa41959cc321d796a931aba44 Mon Sep 17 00:00:00 2001 From: aquayan <42374892+aquayan@users.noreply.github.com> Date: Fri, 24 Aug 2018 09:30:22 +0200 Subject: Update doxygen.cpp Reading a few thousands of input CPP/H files in alphabetical order is very slow because of using the inSort construct. The inSort function does a linear loop through the list to find the right alphabetical position, leading to a quadratic algorithm. During the creation of the file list there is no need to keep it sorted - it is not used at all yet. Therefore I propose to just append them and to a final sort at the end of the creation of the file list. For my use case with several thousands of input files, this reduces creating the file list from about an hour to a few seconds !! --- src/doxygen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index bf93a9b..ed3ffc9 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -9633,7 +9633,7 @@ int readDir(QFileInfo *fi, { fn = new FileName(cfi->absFilePath().utf8(),name); fn->append(fd); - if (fnList) fnList->inSort(fn); + if (fnList) fnList->append(fn); fnDict->insert(name,fn); } } @@ -9732,7 +9732,7 @@ int readFileOrDirectory(const char *s, { fn = new FileName(filePath,name); fn->append(fd); - if (fnList) fnList->inSort(fn); + if (fnList) fnList->append(fn); fnDict->insert(name,fn); } } @@ -10923,6 +10923,7 @@ void searchInputFiles() } s=inputList.next(); } + Doxygen::inputNameList->sort(); delete killDict; g_s.end(); } -- cgit v0.12 From 1f849a16671e1c9afff4ee30a5b5a33d271e8684 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 24 Aug 2018 10:56:38 +0200 Subject: Issue_6456 Using # in links causes errors in PDF generation - The # sign in an URL needs to be escaped as longtabu reads the table body as the argument to a command, so the self-escaping mechanism of \href cannot work (from https://tex.stackexchange.com/questions/447461/having-a-hash-sign-in-href-in-a-longtabu-cell) - a regression regarding the change from `\tt` to `\texttt` (needed `{ ... }` as `\href` has 2 arguments ) --- src/latexdocvisitor.cpp | 14 ++++++++------ src/latexgen.cpp | 4 ++-- src/util.cpp | 19 +++++++++++++++++++ src/util.h | 1 + 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index d2c4c5d..76e3a55 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -215,13 +215,14 @@ void LatexDocVisitor::visit(DocURL *u) if (m_hide) return; if (Config_getBool(PDF_HYPERLINKS)) { + m_t << endl << "%% AME " << u->url() <isEmail()) m_t << "mailto:"; - m_t << u->url() << "}"; + m_t << latexFilterURL(u->url()) << "}"; } - m_t << "\\texttt{ "; + m_t << "{\\texttt{ "; filter(u->url()); - m_t << "}"; + m_t << "}}"; } void LatexDocVisitor::visit(DocLineBreak *) @@ -1245,17 +1246,18 @@ void LatexDocVisitor::visitPre(DocHRef *href) if (m_hide) return; if (Config_getBool(PDF_HYPERLINKS)) { + m_t << endl << "%% AME " << href->url() <url(); + m_t << latexFilterURL(href->url()); m_t << "}"; } - m_t << "\\texttt{ "; + m_t << "{\\texttt{ "; } void LatexDocVisitor::visitPost(DocHRef *) { if (m_hide) return; - m_t << "}"; + m_t << "}}"; } void LatexDocVisitor::visitPre(DocHtmlHeader *header) diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 474d368..6d399c5 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1369,12 +1369,12 @@ void LatexGenerator::startHtmlLink(const char *url) t << url; t << "}"; } - t << "\\texttt{ "; + t << "{\\texttt{ "; } void LatexGenerator::endHtmlLink() { - t << "}"; + t << "}}"; } //void LatexGenerator::writeMailLink(const char *url) diff --git a/src/util.cpp b/src/util.cpp index b387a84..5fc8822 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6964,6 +6964,25 @@ QCString latexEscapePDFString(const char *s) return result.data(); } +QCString latexFilterURL(const char *s) +{ + QGString result; + FTextStream t(&result); + const char *p=s; + char c; + while ((c=*p++)) + { + switch (c) + { + case '#': t << "\\#"; break; + default: + t << c; + break; + } + } + return result.data(); +} + QCString rtfFormatBmkStr(const char *name) { diff --git a/src/util.h b/src/util.h index a9eee67..3626574 100644 --- a/src/util.h +++ b/src/util.h @@ -346,6 +346,7 @@ void filterLatexString(FTextStream &t,const char *str, QCString latexEscapeLabelName(const char *s,bool insideTabbing); QCString latexEscapeIndexChars(const char *s,bool insideTabbing); QCString latexEscapePDFString(const char *s); +QCString latexFilterURL(const char *s); QCString rtfFormatBmkStr(const char *name); -- cgit v0.12 From fdd10f2415c65a9a34d64c985ea5ff0a6f4b6654 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 24 Aug 2018 14:48:56 +0200 Subject: Correction of some coloring of code comments in VHDL, adding data type 'positive' --- src/vhdlcode.l | 69 +++++++++++++++++++++++++++--------------------------- src/vhdldocgen.cpp | 4 ++-- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 68dcafb..ee0731f 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -370,7 +370,7 @@ static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,b //g_code->codify(sp); if (comment) { - writeFont("keyword",line.data()); + writeFont("comment",line.data()); } else { @@ -381,7 +381,7 @@ static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,b else { if (comment) - writeFont("keyword",sp); + writeFont("comment",sp); else writeWord(sp,cl,classlink); done=TRUE; @@ -1478,11 +1478,11 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI writeFont("keyword",vhdlcodeYYtext); } -^{B}*{XILINX}[^\n]* { - writeWord(yytext); - //codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE); - } - +^{B}*{XILINX}/[^a-zA-Z0-9_] { + writeWord(yytext); + //codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE); + } + ^{B}*"set_"[^\n]* { writeWord(yytext); } @@ -1497,37 +1497,38 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI } <*>\n{TEXTT} { // found normal or special comment on its own line - QCString text(vhdlcodeYYtext); - int i=text.find("--"); - if (text.mid(i,3)=="--!" && // hide special comment - Config_getBool(STRIP_CODE_COMMENTS)) - { - g_yyLineNr++; // skip complete line - } - else // normal comment - { - // startFontClass("keyword"); - codifyLines(text,0,FALSE,TRUE); - // endFontClass(); - } + QCString text(vhdlcodeYYtext); + int i=text.find("--"); + if (text.mid(i,3)=="--!") // && // hide special comment + { + if (!Config_getBool(STRIP_CODE_COMMENTS)) + { + codifyLines(text,0,FALSE,TRUE); + } + g_yyLineNr++; // skip complete line + } + else // normal comment + { + codifyLines(text,0,FALSE,TRUE); + } } <*>{TEXTT} { // found normal or special comment after something - QCString text(vhdlcodeYYtext); - int i=text.find("--"); - if (text.mid(i,3)=="--!" && - Config_getBool(STRIP_CODE_COMMENTS)) - { - // hide special comment - } - else // normal comment - { - // startFontClass("keyword"); - codifyLines(text,0,FALSE,TRUE); - // endFontClass(); - } + QCString text(vhdlcodeYYtext); + int i=text.find("--"); + if (text.mid(i,3)=="--!") + { + // hide special comment + if (!Config_getBool(STRIP_CODE_COMMENTS)) + { + codifyLines(text,0,FALSE,TRUE); + } + } + else // normal comment + { + codifyLines(text,0,FALSE,TRUE); + } } - %% /*@ ---------------------------------------------------------------------------- diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 287565b..373e6de 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -602,7 +602,7 @@ const char* g_vhdlKeyWordMap1[] = { "natural","unsigned","signed","string","boolean", "bit","bit_vector","character", "std_ulogic","std_ulogic_vector","std_logic","std_logic_vector","integer", - "real","float","ufixed","sfixed","time",0 + "real","float","ufixed","sfixed","time","positive",0 }; // logic @@ -667,7 +667,7 @@ const char* g_vhdlKeyWordMap3[] = QCString* VhdlDocGen::findKeyWord(const QCString& tmp) { static QCString vhdlkeyword("vhdlkeyword"); - static QCString vhdltype("comment"); + static QCString vhdltype("keywordtype"); static QCString vhdllogic("vhdllogic"); static QCString preprocessor("keywordflow"); -- cgit v0.12 From a68e6c0724f99dfa6cea25f7d56fb6077100fc85 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 26 Aug 2018 13:13:01 +0200 Subject: Correcting warning messages and echoing unknown command - In case an unknown command is given this was shown as a warning but not as normal text in the output, for this also a distinction between `\`and `@` commands has to be made - corrected command name in warning messages when handling arguments - making handling of some warning messages consistent --- src/docparser.cpp | 202 ++++++++++++++++------------------------------------- src/docparser.h | 2 +- src/doctokenizer.h | 3 +- src/doctokenizer.l | 19 ++--- 4 files changed, 72 insertions(+), 154 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index 8efe8fa..2c51507 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -866,7 +866,30 @@ static bool findDocsForMemberOrCompound(const char *commandName, return FALSE; } //--------------------------------------------------------------------------- +inline void errorHandleDefaultToken(DocNode *parent,int tok, + QList &children,const char *txt) +{ + switch (tok) + { + case TK_COMMAND: + case TK_COMMAND1: + children.append(new DocWord(parent,(tok == TK_COMMAND ? '@' : '\\') + g_token->name)); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a %s", + qPrint((tok == TK_COMMAND ? '@' : '\\') + g_token->name), txt); + break; + case TK_SYMBOL: + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found found as part of a %s", + qPrint(g_token->name), txt); + break; + default: + children.append(new DocWord(parent,g_token->name)); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s found as part of a %s", + tokToString(tok), txt); + break; + } +} +//--------------------------------------------------------------------------- // forward declaration static bool defaultHandleToken(DocNode *parent,int tok, QList &children,bool @@ -876,6 +899,7 @@ static int handleStyleArgument(DocNode *parent,QList &children, const QCString &cmdName) { DBG(("handleStyleArgument(%s)\n",qPrint(cmdName))); + QCString saveCmdName = cmdName; int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { @@ -901,14 +925,6 @@ static int handleStyleArgument(DocNode *parent,QList &children, { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s as the argument of a \\%s command", - qPrint(g_token->name),qPrint(cmdName)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found while handling command %s", - qPrint(g_token->name),qPrint(cmdName)); - break; case TK_HTMLTAG: if (insideLI(parent) && Mappers::htmlTagMapper->map(g_token->name) && g_token->endTag) { // ignore as the end of a style command @@ -917,8 +933,7 @@ static int handleStyleArgument(DocNode *parent,QList &children, return tok; break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s while handling command %s", - tokToString(tok),qPrint(cmdName)); + errorHandleDefaultToken(parent,tok,children,"\\" + saveCmdName + " command"); break; } break; @@ -1295,21 +1310,7 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QListname), Mappers::cmdMapper->find(cmd).data()); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(parent,tok,children,Mappers::cmdMapper->find(cmd).data()); } } // parse size attributes @@ -1368,7 +1369,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList &children { DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno)); if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL || - tok==TK_COMMAND || tok==TK_HTMLTAG + tok==TK_COMMAND || tok==TK_COMMAND1 || tok==TK_HTMLTAG ) { DBG((" name=%s",qPrint(g_token->name))); @@ -1379,6 +1380,7 @@ reparsetoken: switch (tok) { case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(tokenName)) { case CMD_BSLASH: @@ -2308,21 +2310,7 @@ void DocSecRefItem::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\refitem", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"\\refitem"); } } doctokenizerYYsetStatePara(); @@ -2370,7 +2358,7 @@ void DocSecRefList::parse() // handle items while (tok) { - if (tok==TK_COMMAND) + if (tok==TK_COMMAND || tok == TK_COMMAND1) { switch (Mappers::cmdMapper->map(g_token->name)) { @@ -2450,21 +2438,7 @@ void DocInternalRef::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\ref", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"\\ref"); } } @@ -2608,19 +2582,10 @@ void DocRef::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\ref", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; case TK_HTMLTAG: break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); + errorHandleDefaultToken(this,tok,m_children,"\\ref"); break; } } @@ -2732,6 +2697,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) switch (tok) { case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(g_token->name)) { case CMD_ENDLINK: @@ -2747,13 +2713,13 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) } break; case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found as part of a \\link", qPrint(g_token->name)); break; case TK_HTMLTAG: if (g_token->name!="see" || !isXmlLink) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected xml/html command %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected xml/html command %s found as part of a \\link", qPrint(g_token->name)); } goto endlink; @@ -2931,21 +2897,7 @@ void DocVhdlFlow::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\vhdlflow", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"\\vhdlflow"); } } tok=doctokenizerYYlex(); @@ -2992,10 +2944,6 @@ int DocHtmlHeader::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a tag", - qPrint(g_token->name),m_level); - break; case TK_HTMLTAG: { int tagId=Mappers::htmlTagMapper->map(g_token->name); @@ -3073,14 +3021,10 @@ int DocHtmlHeader::parse() } break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; + char tmp[20]; + sprintf(tmp,"tag",m_level); + errorHandleDefaultToken(this,tok,m_children,tmp); } } } @@ -3112,14 +3056,6 @@ int DocHRef::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a
.. block", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; case TK_HTMLTAG: { @@ -3136,8 +3072,7 @@ int DocHRef::parse() } break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok),doctokenizerYYlineno); + errorHandleDefaultToken(this,tok,m_children,".. block"); break; } } @@ -3271,6 +3206,7 @@ int DocIndexEntry::parse() } break; case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(g_token->name)) { case CMD_BSLASH: m_entry+='\\'; break; @@ -3358,14 +3294,6 @@ int DocHtmlCaption::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a tag", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; case TK_HTMLTAG: { int tagId=Mappers::htmlTagMapper->map(g_token->name); @@ -3382,9 +3310,7 @@ int DocHtmlCaption::parse() } break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; + errorHandleDefaultToken(this,tok,m_children," tag"); } } } @@ -3898,6 +3824,7 @@ int DocHtmlDescTitle::parse() switch (tok) { case TK_COMMAND: + case TK_COMMAND1: { QCString cmdName=g_token->name; bool isJavaLink=FALSE; @@ -3908,7 +3835,7 @@ int DocHtmlDescTitle::parse() int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\%s command", qPrint(g_token->name)); } else @@ -3917,7 +3844,7 @@ int DocHtmlDescTitle::parse() tok=doctokenizerYYlex(); // get the reference id if (tok!=TK_WORD) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of \\%s command", tokToString(tok),qPrint(cmdName)); } else @@ -3938,7 +3865,7 @@ int DocHtmlDescTitle::parse() int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\%s command", qPrint(cmdName)); } else @@ -3947,7 +3874,7 @@ int DocHtmlDescTitle::parse() tok=doctokenizerYYlex(); if (tok!=TK_WORD) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of \\%s command", tokToString(tok),qPrint(cmdName)); } else @@ -3966,13 +3893,13 @@ int DocHtmlDescTitle::parse() break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a
tag", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s found as part of a
tag", qPrint(g_token->name)); } } break; case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol \\%s found as part of a
tag", qPrint(g_token->name)); break; case TK_HTMLTAG: @@ -4013,7 +3940,7 @@ int DocHtmlDescTitle::parse() } break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s found as part of a
tag", tokToString(tok)); break; } @@ -4518,21 +4445,7 @@ void DocTitle::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a title section", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"title section"); } } doctokenizerYYsetStatePara(); @@ -5393,7 +5306,7 @@ void DocPara::handleInheritDoc() } -int DocPara::handleCommand(const QCString &cmdName) +int DocPara::handleCommand(const QCString &cmdName, const int tok) { DBG(("handleCommand(%s)\n",qPrint(cmdName))); int retval = RetVal_OK; @@ -5401,6 +5314,7 @@ int DocPara::handleCommand(const QCString &cmdName) switch (cmdId) { case CMD_UNKNOWN: + m_children.append(new DocWord(this,(tok == TK_COMMAND ? '@' : '\\') + cmdName)); warn_doc_error(g_fileName,doctokenizerYYlineno,"Found unknown command `\\%s'",qPrint(cmdName)); break; case CMD_EMPHASIS: @@ -6491,7 +6405,7 @@ int DocPara::parse() reparsetoken: DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno)); if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL || - tok==TK_COMMAND || tok==TK_HTMLTAG + tok==TK_COMMAND || tok == TK_COMMAND1 || tok==TK_HTMLTAG ) { DBG((" name=%s",qPrint(g_token->name))); @@ -6589,7 +6503,7 @@ reparsetoken: } else // other section { - tok = TK_COMMAND; + tok = TK_COMMAND1; } DBG(("reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; @@ -6635,6 +6549,7 @@ reparsetoken: } break; case TK_COMMAND: + case TK_COMMAND1: { // see if we have to start a simple section int cmd = Mappers::cmdMapper->map(g_token->name); @@ -6670,7 +6585,7 @@ reparsetoken: } // handle the command - retval=handleCommand(g_token->name); + retval=handleCommand(g_token->name,tok); DBG(("handleCommand returns %x\n",retval)); // check the return value @@ -6688,7 +6603,7 @@ reparsetoken: } else // other section { - tok = TK_COMMAND; + tok = TK_COMMAND1; } DBG(("reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; @@ -6961,6 +6876,7 @@ void DocText::parse() } break; case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(g_token->name)) { case CMD_BSLASH: diff --git a/src/docparser.h b/src/docparser.h index d7390c2..2e932be 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -1151,7 +1151,7 @@ class DocPara : public CompAccept bool isFirst() const { return m_isFirst; } bool isLast() const { return m_isLast; } - int handleCommand(const QCString &cmdName); + int handleCommand(const QCString &cmdName,const int tok); int handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &tagHtmlAttribs); int handleHtmlEndTag(const QCString &tagName); int handleSimpleSection(DocSimpleSect::Type t,bool xmlContext=FALSE); diff --git a/src/doctokenizer.h b/src/doctokenizer.h index b3b9fa5..d0bdf06 100644 --- a/src/doctokenizer.h +++ b/src/doctokenizer.h @@ -34,12 +34,13 @@ enum Tokens TK_WHITESPACE = 3, TK_LISTITEM = 4, TK_ENDLIST = 5, - TK_COMMAND = 6, + TK_COMMAND = 6, //! Command starting with `@` TK_HTMLTAG = 7, TK_SYMBOL = 8, TK_NEWPARA = 9, TK_RCSTAG = 10, TK_URL = 11, + TK_COMMAND1 = 12, //! Command starting with `\` RetVal_OK = 0x10000, RetVal_SimpleSec = 0x10001, diff --git a/src/doctokenizer.l b/src/doctokenizer.l index a162fb3..dc56ca9 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -122,6 +122,7 @@ const char *tokToString(int token) case TK_NEWPARA: return "TK_NEWPARA"; case TK_RCSTAG: return "TK_RCSTAG"; case TK_URL: return "TK_URL"; + case TK_COMMAND1: return "TK_COMMAND1"; } return "ERROR"; } @@ -572,14 +573,14 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} bool ok; g_token->id = QCString(yytext).right((int)yyleng-6).toInt(&ok); ASSERT(ok); - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {CMD}"n"\n { /* \n followed by real newline */ yylineno++; g_token->name = yytext+1; g_token->name = g_token->name.stripWhiteSpace(); g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {SPCMD1} | {SPCMD2} | @@ -587,7 +588,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext+1; g_token->name = g_token->name.stripWhiteSpace(); g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {PARAMIO} { /* param [in,out] command */ g_token->name = "param"; @@ -613,7 +614,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} { g_token->paramDir=TokenInfo::Unspecified; } - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } ("http:"|"https:"|"ftp:"|"file:"|"news:"){URLMASK}/\. { // URL. g_token->name=yytext; @@ -732,7 +733,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} } [\\@<>&$#%~] { g_token->name = yytext; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } ({BLANK}*\n)+{BLANK}*\n/{LISTITEM} { /* skip trailing paragraph followed by new list item */ if (g_insidePre || g_autoListLevel==0) @@ -925,7 +926,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} {SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {ID}"=" { /* attribute */ if (yytext[0]=='%') // strip % if present @@ -959,7 +960,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} {SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {WORD1NQ} | {WORD2NQ} { /* word */ @@ -1090,7 +1091,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} {SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {WORD1NQ} | {WORD2NQ} { @@ -1322,7 +1323,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} <*>[\\@<>&$#%~"=] { /* unescaped special character */ //warn(g_fileName,yylineno,"Unexpected character `%s', assuming command \\%s was meant.",yytext,yytext); g_token->name = yytext; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } <*>. { warn(g_fileName,yylineno,"Unexpected character `%s'",yytext); -- cgit v0.12 From f0cf6f2324a2f27214b0216be9f9f0d03d32f401 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 29 Aug 2018 11:21:33 +0200 Subject: Issue 6469: Java method calls are ignored in generating call/caller graph with Graphviz Added possibility for `List list = new ArrayList<>();` and `List list = new ArrayList();` i.e. the `<...>` in the `new` part --- src/code.l | 1 + 1 file changed, 1 insertion(+) diff --git a/src/code.l b/src/code.l index 2c9b0ae..fc3e7b7 100644 --- a/src/code.l +++ b/src/code.l @@ -2627,6 +2627,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" addType(); g_name=varname; } +{SCOPETNAME}{B}*"<"[^\n\/\-\.\{\"\>]*">"/{BN}*"(" | {SCOPETNAME}/{BN}*"(" { // a() or c::a() or t::a() or A\B\foo() addType(); generateFunctionLink(*g_code,yytext); -- cgit v0.12 From 080389ee153981831ea36e14726b49f756e081bf Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 30 Aug 2018 13:21:18 +0200 Subject: Sorting of index in case of LaTex In case of LaTeX the sorting was so that lowercase came after uppercase e.g.: `username` came after `useSsl`, although the index should be case insensitive. Te problem was that the sort key was filtered in such a way that a.o. uppercase symbols were preceded by `\+` for hyphenation. The key doesn't need this hyphenation (as there is a separate field for the display name). The `\+` has been filtered out now. --- src/util.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index b387a84..b524863 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6865,11 +6865,37 @@ void filterLatexString(FTextStream &t,const char *str, } } +static void reFilterLatexString(FTextStream &t,const char *str) +{ + if (str==0) return; + const unsigned char *p=(const unsigned char *)str; + unsigned char c; + unsigned char pc='\0'; + while (*p) + { + c=*p++; + + switch(c) + { + case '\\': + if (*p == '+') p++; + else t << '\\'; + break; + default: + t << (char)c; + break; + } + pc = c; + } +} + QCString latexEscapeLabelName(const char *s,bool insideTabbing) { QGString result; + QGString result1; QCString tmp(qstrlen(s)+1); FTextStream t(&result); + FTextStream t1(&result1); const char *p=s; char c; int i; @@ -6899,7 +6925,13 @@ QCString latexEscapeLabelName(const char *s,bool insideTabbing) break; } } - return result.data(); + if (!insideTabbing) + { + reFilterLatexString(t1,result.data()); + return result1.data(); + } + else + return result.data(); } QCString latexEscapeIndexChars(const char *s,bool insideTabbing) -- cgit v0.12 From 8176639e13357f74d317c631a5bf01a60bb543af Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 7 Sep 2018 11:06:33 +0200 Subject: Extending tests with extra possibilities - docbook for docbook output including small test on validity (i.e. basic xml test) - rtf for rtf output - start_id and end_id creating the possibility to run one range of tests -- subdirs us CREATE_SUBDIRS=YES --- testing/README.txt | 9 +++- testing/runtests.py | 117 ++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 111 insertions(+), 15 deletions(-) diff --git a/testing/README.txt b/testing/README.txt index fd7536d..e66632f 100644 --- a/testing/README.txt +++ b/testing/README.txt @@ -7,7 +7,7 @@ has the same 3 digit number. The directory contains one or more reference files that are compared against the XML output produced by doxygen. If the result is the same, there is no regression and the test passes. If there is a difference the test fails and the difference (in diff -u format) will be shown. -It is also possible to see whether or not the test can be built to an xhtml set +It is also possible to see whether or not the test can be built to a xhtml set of files (and tested against a DTD), it is also possible to create a pdf file for each test to see if the LaTeX / pdf generation is possible. @@ -17,6 +17,8 @@ optional parameters: --doxygen [DOXYGEN] path/name of the doxygen executable --xmllint [XMLLINT] path/name of the xmllint executable --id IDS [IDS ...] id of the test to perform + --start_id START_ID run tests starting with number n + --end_id END_ID run tests ending with number n --all perform all tests --inputdir [INPUTDIR] input directory containing the tests @@ -24,10 +26,13 @@ optional parameters: output directory to write the doxygen output to --noredir disable redirection of doxygen warnings --xml create xml output and check + --rtf create rtf output + --docbook create docbook output and check with xmllint --xhtml create xhtml output and check with xmllint --pdf create LaTeX output and create pdf from it + --subdirs use the configuration parameter CREATE_SUBDIRS=YES --keep keep result directories -In case neither --xml, --pdf or --xhtml is used the default is set to --xml. +In case neither --xml, --pdf, --rtf, --docbook or --xhtml is used the default is set to --xml. The runtest.pl has the following dependencies on 3rd party tools: - python to run the script diff --git a/testing/runtests.py b/testing/runtests.py index 9330d23..be8aae9 100644 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -43,6 +43,28 @@ class Tester: rtnmsg += o return rtnmsg + def cleanup_xmllint_docbook(self,errmsg): + # For future work, first get everything valid XML + msg = self.cleanup_xmllint(errmsg).split('\n') + rtnmsg = "" + cnt = 0 + for o in msg: + if (o): + if (cnt): + cnt -= 1 + pass + elif (o.endswith("does not validate")): + pass + elif (o.find("no DTD found!")!=-1): + pass + elif (o.find("is not an NCName")!=-1): + cnt = 2 + else: + if (rtnmsg): + rtnmsg += '\n' + rtnmsg += o + return rtnmsg + def get_config(self): config = {} with open(self.args.inputdir+'/'+self.test,'r') as f: @@ -53,7 +75,7 @@ class Tester: value = m.group('value') if (key=='config'): value = value.replace('$INPUTDIR',self.args.inputdir) - #print('key=%s value=%s' % (key,value)) + # print('key=%s value=%s' % (key,value)) config.setdefault(key, []).append(value) return config @@ -74,6 +96,16 @@ class Tester: print('XML_OUTPUT=%s/out' % self.test_out, file=f) else: print('GENERATE_XML=NO', file=f) + if (self.args.rtf): + print('GENERATE_RTF=YES', file=f) + print('RTF_OUTPUT=%s/rtf' % self.test_out, file=f) + else: + print('GENERATE_RTF=NO', file=f) + if (self.args.docbook): + print('GENERATE_DOCBOOK=YES', file=f) + print('DOCBOOK_OUTPUT=%s/docbook' % self.test_out, file=f) + else: + print('GENERATE_DOCBOOK=NO', file=f) if (self.args.xhtml): print('GENERATE_HTML=YES', file=f) # HTML_OUTPUT can also be set locally @@ -82,6 +114,8 @@ class Tester: if (self.args.pdf): print('GENERATE_LATEX=YES', file=f) print('LATEX_OUTPUT=%s/latex' % self.test_out, file=f) + if self.args.subdirs: + print('CREATE_SUBDIRS=YES', file=f) if 'check' not in self.config or not self.config['check']: print('Test doesn\'t specify any files to check') @@ -97,7 +131,7 @@ class Tester: redir='' if os.system('%s %s/Doxyfile %s' % (self.args.doxygen,self.test_out,redir))!=0: - print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out)); + print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out)) sys.exit(1) # update the reference data for this test @@ -140,6 +174,8 @@ class Tester: failed_xml=False failed_html=False failed_latex=False + failed_docbook=False + failed_rtf=False msg = () # look for files to check against the reference if self.args.xml: @@ -149,8 +185,14 @@ class Tester: check_file='%s/out/%s' % (self.test_out,check) # check if the file we need to check is actually generated if not os.path.isfile(check_file): - msg += ('Non-existing file %s after \'check:\' statement' % check_file,) - break + # try with sub dirs + check_file = glob.glob('%s/out/*/*/%s' % (self.test_out,check)) + if not check_file: + check_file='%s/out/%s' % (self.test_out,check) + msg += ('Non-existing file %s after \'check:\' statement' % check_file,) + break + else: + check_file = check_file[0] # convert output to canonical form data = os.popen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read() if data: @@ -171,6 +213,34 @@ class Tester: xml_output='%s/out' % self.test_out shutil.rmtree(xml_output,ignore_errors=True) + if (self.args.rtf): + # no tests defined yet + pass + + if (self.args.docbook): + docbook_output='%s/docbook' % self.test_out + if (sys.platform == 'win32'): + redirx=' 2> %s/temp >nul:'%docbook_output + else: + redirx='2>%s/temp >/dev/null'%docbook_output + # For future work, first get everything valid XML + # exe_string = '%s --relaxng db/docbook.rng --nonet --postvalid %s/*xml %s % (self.args.xmllint,docbook_output,redirx) + tests = [] + tests.append(glob.glob('%s/*.xml' % (docbook_output))) + tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output))) + tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/') + exe_string = '%s --nonet --postvalid %s %s' % (self.args.xmllint,tests,redirx) + exe_string += ' %s more "%s/temp"' % (separ,docbook_output) + + failed_docbook=False + xmllint_out = os.popen(exe_string).read() + xmllint_out = self.cleanup_xmllint_docbook(xmllint_out) + if xmllint_out: + msg += (xmllint_out,) + failed_docbook=True + elif not self.args.keep: + shutil.rmtree(docbook_output,ignore_errors=True) + if (self.args.xhtml): html_output='%s/html' % self.test_out if (sys.platform == 'win32'): @@ -206,7 +276,7 @@ class Tester: elif not self.args.keep: shutil.rmtree(latex_output,ignore_errors=True) - if failed_xml or failed_html or failed_latex: + if failed_xml or failed_html or failed_latex or failed_docbook or failed_rtf: testmgr.ok(False,self.test_name,msg) return @@ -268,14 +338,18 @@ def main(): parser = argparse.ArgumentParser(description='run doxygen tests') parser.add_argument('--updateref',help= 'update the reference files. Should be used in combination with -id to ' - 'update the reference file(s) for the given test',action="store_true") + 'update the reference file(s) for the given test',action="store_true") parser.add_argument('--doxygen',nargs='?',default='doxygen',help= 'path/name of the doxygen executable') parser.add_argument('--xmllint',nargs='?',default='xmllint',help= 'path/name of the xmllint executable') parser.add_argument('--id',nargs='+',dest='ids',action='append',type=int,help= - 'run test with number n only (the option may be specified run test with ' - 'number n only (the option may be specified') + 'run test with number n only (the option can be specified to run test with ' + 'number n only (the option can be specified multiple times') + parser.add_argument('--start_id',dest='start_id',type=int,help= + 'run tests starting with number n') + parser.add_argument('--end_id',dest='end_id',type=int,help= + 'run tests ending with number n') parser.add_argument('--all',help= 'can be used in combination with -updateref to update the reference files ' 'for all tests.',action="store_true") @@ -287,17 +361,23 @@ def main(): 'disable redirection of doxygen warnings',action="store_true") parser.add_argument('--xml',help='create xml output and check', action="store_true") + parser.add_argument('--rtf',help= + 'create rtf output',action="store_true") + parser.add_argument('--docbook',help= + 'create docbook output and check with xmllint',action="store_true") parser.add_argument('--xhtml',help= 'create xhtml output and check with xmllint',action="store_true") parser.add_argument('--pdf',help='create LaTeX output and create pdf from it', action="store_true") + parser.add_argument('--subdirs',help='use the configuration parameter CREATE_SUBDIRS=YES', + action="store_true") parser.add_argument('--keep',help='keep result directories', action="store_true") test_flags = os.getenv('TEST_FLAGS', default='').split() args = parser.parse_args(test_flags + sys.argv[1:]) # sanity check - if (not args.xml) and (not args.pdf) and (not args.xhtml): + if (not args.xml) and (not args.pdf) and (not args.xhtml) and (not args.docbook and (not args.rtf)): args.xml=True if (not args.updateref is None) and (args.ids is None) and (args.all is None): parser.error('--updateref requires either --id or --all') @@ -305,15 +385,26 @@ def main(): starting_directory = os.getcwd() os.chdir(args.inputdir) # find the tests to run - if args.ids: # test ids are given by user - tests = [] + tests = [] + if args.start_id: + if args.end_id: + for id in range(args.start_id, args.end_id + 1): + tests.append(glob.glob('%s_*'%id)) + tests.append(glob.glob('0%s_*'%id)) + tests.append(glob.glob('00%s_*'%id)) + else: + parser.error('--start_id requires --end_id') + elif args.end_id: + parser.error('--end_id requires --start_id') + if args.ids: # test ids are given by user for id in list(itertools.chain.from_iterable(args.ids)): tests.append(glob.glob('%s_*'%id)) tests.append(glob.glob('0%s_*'%id)) tests.append(glob.glob('00%s_*'%id)) - tests = list(itertools.chain.from_iterable(tests)) - else: # find all tests + if (not args.ids and not args.start_id): # find all tests tests = glob.glob('[0-9][0-9][0-9]_*') + else: + tests = list(itertools.chain.from_iterable(tests)) os.chdir(starting_directory) # create test manager to run the tests -- cgit v0.12 From 53d89156855079fcf2f25fe516e6493e42e35f1e Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 3 Oct 2018 13:45:30 +0200 Subject: Bug 677092 - single quote in HTML section of PHP breaks doxygen Close string also when entering a new php (`""/*"|"*/"|"//" { *pCopyQuotedGString+=yytext; } -- cgit v0.12 From 887db516c1b0163139db971c5aa720804cc23f37 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 8 Oct 2018 12:01:05 +0200 Subject: Bug 751700 - Main page absent in TOC of CHM, if PROJECT_NAME is empty In case a string is empty the default should be taken and not left blank. --- src/config.h | 2 +- src/configimpl.h | 6 ++++++ src/configimpl.l | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/config.h b/src/config.h index 98f5a92..102774e 100644 --- a/src/config.h +++ b/src/config.h @@ -66,7 +66,7 @@ namespace Config * and replaces environment variables. * \param clearHeaderAndFooter set to TRUE when writing header and footer templates. */ - void postProcess(bool clearHeaderAndFooter); + void postProcess(bool clearHeaderAndFooter, bool compare = FALSE); /*! Check the validity of the parsed options and correct or warn the user where needed. */ void checkAndCorrect(); diff --git a/src/configimpl.h b/src/configimpl.h index ef8bb21..1594d47 100644 --- a/src/configimpl.h +++ b/src/configimpl.h @@ -75,6 +75,7 @@ class ConfigOption virtual void writeTemplate(FTextStream &t,bool sl,bool upd) = 0; virtual void compareDoxyfile(FTextStream &t) = 0; virtual void convertStrToVal() {} + virtual void emptyValueToDefault() {} virtual void substEnvVars() = 0; virtual void init() {} @@ -189,6 +190,7 @@ class ConfigString : public ConfigOption void compareDoxyfile(FTextStream &t); void substEnvVars(); void init() { m_value = m_defValue.copy(); } + void emptyValueToDefault() { if(m_value.isEmpty()) m_value=m_defValue; }; private: QCString m_value; @@ -491,6 +493,10 @@ class ConfigImpl */ void convertStrToVal(); + /*! Sets default value in case value is empty + */ + void emptyValueToDefault(); + /*! Replaces references to environment variable by the actual value * of the environment variable. */ diff --git a/src/configimpl.l b/src/configimpl.l index 3fb1360..3d4e05d 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -983,6 +983,15 @@ void ConfigImpl::convertStrToVal() option->convertStrToVal(); } } +void ConfigImpl::emptyValueToDefault() +{ + QListIterator it = iterator(); + ConfigOption *option; + for (;(option=it.current());++it) + { + option->emptyValueToDefault(); + } +} static void substEnvVarsInString(QCString &s) { @@ -1854,7 +1863,7 @@ void Config::writeTemplate(FTextStream &t,bool shortList,bool update) void Config::compareDoxyfile(FTextStream &t) { - postProcess(FALSE); + postProcess(FALSE, TRUE); ConfigImpl::instance()->compareDoxyfile(t); } @@ -1863,9 +1872,10 @@ bool Config::parse(const char *fileName,bool update) return ConfigImpl::instance()->parse(fileName,update); } -void Config::postProcess(bool clearHeaderAndFooter) +void Config::postProcess(bool clearHeaderAndFooter, bool compare) { ConfigImpl::instance()->substituteEnvironmentVars(); + if (!compare)ConfigImpl::instance()->emptyValueToDefault(); ConfigImpl::instance()->convertStrToVal(); // avoid bootstrapping issues when the config file already -- cgit v0.12 From 97f2d220240a1f6692627171398a06a3fa238639 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 11 Oct 2018 14:40:15 +0200 Subject: issue_6533: PHP: Namespaced typehints in deprecated methods not handled correctly Besides backslashes in the title (issue #5901) the backslashes in the argument list need to be escaped. --- src/reflist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/reflist.cpp b/src/reflist.cpp index 1da603e..e551743 100644 --- a/src/reflist.cpp +++ b/src/reflist.cpp @@ -171,7 +171,8 @@ void RefList::generatePage() if (!item->args.isEmpty()) { // escape @'s in argument list, needed for Java annotations (see issue #6208) - doc += substitute(item->args,"@","@@"); + // escape \'s in argument list (see issue #6533) + doc += substitute(substitute(item->args,"@","@@"),"\\","\\\\"); } doc += "
"; doc += item->text; -- cgit v0.12 From 55063c91fa74921d0c5c7c84d1784ce617f0d53b Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 17 Oct 2018 11:11:53 +0200 Subject: Remove old obsolete docbook generator The docbook generator has been replaced by a new implementation. The old implementation was still present, removed now (disrupts easy updates due to false positive searches in the code). --- src/docbookgen.cpp | 2147 ---------------------------------------------------- src/docbookgen.h | 2 - src/doxygen.cpp | 11 - 3 files changed, 2160 deletions(-) diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index bfec8bf..8c8ed90 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -70,52 +70,6 @@ #endif //------------------ -class DocbookSectionMapper : public QIntDict -{ - public: - DocbookSectionMapper() : QIntDict(47) - { - insert(MemberListType_pubTypes,"public-type"); - insert(MemberListType_pubMethods,"public-func"); - insert(MemberListType_pubAttribs,"public-attrib"); - insert(MemberListType_pubSlots,"public-slot"); - insert(MemberListType_signals,"signal"); - insert(MemberListType_dcopMethods,"dcop-func"); - insert(MemberListType_properties,"property"); - insert(MemberListType_events,"event"); - insert(MemberListType_pubStaticMethods,"public-static-func"); - insert(MemberListType_pubStaticAttribs,"public-static-attrib"); - insert(MemberListType_proTypes,"protected-type"); - insert(MemberListType_proMethods,"protected-func"); - insert(MemberListType_proAttribs,"protected-attrib"); - insert(MemberListType_proSlots,"protected-slot"); - insert(MemberListType_proStaticMethods,"protected-static-func"); - insert(MemberListType_proStaticAttribs,"protected-static-attrib"); - insert(MemberListType_pacTypes,"package-type"); - insert(MemberListType_pacMethods,"package-func"); - insert(MemberListType_pacAttribs,"package-attrib"); - insert(MemberListType_pacStaticMethods,"package-static-func"); - insert(MemberListType_pacStaticAttribs,"package-static-attrib"); - insert(MemberListType_priTypes,"private-type"); - insert(MemberListType_priMethods,"private-func"); - insert(MemberListType_priAttribs,"private-attrib"); - insert(MemberListType_priSlots,"private-slot"); - insert(MemberListType_priStaticMethods,"private-static-func"); - insert(MemberListType_priStaticAttribs,"private-static-attrib"); - insert(MemberListType_friends,"friend"); - insert(MemberListType_related,"related"); - insert(MemberListType_decDefineMembers,"define"); - insert(MemberListType_decProtoMembers,"prototype"); - insert(MemberListType_decTypedefMembers,"typedef"); - insert(MemberListType_decEnumMembers,"enum"); - insert(MemberListType_decFuncMembers,"func"); - insert(MemberListType_decVarMembers,"var"); - } -}; - -static DocbookSectionMapper g_docbookSectionMapper; - - inline void writeDocbookString(FTextStream &t,const char *s) { t << convertToDocBook(s); @@ -149,20 +103,6 @@ inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col) } } -static void writeDocbookHeaderMainpage(FTextStream &t, QCString &pageName) -{ - t << "" << endl;; - t << "" << endl; -} - -static void writeDocbookHeader_ID(FTextStream &t, QCString id) -{ - t << "" << endl;; - t << "
" << endl; -} - static void addIndexTerm(FTextStream &t, QCString prim, QCString sec = "") { t << ""; @@ -187,25 +127,6 @@ void writeDocbookLink(FTextStream &t,const char * /*extRef*/,const char *compoun t << ""; } -class TextGeneratorDocbookImpl : public TextGeneratorIntf -{ - public: - TextGeneratorDocbookImpl(FTextStream &t): m_t(t) {} - void writeString(const char *s,bool /*keepSpaces*/) const - { - writeDocbookString(m_t,s); - } - void writeBreak(int) const {} - void writeLink(const char *extRef,const char *file, - const char *anchor,const char *text - ) const - { - writeDocbookLink(m_t,extRef,file,anchor,text,0); - } - private: - FTextStream &m_t; -}; - DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t) : m_lineNumber(-1), m_col(0), m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE) { @@ -328,2074 +249,6 @@ void DocbookCodeGenerator::endCodeFragment() m_t << "" << endl; } -static void writeTemplateArgumentList(ArgumentList *al, - FTextStream &t, - Definition *scope, - FileDef *fileScope, - int indent) -{ - QCString indentStr; - indentStr.fill(' ',indent); - if (al) - { - t << indentStr << "" << endl; - ArgumentListIterator ali(*al); - Argument *a; - for (ali.toFirst();(a=ali.current());++ali) - { - t << indentStr << " " << endl; - if (!a->type.isEmpty()) - { - t << indentStr << " "; - linkifyText(TextGeneratorDocbookImpl(t),scope,fileScope,0,a->type); - t << "" << endl; - } - if (!a->name.isEmpty()) - { - t << indentStr << " " << a->name << "" << endl; - t << indentStr << " " << a->name << "" << endl; - } - if (!a->defval.isEmpty()) - { - t << indentStr << " "; - linkifyText(TextGeneratorDocbookImpl(t),scope,fileScope,0,a->defval); - t << "" << endl; - } - t << indentStr << " " << endl; - } - t << indentStr << "" << endl; - } -} - -static void writeTemplateList(ClassDef *cd,FTextStream &t) -{ - writeTemplateArgumentList(cd->templateArguments(),t,cd,0,4); -} - -static void writeDocbookDocBlock(FTextStream &t, - const QCString &fileName, - int lineNr, - Definition *scope, - MemberDef * md, - const QCString &text) -{ - QCString stext = text.stripWhiteSpace(); - if (stext.isEmpty()) return; - // convert the documentation string into an abstract syntax tree - DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text,FALSE,FALSE); - // create a code generator - DocbookCodeGenerator *docbookCodeGen = new DocbookCodeGenerator(t); - // create a parse tree visitor for Docbook - DocbookDocVisitor *visitor = new DocbookDocVisitor(t,*docbookCodeGen); - // visit all nodes - root->accept(visitor); - // clean up - delete visitor; - delete docbookCodeGen; - delete root; -} - -void writeDocbookCodeBlock(FTextStream &t,FileDef *fd) -{ - ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension()); - SrcLangExt langExt = getLanguageFromFileName(fd->getDefFileExtension()); - pIntf->resetCodeParserState(); - DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t); - pIntf->parseCode(*docbookGen, // codeOutIntf - 0, // scopeName - fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES)), - langExt, // lang - FALSE, // isExampleBlock - 0, // exampleName - fd, // fileDef - -1, // startLine - -1, // endLine - FALSE, // inlineFragement - 0, // memberDef - TRUE // showLineNumbers - ); - docbookGen->finish(); - delete docbookGen; -} - -static QCString classOutputFileBase(ClassDef *cd) -{ - //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES); - //if (inlineGroupedClasses && cd->partOfGroups()!=0) - return cd->getOutputFileBase(); - //else - // return cd->getOutputFileBase(); -} - -static QCString memberOutputFileBase(MemberDef *md) -{ - //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES); - //if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0) - // return md->getClassDef()->getDocbookOutputFileBase(); - //else - // return md->getOutputFileBase(); - return md->getOutputFileBase(); -} - -static void generateTOC(FTextStream &t, PageDef *pd) -{ - if (pd->localToc().isDocbookEnabled()) - { - t << " " << endl; - t << " " << theTranslator->trRTFTableOfContents() << "" << endl; - SectionDict *sectionDict = pd->getSectionDict(); - SDict::Iterator li(*sectionDict); - SectionInfo *si; - int level=1,l; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; - int maxLevel = pd->localToc().docbookLevel(); - for (li.toFirst();(si=li.current());++li) - { - if (si->type==SectionInfo::Section || - si->type==SectionInfo::Subsection || - si->type==SectionInfo::Subsubsection || - si->type==SectionInfo::Paragraph) - { - //printf(" level=%d title=%s\n",level,si->title.data()); - int nextLevel = (int)si->type; - if (nextLevel>level) - { - for (l=level;l" << endl; - } - } - else if (nextLevelnextLevel;l--) - { - inLi[l]=FALSE; - if (l <= maxLevel) t << " " << endl; - } - } - if (nextLevel <= maxLevel) - { - QCString titleDoc = convertToDocBook(si->title); - t << " " << (si->title.isEmpty()?si->label:titleDoc) << "" << endl; - } - inLi[nextLevel]=TRUE; - level = nextLevel; - } - } - t << " " << endl; - } -} - -static void generateSourceRefList(FTextStream &t,const char *scopeName, const QCString &text,MemberSDict *members, Definition *def) -{ - static bool sourceBrowser = Config_getBool(SOURCE_BROWSER); - static bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE); - - if (members) - { - members->sort(); - - t << "" << convertToDocBook(text) << ""; - - QCString ldefLine=theTranslator->trWriteList(members->count()); - - QRegExp marker("@[0-9]+"); - int index=0,newIndex,matchLen; - // now replace all markers in inheritLine with links to the classes - while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1) - { - bool ok; - t << convertToDocBook(ldefLine.mid(index,newIndex-index)); - uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok); - MemberDef *md=members->at(entryIndex); - if (ok && md) - { - QCString scope=md->getScopeString(); - QCString name=md->name(); - //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName); - if (!scope.isEmpty() && scope!=scopeName) - { - name.prepend(scope+getLanguageSpecificSeparator(def->getLanguage())); - } - if (!md->isObjCMethod() && - (md->isFunction() || md->isSlot() || - md->isPrototype() || md->isSignal() - ) - ) - { - name+="()"; - } - //Definition *d = md->getOutputFileBase(); - //if (d==Doxygen::globalScope) d=md->getBodyDef(); - if (sourceBrowser && - !(md->isLinkable() && !refLinkSource) && - md->getStartBodyLine()!=-1 && - md->getBodyDef() - ) - { - //printf("md->getBodyDef()=%p global=%p\n",md->getBodyDef(),Doxygen::globalScope); - - const int maxLineNrStr = 10; - char anchorStr[maxLineNrStr]; - qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine()); - //printf("Write object link to %s\n",md->getBodyDef()->getSourceFileBase().data()); - t << convertToDocBook(name); - // or - // ol.writeObjectLink(0,md->getBodyDef()->getSourceFileBase(),anchorStr,name); - } - else if (md->isLinkable() /*&& d && d->isLinkable()*/) - { - t << convertToDocBook(name); - // or - // ol.writeObjectLink(md->getReference(), md->getOutputFileBase(), md->anchor(),name); - } - else - { - t << convertToDocBook(name); - } - } - index=newIndex+matchLen; - } - t << ldefLine.right(ldefLine.length()-index); - t<< "."; - t << ""; - } -} -static void generateInlineCode(FTextStream &t,const char *scopeName, Definition *def) -{ - static bool inlineSources = Config_getBool(INLINE_SOURCES); - //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(), - // m_startBodyLine,m_endBodyLine,m_bodyDef); - if (inlineSources && def->hasSources()) - { - QCString codeFragment; - int actualStart=def->getStartBodyLine(),actualEnd=def->getEndBodyLine(); - if (readCodeFragment(def->getBodyDef()->absFilePath(), - actualStart,actualEnd,codeFragment) - ) - { - //printf("Adding code fragment '%s' ext='%s'\n", - // codeFragment.data(),m_impl->defFileExt.data()); - ParserInterface *pIntf = Doxygen::parserManager->getParser(def->getDefFileExtension()); - pIntf->resetCodeParserState(); - //printf("Read:\n`%s'\n\n",codeFragment.data()); - MemberDef *thisMd = 0; - if (def->definitionType()==Definition::TypeMember) thisMd = (MemberDef *)def; - - DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t); - docbookGen->startCodeFragment(); - pIntf->parseCode(*docbookGen, // codeOutIntf - scopeName, // scope - codeFragment, // input - def->getLanguage(), // lang - FALSE, // isExample - 0, // exampleName - def->getBodyDef(), // fileDef - actualStart, // startLine - actualEnd, // endLine - TRUE, // inlineFragment - thisMd, // memberDef - TRUE // show line numbers - ); - docbookGen->finish(); - docbookGen->endCodeFragment(); - delete docbookGen; - } - } -} - -static void definedAtLine(int line, QCString fileName, FTextStream &t) -{ - QCString refText = theTranslator->trDefinedAtLineInSourceFile(); - int lineMarkerPos = refText.find("@0"); - int fileMarkerPos = refText.find("@1"); - if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this. - { - if (lineMarkerPosmemberType()==MemberType_EnumValue) return; - if (md->isHidden()) return; - //if (md->name().at(0)=='@') return; // anonymous member - - // group members are only visible in their group - //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return; - QCString memType; - switch (md->memberType()) - { - case MemberType_Define: memType="define"; break; - case MemberType_Function: memType="function"; break; - case MemberType_Variable: memType="variable"; break; - case MemberType_Typedef: memType="typedef"; break; - case MemberType_Enumeration: memType="enum"; break; - case MemberType_EnumValue: ASSERT(0); break; - case MemberType_Signal: memType="signal"; break; - case MemberType_Slot: memType="slot"; break; - case MemberType_Friend: memType="friend"; break; - case MemberType_DCOP: memType="dcop"; break; - case MemberType_Property: memType="property"; break; - case MemberType_Event: memType="event"; break; - case MemberType_Interface: memType="interface"; break; - case MemberType_Service: memType="service"; break; - } - QCString scopeName; - if (md->getClassDef()) - { - scopeName=md->getClassDef()->name(); - } - else if (md->getNamespaceDef()) - { - scopeName=md->getNamespaceDef()->name(); - } - if (detailed==0) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - //enum - bool closePara=TRUE; - if (md->memberType()==MemberType_Enumeration) - { - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; - MemberList *enumFields = md->enumFieldList(); - t << " " << memType << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (enumFields!=0) - { - MemberListIterator emli(*enumFields); - MemberDef *emd; - t << " {" << endl; - int cnt=0; - for (emli.toFirst();(emd=emli.current());++emli) - { - if (cnt!=0) - { - t << "," << endl; - } - t << "anchor() << "\">"; - writeDocbookString(t,emd->name()); - t << ""; - if (!emd->initializer().isEmpty()) - { - writeDocbookString(t,emd->initializer()); - } - cnt++; - } - t << endl << "}"; - } - t << "" << endl; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else if (md->memberType()==MemberType_Define) - { - t << " " << "#" << memType << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (!md->initializer().isEmpty() && md->initializer().length()<2000) - { - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->initializer()); - } - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else if (md->memberType()==MemberType_Variable) - { - if (md->getClassDef()) - { - t << " " << convertToDocBook(md->declaration()); - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << ""; - } - } - else - { - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - } - else if (md->memberType()==MemberType_Typedef) - { - t << " " << memType; - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " "; - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else if (md->memberType()==MemberType_Function) - { - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - t << " (" << endl; - ArgumentList *declAl = md->declArgumentList(); - if (declAl && declAl->count()>0) - { - ArgumentListIterator declAli(*declAl); - Argument *a; - int cnt=0; - for (declAli.toFirst();(a=declAli.current());++declAli) - { - if (cnt!=0) - { - t << ", "; - } - if (!a->type.isEmpty()) - { - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,a->type); - } - t << " "; - if (!a->name.isEmpty()) - { - writeDocbookString(t,a->name); - } - cnt++; - } - } - t << ")"; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else - { - closePara = FALSE; - } - if (closePara) t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - else - { - if (md->memberType()==MemberType_Enumeration) - { - MemberList *enumFields = md->enumFieldList(); - t << "
getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << memType << " " << convertToDocBook(md->name()) << " " << "" << endl; - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - if (enumFields!=0) - { - MemberListIterator emli(*enumFields); - MemberDef *emd; - t << " " << endl; - t << " " << theTranslator->trEnumerationValues() << ":" << endl; - t << " " << endl; - for (emli.toFirst();(emd=emli.current());++emli) - { - t << " anchor() << "\">" << endl; - t << " "; - writeDocbookString(t,emd->name()); - t << "" << endl; - t << " " << endl; - if(Config_getBool(REPEAT_BRIEF)) - { - t << " "; - writeDocbookString(t,emd->briefDescription()); - t << "" << endl; - } - t << " " << endl; - t << " " << endl; - } - t << " " << endl; - t << " " << endl; - t << " "; - t << " "; - definedAtLine(md->getDefLine(),stripPath(md->getDefFileName()),t); - t << "" << endl; - - t << " " << endl; - t << "{" << endl; - for (emli.toFirst();(emd=emli.current());++emli) - { - writeDocbookString(t,emd->name()); - if (!emd->initializer().isEmpty()) - { - writeDocbookString(t,emd->initializer()); - } - t << ", " << endl; - } - t << "}" << convertToDocBook(md->name()) << ";" << endl; - t << " " << endl; - t << " " << endl; - } - t << "
" << endl; - } - else if (md->memberType()==MemberType_Typedef) - { - t << "
getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - if(Config_getBool(REPEAT_BRIEF)) - { - t << " "; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
" << endl; - } - else if (md->memberType()==MemberType_Function) - { - t << "
getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << " " << convertToDocBook(md->argsString()) << ""; - addIndexTerm(t,md->name(),def->name()); - addIndexTerm(t,def->name(),md->name()); - if(Config_getBool(REPEAT_BRIEF)) - { - if (!md->briefDescription().isEmpty()) - { - t << " "; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - - if (Config_getBool(REFERENCED_BY_RELATION)) - { - generateSourceRefList(t,md->name(),theTranslator->trReferencedBy(),md->getReferencedByMembers(),md); - } - if (Config_getBool(REFERENCES_RELATION)) - { - generateSourceRefList(t,md->name(),theTranslator->trReferences(),md->getReferencesMembers(),md); - } - generateInlineCode(t,md->name(),md); - t << "
" << endl; - } - else if (md->memberType()==MemberType_Define) - { - if (md->documentation()) - { - t << "
getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
" << endl; - } - } - else if (md->memberType()==MemberType_Variable) - { - if (md->getClassDef()) - { - if (md->documentation()) - { - t << "
getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - addIndexTerm(t,md->name(),def->name()); - addIndexTerm(t,def->name(),md->name()); - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
" << endl; - } - } - else - { - t << "
getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - addIndexTerm(t,md->name(),def->name()); - addIndexTerm(t,def->name(),md->name()); - if(Config_getBool(REPEAT_BRIEF)) - { - t << " "; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
" << endl; - } - } - } -} - -static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,const char *, - bool detailed=0, const char *header=0,const char *documentation=0) -{ - if (ml==0) return; - MemberListIterator mli(*ml); - MemberDef *md; - int count=0; - int doc_count=0; - QCString title, desctitle, subtitle; - - for (mli.toFirst();(md=mli.current());++mli) - { - // namespace members are also inserted in the file scope, but - // to prevent this duplication in the Docbook output, we filter those here. - if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) - { - count++; - } - } - - if (count==0) return; // empty list - - subtitle = ""; - switch (ml->listType()) - { - case MemberListType_pubMethods: d->getLanguage()==SrcLangExt_ObjC ? title = theTranslator->trInstanceMethods() : title = theTranslator->trPublicMembers(); - switch (d->getLanguage()) - { - case SrcLangExt_ObjC: desctitle = theTranslator->trMethodDocumentation(); break; - case SrcLangExt_Fortran: desctitle = theTranslator->trMemberFunctionDocumentationFortran(); break; - default: desctitle = theTranslator->trMemberFunctionDocumentation(); break; - }; - break; - case MemberListType_priMethods: title=theTranslator->trPrivateMembers(); desctitle=""; break; - - case MemberListType_decTypedefMembers: title=theTranslator->trTypedefs(); desctitle=theTranslator->trTypedefDocumentation(); break; - case MemberListType_decEnumMembers: title=theTranslator->trEnumerations(); desctitle=theTranslator->trEnumerationTypeDocumentation(); break; - case MemberListType_decFuncMembers: title=theTranslator->trFunctions(); desctitle=theTranslator->trFunctionDocumentation(); break; - case MemberListType_decVarMembers: title=theTranslator->trVariables(); desctitle=theTranslator->trVariableDocumentation(); break; - case MemberListType_pubAttribs: title=theTranslator->trPublicAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; - case MemberListType_priAttribs: title=theTranslator->trPrivateAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; - case MemberListType_proAttribs: title=theTranslator->trProtectedAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; - case MemberListType_decDefineMembers: title=theTranslator->trDefines(); desctitle=theTranslator->trDefineDocumentation(); break; - case MemberListType_related: title=theTranslator->trRelatedFunctions(); desctitle=theTranslator->trRelatedFunctionDocumentation(); - subtitle=theTranslator->trRelatedSubscript(); break; - default: title=""; desctitle=""; - } - - if (detailed) - { - for (mli.toFirst();(md=mli.current());++mli) - { - if (md->documentation().isEmpty() && !Config_getBool(REPEAT_BRIEF)) - { - continue; - } - doc_count = 1; - break; - } - - if(doc_count == 0) return; - - if (!QCString(header).isEmpty()) - { - t << "
" << endl; - t << " " << convertToDocBook(header) << "" << endl; - } - else if (desctitle) - { - t << "
" << endl; - t << " " << desctitle << "" << endl; - } - } - else - { - t << "
" << endl; - if (!QCString(header).isEmpty()) - { - t << " " << convertToDocBook(header) << "" << endl; - } - else - { - t << " " << title << "" << endl; - } - if (!subtitle.isEmpty()) - t << " " << subtitle << "" << endl; - } - - if (documentation) - { - t << " "; - writeDocbookDocBlock(t,d->docFile(),d->docLine(),d,0,documentation); - t << "" << endl; - } - for (mli.toFirst();(md=mli.current());++mli) - { - // namespace members are also inserted in the file scope, but - // to prevent this duplication in the Docbook output, we filter those here. - if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) - { - if (detailed && md->documentation().isEmpty() && !Config_getBool(REPEAT_BRIEF)) - { - continue; - } - - generateDocbookForMember(md,t,d,detailed); - } - } - if (detailed) - { - if (!QCString(header).isEmpty()) - { - t << "
" << endl; - } - else if (desctitle) - { - t << "
" << endl; - } - } - else - { - t << "
" << endl; - } -} - -static void writeInnerClasses(const ClassSDict *cl,FTextStream &t) -{ - if (cl) - { - ClassSDict::Iterator cli(*cl); - ClassDef *cd; - QCString title = theTranslator->trClasses(); - - if (cli.toFirst()) - { - t << "
" << endl; - t << " " << title << " " << endl; - } - for (cli.toFirst();(cd=cli.current());++cli) - { - if (!cd->isHidden() && cd->name().find('@')==-1) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "struct " << convertToDocBook(cd->name()) << ""; - t << "" << endl; - if (cd->briefDescription()) - { - t << ""; - writeDocbookString(t,cd->briefDescription()); - t << "" << endl; - } - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - } - if (cli.toFirst()) - { - t << "
" << endl; - } - } -} - -static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) -{ - if (nl) - { - NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; - QCString title = theTranslator->trNamespaces(); - - if (nli.toFirst()) - { - t << " " << endl; - t << " " << title << " " << endl; - } - for (nli.toFirst();(nd=nli.current());++nli) - { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "struct getOutputFileBase() << "\">" << convertToDocBook(nd->name()) << ""; - t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - } - if (nli.toFirst()) - { - t << " " << endl; - } - } -} - -static void writeInnerFiles(const FileList *fl,FTextStream &t) -{ - if (fl) - { - QListIterator fli(*fl); - FileDef *fd; - QCString title = theTranslator->trFile(TRUE,TRUE); - - if (fli.toFirst()) - { - t << " " << endl; - t << " " << title << " " << endl; - } - for (fli.toFirst();(fd=fli.current());++fli) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "file getOutputFileBase() << "\">" << convertToDocBook(fd->name()) << ""; - t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - if (fli.toFirst()) - { - t << " " << endl; - } - } -} - -static void writeInnerPages(const PageSDict *pl,FTextStream &t) -{ - if (pl) - { - PageSDict::Iterator pli(*pl); - PageDef *pd; - - for (pli.toFirst();(pd=pli.current());++pli) - { - t << "getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; - } - } -} - -static void writeInnerGroups(const GroupList *gl,FTextStream &t) -{ - if (gl) - { - GroupListIterator gli(*gl); - GroupDef *sgd; - - //Docbook header tags for inner groups - if (gli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trModules() << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - - for (gli.toFirst();(sgd=gli.current());++gli) - { - t << " getOutputFileBase() << "\">" << convertToDocBook(sgd->groupTitle()) << "" << endl; - } - - //Docbook footer tags for inner groups - if (gli.toFirst()) - { - t << " " << endl; - t << " " << endl; - } - - } -} - -static void writeInnerDirs(const DirList *dl,FTextStream &t) -{ - if (dl) - { - QListIterator subdirs(*dl); - DirDef *subdir; - QCString title = theTranslator->trDirectories(); - if (subdirs.toFirst()) - { - t << " " << endl; - t << " " << title << " " << endl; - } - for (subdirs.toFirst();(subdir=subdirs.current());++subdirs) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "dir getOutputFileBase() << "\">" << convertToDocBook(subdir->displayName()) << ""; - t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - if (subdirs.toFirst()) - { - t << " " << endl; - } - } -} - -static void writeInnerGroupFiles(const GroupList *gl,FTextStream &t) -{ - if (gl) - { - GroupListIterator gli(*gl); - GroupDef *sgd; - - for (gli.toFirst();(sgd=gli.current());++gli) - { - t << "getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; - } - } -} - -static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) -{ - // + brief description - // + detailed description - // + template argument list(s) - // - include file - // + member groups - // + inheritance diagram - // + list of direct super classes - // + list of direct sub classes - // + list of inner classes - // + collaboration diagram - // + list of all members - // + user defined member sections - // + standard member sections - // + detailed member documentation - // - examples using the class - - if (cd->isReference()) return; // skip external references. - if (cd->isHidden()) return; // skip hidden classes. - if (cd->name().find('@')!=-1) return; // skip anonymous compounds. - if (cd->templateMaster()!=0) return; // skip generated template instances. - - msg("Generating Docbook output for class %s\n",cd->name().data()); - - QCString fileDocbook=cd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml"; - QCString relPath = relativePathToRoot(fileName); - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - writeDocbookHeader_ID(t, classOutputFileBase(cd)); - t << ""; - writeDocbookString(t,cd->name()); - addIndexTerm(t,cd->name()); - t << " " << cd->compoundTypeString() << " Reference"; - t << "" << endl; - if (cd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription()); - t << " " << endl; - } - - IncludeInfo *ii=cd->includeInfo(); - if (ii) - { - QCString nm = ii->includeName; - if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName(); - if (!nm.isEmpty()) - { - t << "" << endl; - t << " #include "; - if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references - { - t << "fileDef->getOutputFileBase() << "\">"; - } - if (ii->local) - { - t << """; - } - else - { - t << "<"; - } - t << convertToDocBook(nm); - if (ii->local) - { - t << """; - } - else - { - t << ">"; - } - if (ii->fileDef && !ii->fileDef->isReference()) - { - t << ""; - } - t << "" << endl; - t << "" << endl; - } - } - - if (Config_getBool(HAVE_DOT) && (Config_getBool(CLASS_DIAGRAMS) || Config_getBool(CLASS_GRAPH))) - { - t << "Inheritance diagram for " << convertToDocBook(cd->name()) << "" << endl; - DotClassGraph inheritanceGraph(cd,DotNode::Inheritance); - inheritanceGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE); - } - - if (Config_getBool(HAVE_DOT) && Config_getBool(COLLABORATION_GRAPH)) - { - t << "Collaboration diagram for " << convertToDocBook(cd->name()) << "" << endl; - DotClassGraph collaborationGraph(cd,DotNode::Collaboration); - collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE); - } - - writeInnerClasses(cd->getClassSDict(),t); - - writeTemplateList(cd,t); - if (cd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(cd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(cd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_detailedLists)==0) - { - generateDocbookSection(cd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - if ((Config_getBool(REPEAT_BRIEF) && cd->briefDescription()) || cd->documentation()) - { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - - if(Config_getBool(REPEAT_BRIEF)) - { - if (cd->briefDescription()) - { - t << " " << endl; - // A title as 'Brief Description' may not be necessary. - //t << " " << theTranslator->trBriefDescription() << "" << endl; - writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription()); - t << " " << endl; - } - } - - if (cd->documentation()) - { - writeDocbookDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation()); - } - t << " " << endl; - } - - if (cd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(cd,t,mg->members(),"user-defined",1,mg->header(), - mg->documentation()); - } - } - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_detailedLists)==0) - { - generateDocbookSection(cd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - - /*// TODO: Handling of Inheritance and Colloboration graph for Docbook to be implemented - DotClassGraph inheritanceGraph(cd,DotNode::Inheritance); - if (!inheritanceGraph.isTrivial()) - { - t << " " << endl; - inheritanceGraph.writeDocbook(t); - t << " " << endl; - } - DotClassGraph collaborationGraph(cd,DotNode::Collaboration); - if (!collaborationGraph.isTrivial()) - { - t << " " << endl; - collaborationGraph.writeDocbook(t); - t << " " << endl; - } - t << " getDefFileName() << "\" line=\"" - << cd->getDefLine() << "\""; - if (cd->getStartBodyLine()!=-1) - { - FileDef *bodyDef = cd->getBodyDef(); - if (bodyDef) - { - t << " bodyfile=\"" << bodyDef->absFilePath() << "\""; - } - t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\"" - << cd->getEndBodyLine() << "\""; - } - t << "/>" << endl; - writeListOfAllMembers(cd,t); - */ - - t << " " << cd->generatedFromFiles() << "" << endl; - t << " " << stripPath(cd->getDefFileName()) << "" << endl; - t << "
" << endl; - -} - -static void generateDocbookForNamespace(NamespaceDef *nd,FTextStream &ti) -{ - // + contained class definitions - // + contained namespace definitions - // + member groups - // + normal members - // + brief desc - // + detailed desc - // + location - // - files containing (parts of) the namespace definition - - if (nd->isReference() || nd->isHidden()) return; // skip external references - - QCString fileDocbook=nd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml"; - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - writeDocbookHeader_ID(t, nd->getOutputFileBase()); - t << ""; - addIndexTerm(t,nd->displayName()); - writeDocbookString(t,nd->title()); - t << "" << endl; - - if (nd->briefDescription()) - { - t << " " << endl; - //t << " " << theTranslator->trBriefDescription() << "" << endl; - t << " " << endl; - } - writeInnerClasses(nd->getClassSDict(),t); - writeInnerNamespaces(nd->getNamespaceSDict(),t); - - if (nd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(nd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(nd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(nd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - if ((Config_getBool(REPEAT_BRIEF) && nd->briefDescription()) || nd->documentation()) - { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - - if(Config_getBool(REPEAT_BRIEF)) - { - if (nd->briefDescription()) - { - t << " " << endl; - //t << " " << theTranslator->trBriefDescription() << "" << endl; - writeDocbookDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription()); - t << " " << endl; - } - } - - if (nd->documentation()) - { - writeDocbookDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation()); - } - t << " " << endl; - } - - if (nd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(nd,t,mg->members(),"user-defined",1,mg->header(), - mg->documentation()); - } - } - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_detailedLists)==0) - { - if (ml->listType() != MemberListType_allMembersList && - ml->listType() != MemberListType_docFuncMembers) - generateDocbookSection(nd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - // we actually need here "namespace" - // t << " " << theTranslator->trGeneratedFromFiles(ClassDef::Struct, FALSE) << "" << endl; - // t << " " << stripPath(nd->getDefFileName()) << "" << endl; - t << "" << endl; -} - -static void generateDocbookForFile(FileDef *fd,FTextStream &ti) -{ - // + includes files - // + includedby files - // + include graph - // + included by graph - // + contained class definitions - // + contained namespace definitions - // + member groups - // + normal members - // + brief desc - // + detailed desc - // + source code - // + location - // - number of lines - - if (fd->isReference()) return; // skip external references - - QCString fileDocbook=fd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml"; - QCString relPath = relativePathToRoot(fileName); - - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - writeDocbookHeader_ID(t, fd->getOutputFileBase()); - - t << " "; - writeDocbookString(t,fd->name()); - t << " File Reference"; - t << "" << endl; - - if (fd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); - t << " " << endl; - } - - IncludeInfo *inc; - - if (fd->includeFileList()) - { - QListIterator ili1(*fd->includeFileList()); - for (ili1.toFirst();(inc=ili1.current());++ili1) - { - t << " #include "; - if (inc->local) - { - t << """; - } - else - { - t << "<"; - } - t << convertToDocBook(inc->includeName); - if (inc->local) - { - t << """; - } - else - { - t << ">"; - } - t << "" << endl; - } - } - if (Config_getBool(HAVE_DOT)) - { - if (Config_getBool(INCLUDE_GRAPH)) - { - t << "Include dependency diagram for " << convertToDocBook(fd->name()) << "" << endl; - DotInclDepGraph idepGraph(fd, FALSE); - idepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - if (Config_getBool(INCLUDED_BY_GRAPH)) - { - t << "Included by dependency diagram for " << convertToDocBook(fd->name()) << "" << endl; - DotInclDepGraph ibdepGraph(fd, TRUE); - ibdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - } - - if (fd->getClassSDict()) - { - writeInnerClasses(fd->getClassSDict(),t); - } - if (fd->getNamespaceSDict()) - { - writeInnerNamespaces(fd->getNamespaceSDict(),t); - } - - if (fd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(fd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(fd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(fd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - if(Config_getBool(REPEAT_BRIEF)) - { - if (fd->briefDescription()) - { - writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); - } - } - writeDocbookDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation()); - if (Config_getBool(FULL_PATH_NAMES)) - { - t << " Definition in file " << fd->getDefFileName() << "" << endl; - } - else - { - t << " Definition in file " << stripPath(fd->getDefFileName()) << "" << endl; - } - t << " " << endl; - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(fd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - - if (Config_getBool(DOCBOOK_PROGRAMLISTING)) - { - t << " " << endl;; - writeDocbookCodeBlock(t,fd); - t << " " << endl; - } - - t << "" << endl; -} - -static void generateDocbookForGroup(GroupDef *gd,FTextStream &ti) -{ - // + members - // + member groups - // + files - // + classes - // + namespaces - // - packages - // + pages - // + child groups - // - examples - // + brief description - // + detailed description - - if (gd->isReference()) return; // skip external references - - if (!gd->isASubGroup()) - { - QCString fileDocbook=gd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - } - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml"; - QCString relPath = relativePathToRoot(fileName); - - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - writeDocbookHeader_ID(t, gd->getOutputFileBase()); - - t << " " << convertToDocBook(gd->groupTitle()) << "" << endl; - if (gd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription()); - t << " " << endl; - } - - if (Config_getBool(GROUP_GRAPHS) && Config_getBool(HAVE_DOT)) - { - t << "Collaboration diagram for " << convertToDocBook(gd->groupTitle()) << "" << endl; - DotGroupCollaboration collaborationGraph(gd); - collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - - writeInnerFiles(gd->getFiles(),t); - writeInnerClasses(gd->getClasses(),t); - writeInnerNamespaces(gd->getNamespaces(),t); - writeInnerPages(gd->getPages(),t); - writeInnerGroups(gd->getSubGroups(),t); - - if (gd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(gd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(gd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(gd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - if(Config_getBool(REPEAT_BRIEF)) - { - if (gd->briefDescription()) - { - //t << "
" << endl; - //t << " " << theTranslator->trBriefDescription() << "" << endl; - writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription()); - //t << "
" << endl; - } - } - - if (gd->documentation()) - { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - writeDocbookDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation()); - t << " " << endl; - } - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(gd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - - writeInnerGroupFiles(gd->getSubGroups(),t); - - t << "" << endl; - -} - -static void generateDocbookForDir(DirDef *dd,FTextStream &ti) -{ - if (dd->isReference()) return; // skip external references - - QCString fileDocbook=dd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml"; - QFile f(fileName); - QCString relPath = relativePathToRoot(fileName); - - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - writeDocbookHeader_ID(t, dd->getOutputFileBase()); - - t << " "; - t << theTranslator->trDirReference(dd->displayName()); - t << "" << endl; - if (dd->briefDescription()) - { - writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription()); - } - if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT)) - { - t << "Directory dependency diagram for " << convertToDocBook(dd->displayName()) << "" << endl; - DotDirDeps dirdepGraph(dd); - dirdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - - writeInnerDirs(&dd->subDirs(),t); - writeInnerFiles(dd->getFiles(),t); - - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - if (dd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription()); - t << " " << endl; - } - writeDocbookDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation()); - t << " Directory location is " << dd->name() << "" << endl; - t << " " << endl; - - t << "" << endl; -} - -static void generateDocbookForPage(PageDef *pd,FTextStream &ti,bool isExample) -{ - // + name - // + title - // + documentation - - if (pd->isReference()) return; - - QCString pageName = pd->getOutputFileBase(); - if (pd->getGroupDef()) - { - pageName+=(QCString)"_"+pd->name(); - } - if (pageName=="index") - { - pageName="mainpage"; // to prevent overwriting the generated index page. - } - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+pageName+".xml"; - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - if(isExample) - { - QCString fileDocbook=pageName+".xml"; - ti << " " << endl; - } - - if (!pd->hasParentPage() && !isExample) - { - QCString fileDocbook=pageName+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - writeDocbookHeaderMainpage(t,pageName); - } - else - { - QCString pid; - if(isExample) - { - pid = pageName; - } - else - { - pid = pageName+"_1"+pageName; - } - writeDocbookHeader_ID(t, pid); - } - - SectionInfo *si = Doxygen::sectionDict->find(pd->name()); - if (si) - { - if ( pageName == "mainpage") - t << " " << convertToDocBook(theTranslator->trMainPage()) << "" << endl; - else - t << " " << convertToDocBook(si->title) << "" << endl; - } - else - { - t << " " << convertToDocBook(pd->name()) << "" << endl; - } - - generateTOC(t, pd); - if (isExample) - { - writeDocbookDocBlock(t,pd->docFile(),pd->docLine(),pd,0, - pd->documentation()+"\n\\include "+pd->name()); - } - else - { - writeDocbookDocBlock(t,pd->docFile(),pd->docLine(),pd,0, - pd->documentation()); - } - writeInnerPages(pd->getSubPages(),t); - - if (!pd->hasParentPage() && !isExample) - { - t << endl << "
" << endl; - } - else - { - t << endl << "" << endl; - } -} -void generateDocbook_v1() -{ - - // + classes - // + namespaces - // + files - // + groups - // + related pages - // - examples - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - if (outputDirectory.isEmpty()) - { - outputDirectory=QDir::currentDirPath().utf8(); - } - else - { - QDir dir(outputDirectory); - if (!dir.exists()) - { - dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDirectory)) - { - err("tag DOCBOOK_OUTPUT: Output directory `%s' does not " - "exist and cannot be created\n",outputDirectory.data()); - exit(1); - } - else - { - msg("Notice: Output directory `%s' does not exist. " - "I have created it for you.\n", outputDirectory.data()); - } - dir.cd(outputDirectory); - } - outputDirectory=dir.absPath().utf8(); - } - - QDir dir(outputDirectory); - if (!dir.exists()) - { - dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDirectory)) - { - err("Cannot create directory %s\n",outputDirectory.data()); - return; - } - } - QDir docbookDir(outputDirectory); - createSubDirs(docbookDir); - - QCString fileName=outputDirectory+"/index.xml"; - QCString dbk_projectName = Config_getString(PROJECT_NAME); - QFile f(fileName); - - f.setName(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - // write index header for Docbook which calls the structure file - t << "" << endl;; - t << "" << endl; - t << " " << endl; - t << " " << convertToDocBook(dbk_projectName) << "" << endl; - t << " " << endl; - - // NAMESPACE DOCUMENTATION - NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); - NamespaceDef *nd; - - //Namespace Documentation index header - if (nli.toFirst()) - { - t << " " << endl; - t << " Namespace Documentation" << endl; - } - - for (nli.toFirst();(nd=nli.current());++nli) - { - msg("Generating Docbook output for namespace %s\n",nd->name().data()); - generateDocbookForNamespace(nd,t); - } - - //Namespace Documentation index footer - if (nli.toFirst()) - { - t << " " << endl; - } - - /** MAINPAGE DOCUMENTATION **/ - - if (Doxygen::mainPage) - { - msg("Generating Docbook output for the main page\n"); - generateDocbookForPage(Doxygen::mainPage,t,FALSE); - } - - // PAGE DOCUMENTATION - { - PageSDict::Iterator pdi(*Doxygen::pageSDict); - PageDef *pd=0; - - for (pdi.toFirst();(pd=pdi.current());++pdi) - { - msg("Generating Docbook output for page %s\n",pd->name().data()); - generateDocbookForPage(pd,t,FALSE); - } - } - - /** MODULE GROUP DOCUMENTATION **/ - - GroupSDict::Iterator gli(*Doxygen::groupSDict); - GroupDef *gd; - - //Module group Documentation index header - if (gli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trModuleDocumentation() << "" << endl; - } - - for (;(gd=gli.current());++gli) - { - msg("Generating Docbook output for group %s\n",gd->name().data()); - generateDocbookForGroup(gd,t); - } - - //Module group Documentation index footer - if (gli.toFirst()) - { - t << " " << endl; - } - - //CLASS DOCUMENTATION - - { - ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd; - - //Class Documentation index header - if (cli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trClassDocumentation() << "" << endl; - } - - for (cli.toFirst();(cd=cli.current());++cli) - { - generateDocbookForClass(cd,t); - } - - //Class Documentation index footer - if (cli.toFirst()) - { - t << " " << endl; - } - } - - // FILE DOCUMENTATION - - static bool showFiles = Config_getBool(SHOW_FILES); - if (showFiles) - { - FileNameListIterator fnli(*Doxygen::inputNameList); - FileName *fn; - - //File Documentation index header - if (fnli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trFileDocumentation() << "" << endl; - } - - for (;(fn=fnli.current());++fnli) - { - FileNameIterator fni(*fn); - FileDef *fd; - for (;(fd=fni.current());++fni) - { - msg("Generating Docbook output for file %s\n",fd->name().data()); - generateDocbookForFile(fd,t); - } - } - - //File Documentation index footer - if (fnli.toFirst()) - { - t << " " << endl; - } - } - - // DIRECTORY DOCUMENTATION - if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT)) - { - DirDef *dir; - DirSDict::Iterator sdi(*Doxygen::directories); - - //Directory Documentation index header - if (sdi.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trDirDocumentation() << "" << endl; - } - - for (sdi.toFirst();(dir=sdi.current());++sdi) - { - msg("Generate Docbook output for dir %s\n",dir->name().data()); - generateDocbookForDir(dir,t); - } - - //Module group Documentation index footer - if (sdi.toFirst()) - { - t << " " << endl; - } - } - - // EXAMPLE PAGE DOCUMENTATION - - { - PageSDict::Iterator pdi(*Doxygen::exampleSDict); - PageDef *pd=0; - - //Example Page Documentation index header - if (pdi.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trExampleDocumentation() << "" << endl; - } - - for (pdi.toFirst();(pd=pdi.current());++pdi) - { - msg("Generating Docbook output for example %s\n",pd->name().data()); - generateDocbookForPage(pd,t,TRUE); - } - - //Example Page Documentation index footer - if (pdi.toFirst()) - { - t << " " << endl; - } - } - - t << "" << endl; - t << "" << endl; - -} - DocbookGenerator::DocbookGenerator() : OutputGenerator() { DB_GEN_C diff --git a/src/docbookgen.h b/src/docbookgen.h index 104fbc5..08255a1 100644 --- a/src/docbookgen.h +++ b/src/docbookgen.h @@ -17,8 +17,6 @@ #include "outputgen.h" -void generateDocbook_v1(); - class DocbookCodeGenerator : public CodeOutputInterface { public: diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 13c60fb..7658555 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11532,13 +11532,11 @@ void generateOutput() g_outputList->add(new LatexGenerator); LatexGenerator::init(); } -#if 1 if (generateDocbook) { g_outputList->add(new DocbookGenerator); DocbookGenerator::init(); } -#endif if (generateMan) { g_outputList->add(new ManGenerator); @@ -11717,15 +11715,6 @@ void generateOutput() g_s.end(); } -#if 0 - if (generateDocbook) - { - g_s.begin("Generating Docbook output...\n"); - generateDocbook_v1(); - g_s.end(); - } -#endif - if (Config_getBool(GENERATE_AUTOGEN_DEF)) { g_s.begin("Generating AutoGen DEF output...\n"); -- cgit v0.12 From 8e6a8c7c396748051a8cb3bbe5dbe0def92e82cc Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 17 Oct 2018 12:59:08 +0200 Subject: Remove obsolete definitions from scanner Remove some not used definitions from scanner.l (give false positives when searching for some features). --- src/scanner.l | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/scanner.l b/src/scanner.l index 4846132..7e59279 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -597,15 +597,11 @@ static int yyread(char *buf,int max_size) /* start command character */ CMD ("\\"|"@") -SECTIONCMD {CMD}("image"|"author"|"internal"|"version"|"date"|"deprecated"|"param"|"exception"|"return"[s]?|"retval"|"bug"|"warning"|"par"|"sa"|"see"|"pre"|"post"|"invariant"|"note"|"remark"[s]?|"todo"|"test"|"xrefitem"|"ingroup"|"callgraph"|"callergraph"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"manonly"|"{"|"verbatim"|"dotfile"|"dot"|"defgroup"|"addtogroup"|"weakgroup"|"class"|"namespace"|"union"|"struct"|"fn"|"var"|"details"|"typedef"|"def"|"overload")|("<"{PRE}">") BN [ \t\n\r] BL [ \t\r]*"\n" B [ \t] -BS ^(({B}*"//")?)(({B}*"*"+)?){B}* ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* -SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?) SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID}) -PHPSCOPENAME ({ID}"\\")+{ID} TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")? CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID}) PRE [pP][rR][eE] -- cgit v0.12 From ee12e104e1f43aa4e5301b314f7c620dbbf58ecc Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 23 Oct 2018 13:04:16 +0200 Subject: Fortran scanner abort message The Fortran scanner can give a message when the scanner is aborted, in here there is also the state, but in the form of a number. This patch adds a little bit more descriptive text. --- src/fortranscanner.l | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 2bd6788..5f10669 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -231,6 +231,8 @@ static void updateVariablePrepassComment(int from, int to); static void newLine(); static void initEntry(); +static const char *stateToString(int state); + //----------------------------------------------------------------------------- #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); @@ -2759,7 +2761,7 @@ void FortranLanguageScanner::parsePrototype(const char *text) static void scanner_abort() { fprintf(stderr,"********************************************************************\n"); - fprintf(stderr,"Error in file %s line: %d, state: %d\n",yyFileName.data(),yyLineNr,YY_START); + fprintf(stderr,"Error in file %s line: %d, state: %d(%s)\n",yyFileName.data(),yyLineNr,YY_START,stateToString(YY_START)); fprintf(stderr,"********************************************************************\n"); EntryListIterator eli(*global_root->children()); @@ -2788,3 +2790,47 @@ extern "C" { // some bogus code to keep the compiler happy } #endif +#define scanStateToString(x) case x: resultString = #x; break; +static const char *stateToString(int state) +{ + const char *resultString; + switch(state) + { + scanStateToString(INITIAL) + scanStateToString(Subprog) + scanStateToString(SubprogPrefix) + scanStateToString(Parameterlist) + scanStateToString(SubprogBody) + scanStateToString(SubprogBodyContains) + scanStateToString(Start) + scanStateToString(Comment) + scanStateToString(Module) + scanStateToString(Program) + scanStateToString(ModuleBody) + scanStateToString(ModuleBodyContains) + scanStateToString(AttributeList) + scanStateToString(Variable) + scanStateToString(Initialization) + scanStateToString(ArrayInitializer) + scanStateToString(Enum) + scanStateToString(Typedef) + scanStateToString(TypedefBody) + scanStateToString(TypedefBodyContains) + scanStateToString(InterfaceBody) + scanStateToString(StrIgnore) + scanStateToString(String) + scanStateToString(Use) + scanStateToString(UseOnly) + scanStateToString(ModuleProcedure) + scanStateToString(Prepass) + scanStateToString(DocBlock) + scanStateToString(DocBackLine) + scanStateToString(EndDoc) + scanStateToString(BlockData) + scanStateToString(Prototype) + scanStateToString(PrototypeSubprog) + scanStateToString(PrototypeArgs) + default: resultString = "Unknown"; break; + } + return resultString; +} -- cgit v0.12 From b90d628a80179f2a2c82f7d43bbec1df3f8190bb Mon Sep 17 00:00:00 2001 From: luzhetsky Date: Wed, 24 Oct 2018 15:47:29 +0300 Subject: Heading in rtf. #6522 https://github.com/doxygen/doxygen/issues/6522 --- src/rtfdocvisitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 7fbfdc8..0be2266 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -1072,7 +1072,7 @@ void RTFDocVisitor::visitPre(DocHtmlHeader *header) m_t << "{" // start section << rtf_Style_Reset; QCString heading; - int level = QMIN(header->level()+2,4); + int level = QMIN(header->level(),5); heading.sprintf("Heading%d",level); // set style m_t << rtf_Style[heading]->reference; -- cgit v0.12 From 78a73c52935396f0158ed9dd58909424981bee7e Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 27 Oct 2018 14:51:26 +0200 Subject: Documentation internet addresses Running a link checker revealed a number of not existing / redirected addresses, these have been corrected. --- doc/changelog.doc | 2 +- doc/docblocks.doc | 7 ++++--- doc/features.doc | 2 +- doc/install.doc | 6 +++--- doc/markdown.doc | 2 +- doc/searching.doc | 4 ++-- doc/starting.doc | 2 +- src/config.xml | 22 +++++++++++----------- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/doc/changelog.doc b/doc/changelog.doc index 3ba6787..ca00728 100644 --- a/doc/changelog.doc +++ b/doc/changelog.doc @@ -2182,7 +2182,7 @@ make sure you add the following:

New features

  • Added support for - Markdown + Markdown formatting. This is enabled by default, but can be disabled by setting MARKDOWN_SUPPORT to NO. When enabled the following is diff --git a/doc/docblocks.doc b/doc/docblocks.doc index f02e55b..ab144af 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -632,7 +632,7 @@ and is ideal for a short description. For longer descriptions you often will find the need for some more structure, like a block of verbatim text, a list, or a simple table. For this doxygen supports the -Markdown +Markdown syntax, including parts of the Markdown Extra extension. @@ -648,8 +648,9 @@ forms of additional markup on top of Markdown formatting. 1. Javadoc like markup. See \ref commands for a complete overview of all commands supported by doxygen. -2. XML markup - as specified in the C# standard. See \ref xmlcmds for the XML commands supported by doxygen. +2. XML markup + as specified in the C# standard. + See \ref xmlcmds for the XML commands supported by doxygen. If this is still not enough doxygen also supports a \ref htmlcmds "subset" of the HTML markup language. diff --git a/doc/features.doc b/doc/features.doc index f6aa7c1..fbbdf44 100644 --- a/doc/features.doc +++ b/doc/features.doc @@ -100,7 +100,7 @@ Although doxygen can now be used in any project written in a language that is supported by doxygen, initially it was specifically designed to be used for projects that make use of Qt Software's -Qt toolkit. I have tried to +Qt toolkit. I have tried to make doxygen `Qt-compatible'. That is: Doxygen can read the documentation contained in the Qt source code and create a class browser that looks quite similar to the one that is generated by Qt Software. Doxygen understands the C++ extensions diff --git a/doc/install.doc b/doc/install.doc index 7df0dee..d64b259 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -47,7 +47,7 @@ tools should be installed.
    • Qt Software's GUI toolkit - Qt + Qt \addindex Qt version 4.3 or higher (including Qt 5). This is needed to build the GUI front-end doxywizard. @@ -211,12 +211,12 @@ If you want to produce compressed HTML files (see \ref cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the configuration file, then you need the Microsoft HTML help workshop. You can download it from -Microsoft. +Microsoft. If you want to produce Qt Compressed Help files (see \ref cfg_qhg_location "QHG_LOCATION") in the configuration file, then you need qhelpgenerator which is part of Qt. -You can download Qt from Qt Software Downloads. +You can download Qt from Qt Software Downloads. In order to generate PDF output or use scientific formulas you will also need to install LaTeX and diff --git a/doc/markdown.doc b/doc/markdown.doc index eebcb40..5edbaf9 100644 --- a/doc/markdown.doc +++ b/doc/markdown.doc @@ -41,7 +41,7 @@ the extensions that doxygen supports. Finally section \ref markdown_dox discusses some specifics for doxygen's implementation of the Markdown standard. -[markdown]: http://daringfireball.net/projects/markdown/ +[markdown]: https://daringfireball.net/projects/markdown/ [mdextra]: https://michelf.ca/projects/php-markdown/extra/ [github]: https://github.github.com/github-flavored-markdown/ diff --git a/doc/searching.doc b/doc/searching.doc index cb6b84a..9bc518a 100644 --- a/doc/searching.doc +++ b/doc/searching.doc @@ -126,7 +126,7 @@ has its own advantages and disadvantages: options you may want to set. After doxygen has finished you will find a Makefile in the HTML output directory. Running "make install" on this Makefile will compile and install the doc set. - See this + See this article for more info. Advantage of this method is that it nicely integrates with the Xcode @@ -139,7 +139,7 @@ has its own advantages and disadvantages:

      6. Qt Compressed Help

      If you develop for or want to install the Qt application framework, you will get an application - called Qt assistant. + called Qt assistant. This is a help viewer for Qt Compressed Help files (.qch). To enable this feature set \ref cfg_generate_qhp "GENERATE_QHP" to \c YES. diff --git a/doc/starting.doc b/doc/starting.doc index 0765a3b..64d3be0 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -263,7 +263,7 @@ capabilities of the man page format, so some information \subsection docbook_out DocBook output \addindex docbook Doxygen can also generate output in the -DocBook format. How to process the +DocBook format. How to process the DocBook output is beyond the scope of this manual. \section step3 Step 3: Documenting the sources diff --git a/src/config.xml b/src/config.xml index 08795dc..0c09cca 100644 --- a/src/config.xml +++ b/src/config.xml @@ -650,7 +650,7 @@ Go to the next section or return to the Apple's Xcode 3 + Apple's Xcode 3 integrated development environment, introduced with OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a Makefile in the HTML output directory. Running \c make will produce the docset in that directory and running make install will install the docset in ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at startup. See - https://developer.apple.com/tools/creatingdocsetswithdoxygen.html for - more information. + https://developer.apple.com/library/archive/featuredarticles/DoxygenXcode/_index.html + for more information. ]]> @@ -2095,7 +2095,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. doxygen generates three additional HTML index files: \c index.hhp, \c index.hhc, and \c index.hhk. The \c index.hhp is a project file that can be read by - + Microsoft's HTML Help Workshop on Windows.
      @@ -2191,7 +2191,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. Qt Help Project / Namespace. + Qt Help Project / Namespace. ]]> @@ -2200,7 +2200,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. Qt Help Project / Virtual Folders. + Qt Help Project / Virtual Folders. ]]> @@ -2208,7 +2208,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. Qt Help Project / Custom Filters. + Qt Help Project / Custom Filters. ]]> @@ -2217,7 +2217,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. Qt Help Project / Custom Filters. + Qt Help Project / Custom Filters. ]]> @@ -2225,7 +2225,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. Qt Help Project / Filter Attributes. + Qt Help Project / Filter Attributes. ]]> @@ -2375,7 +2375,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -