summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/classdef.cpp71
-rw-r--r--src/classdef.h7
-rw-r--r--src/cmdmapper.cpp3
-rw-r--r--src/cmdmapper.h5
-rw-r--r--src/code.l140
-rw-r--r--src/commentcnv.l12
-rw-r--r--src/commentscan.l1
-rw-r--r--src/config.xml15
-rw-r--r--src/configimpl.h5
-rw-r--r--src/configimpl.l57
-rw-r--r--src/context.cpp29
-rw-r--r--src/context.h1
-rw-r--r--src/definition.cpp31
-rw-r--r--src/definition.h2
-rw-r--r--src/dirdef.cpp149
-rw-r--r--src/docbookvisitor.cpp27
-rw-r--r--src/docparser.cpp97
-rw-r--r--src/docparser.h3
-rw-r--r--src/dot.cpp56
-rw-r--r--src/dot.h7
-rw-r--r--src/doxygen.cpp51
-rw-r--r--src/filedef.cpp32
-rw-r--r--src/filedef.h17
-rw-r--r--src/filename.cpp16
-rw-r--r--src/fileparser.cpp6
-rw-r--r--src/formula.cpp7
-rw-r--r--src/fortrancode.l30
-rw-r--r--src/fortranscanner.l31
-rw-r--r--src/ftvhelp.cpp2
-rw-r--r--src/groupdef.cpp15
-rw-r--r--src/htmldocvisitor.cpp74
-rw-r--r--src/htmlentity.cpp4
-rw-r--r--src/htmlgen.cpp198
-rw-r--r--src/htmlgen.h37
-rw-r--r--src/htmlhelp.cpp9
-rw-r--r--src/htmlhelp.h1
-rw-r--r--src/index.cpp169
-rw-r--r--src/latexdocvisitor.cpp47
-rw-r--r--src/latexgen.cpp149
-rw-r--r--src/latexgen.h35
-rw-r--r--src/lodepng.cpp20
-rw-r--r--src/mandocvisitor.cpp50
-rw-r--r--src/mangen.cpp15
-rw-r--r--src/mangen.h12
-rw-r--r--src/markdown.cpp118
-rw-r--r--src/memberdef.cpp129
-rw-r--r--src/memberdef.h2
-rw-r--r--src/membergroup.cpp6
-rw-r--r--src/memberlist.cpp199
-rw-r--r--src/memberlist.h20
-rw-r--r--src/namespacedef.cpp32
-rw-r--r--src/outputgen.h8
-rw-r--r--src/outputlist.cpp1
-rw-r--r--src/outputlist.h18
-rw-r--r--src/pagedef.cpp2
-rw-r--r--src/perlmodgen.cpp51
-rw-r--r--src/plantuml.cpp2
-rw-r--r--src/portable.cpp25
-rw-r--r--src/portable.h1
-rw-r--r--src/pre.l16
-rw-r--r--src/printdocvisitor.h7
-rw-r--r--src/pycode.l37
-rw-r--r--src/pyscanner.l40
-rw-r--r--src/resourcemgr.cpp7
-rw-r--r--src/resourcemgr.h4
-rw-r--r--src/rtfdocvisitor.cpp55
-rw-r--r--src/rtfgen.cpp81
-rw-r--r--src/rtfgen.h8
-rw-r--r--src/scanner.l6
-rw-r--r--src/sqlite3gen.cpp354
-rw-r--r--src/tagreader.cpp14
-rw-r--r--src/template.cpp317
-rw-r--r--src/template.h3
-rw-r--r--src/translator_de.h59
-rw-r--r--src/translator_en.h8
-rwxr-xr-xsrc/util.cpp461
-rwxr-xr-xsrc/util.h3
-rw-r--r--src/vhdlcode.l16
-rw-r--r--src/vhdldocgen.cpp6
-rw-r--r--src/xmlcode.l19
-rw-r--r--src/xmldocvisitor.cpp45
-rw-r--r--src/xmlgen.cpp3
83 files changed, 2796 insertions, 1133 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index af01804..3c7edca 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -123,6 +123,7 @@ BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp
add_library(doxycfg STATIC
${GENERATED_SRC}/lang_cfg.h
+ ${GENERATED_SRC}/configvalues.h
${GENERATED_SRC}/configimpl.cpp
${GENERATED_SRC}/configoptions.cpp
${GENERATED_SRC}/configvalues.cpp
diff --git a/src/classdef.cpp b/src/classdef.cpp
index a51c0bf..c987d98 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -62,6 +62,15 @@ class ClassDefImpl
*/
QCString fileName;
+ /*! file name used for the list of all members */
+ QCString memberListFileName;
+
+ /*! file name used for the collaboration diagram */
+ QCString collabFileName;
+
+ /*! file name used for the inheritance graph */
+ QCString inheritFileName;
+
/*! Include information about the header file should be included
* in the documentation. 0 by default, set by setIncludeFile().
*/
@@ -296,6 +305,13 @@ ClassDef::ClassDef(
m_impl->compType = ct;
m_impl->isJavaEnum = isJavaEnum;
m_impl->init(defFileName,name(),compoundTypeString(),fName);
+ m_impl->memberListFileName = convertNameToFile(compoundTypeString()+name()+"-members");
+ m_impl->collabFileName = convertNameToFile(m_impl->fileName+"_coll_graph");
+ m_impl->inheritFileName = convertNameToFile(m_impl->fileName+"_inherit_graph");
+ if (!lref)
+ {
+ m_impl->fileName = convertNameToFile(m_impl->fileName);
+ }
}
// destroy the class definition
@@ -306,7 +322,7 @@ ClassDef::~ClassDef()
QCString ClassDef::getMemberListFileName() const
{
- return convertNameToFile(compoundTypeString()+name()+"-members");
+ return m_impl->memberListFileName;
}
QCString ClassDef::displayName(bool includeScope) const
@@ -1690,7 +1706,7 @@ void ClassDef::writeInlineDocumentation(OutputList &ol)
ol.disableAllBut(OutputGenerator::Html);
{ // only HTML only
ol.writeAnchor(0,anchor());
- ol.startMemberDoc(0,0,0,0,FALSE);
+ ol.startMemberDoc(0,0,anchor(),name(),1,1,FALSE);
ol.startMemberDocName(FALSE);
ol.parseText(s);
ol.endMemberDocName();
@@ -3564,40 +3580,12 @@ QCString ClassDef::getOutputFileBase() const
// point to the template of which this class is an instance
return m_impl->templateMaster->getOutputFileBase();
}
- else if (isReference())
- {
- // point to the external location
- return m_impl->fileName;
- }
- else
- {
- // normal locally defined class
- return convertNameToFile(m_impl->fileName);
- }
+ return m_impl->fileName;
}
QCString ClassDef::getInstanceOutputFileBase() const
{
- if (isReference())
- {
- return m_impl->fileName;
- }
- else
- {
- return convertNameToFile(m_impl->fileName);
- }
-}
-
-QCString ClassDef::getFileBase() const
-{
- if (m_impl->templateMaster)
- {
- return m_impl->templateMaster->getFileBase();
- }
- else
- {
- return m_impl->fileName;
- }
+ return m_impl->fileName;
}
QCString ClassDef::getSourceFileBase() const
@@ -4613,15 +4601,9 @@ QCString ClassDef::anchor() const
// point to the template of which this class is an instance
anc = m_impl->templateMaster->getOutputFileBase();
}
- else if (isReference())
- {
- // point to the external location
- anc = m_impl->fileName;
- }
else
{
- // normal locally defined class
- anc = convertNameToFile(m_impl->fileName);
+ anc = m_impl->fileName;
}
}
return anc;
@@ -4750,3 +4732,14 @@ bool ClassDef::isAnonymous() const
{
return m_impl->isAnonymous;
}
+
+QCString ClassDef::collaborationGraphFileName() const
+{
+ return m_impl->collabFileName;
+}
+
+QCString ClassDef::inheritanceGraphFileName() const
+{
+ return m_impl->inheritFileName;
+}
+
diff --git a/src/classdef.h b/src/classdef.h
index 6cdd491..524bb96 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -108,7 +108,6 @@ class ClassDef : public Definition
/** Returns the unique base name (without extension) of the class's file on disk */
QCString getOutputFileBase() const;
QCString getInstanceOutputFileBase() const;
- QCString getFileBase() const;
/** Returns the base name for the source code file */
QCString getSourceFileBase() const;
@@ -130,6 +129,12 @@ class ClassDef : public Definition
/** returns TRUE if this class has a non-empty detailed description */
bool hasDetailedDescription() const;
+
+ /** returns the file name to use for the collaboration graph */
+ QCString collaborationGraphFileName() const;
+
+ /** returns the file name to use for the inheritance graph */
+ QCString inheritanceGraphFileName() const;
/** Returns the name as it is appears in the documentation */
QCString displayName(bool includeScope=TRUE) const;
diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp
index 6784b3e..2c8effc 100644
--- a/src/cmdmapper.cpp
+++ b/src/cmdmapper.cpp
@@ -88,6 +88,8 @@ CommandMap cmdMap[] =
{ "secreflist", CMD_SECREFLIST },
{ "section", CMD_SECTION },
{ "snippet", CMD_SNIPPET },
+ { "snippetdoc", CMD_SNIPPETDOC },
+ { "snippetlineno", CMD_SNIPWITHLINES },
{ "subpage", CMD_SUBPAGE },
{ "subsection", CMD_SUBSECTION },
{ "subsubsection", CMD_SUBSUBSECTION },
@@ -130,6 +132,7 @@ CommandMap cmdMap[] =
{ "manonly", CMD_MANONLY },
{ "endmanonly", CMD_ENDMANONLY },
{ "includelineno", CMD_INCWITHLINES },
+ { "includedoc", CMD_INCLUDEDOC },
{ "inheritdoc", CMD_INHERITDOC },
{ "mscfile", CMD_MSCFILE },
{ "rtfonly", CMD_RTFONLY },
diff --git a/src/cmdmapper.h b/src/cmdmapper.h
index 92c906a..8cb529d 100644
--- a/src/cmdmapper.h
+++ b/src/cmdmapper.h
@@ -133,7 +133,10 @@ enum CommandType
CMD_SETSCOPE = 103,
CMD_PUNT = 104,
CMD_PLUS = 105,
- CMD_MINUS = 106
+ CMD_MINUS = 106,
+ CMD_INCLUDEDOC = 107,
+ CMD_SNIPPETDOC = 108,
+ CMD_SNIPWITHLINES= 109
};
enum HtmlTagType
diff --git a/src/code.l b/src/code.l
index b03c8b4..c2eaeed 100644
--- a/src/code.l
+++ b/src/code.l
@@ -109,6 +109,7 @@ static int g_lastSpecialCContext;
static int g_lastStringContext;
static int g_lastSkipCppContext;
static int g_lastVerbStringContext;
+static int g_lastObjCCallContext;
static int g_memCallContext;
static int g_lastCContext;
static int g_skipInlineInitContext;
@@ -132,6 +133,7 @@ struct ObjCCallCtx
int id;
QCString methodName;
QCString objectTypeOrName;
+ QGString comment;
ClassDef *objectType;
MemberDef *objectVar;
MemberDef *method;
@@ -146,11 +148,13 @@ static int g_currentCtxId=0;
static int g_currentNameId=0;
static int g_currentObjId=0;
static int g_currentWordId=0;
+static int g_currentCommentId=0;
static QStack<ObjCCallCtx> g_contextStack;
static QIntDict<ObjCCallCtx> g_contextDict;
static QIntDict<QCString> g_nameDict;
static QIntDict<QCString> g_objectDict;
static QIntDict<QCString> g_wordDict;
+static QIntDict<QCString> g_commentDict;
static int g_braceCount=0;
static void saveObjCContext();
@@ -858,42 +862,51 @@ static bool getLinkInScope(const QCString &c, // scope
GroupDef *gd;
DBG_CTX((stderr,"getLinkInScope: trying `%s'::`%s' varOnly=%d\n",c.data(),m.data(),varOnly));
if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef,FALSE,g_forceTagReference) &&
- md->isLinkable() && (!varOnly || md->isVariable()))
+ (!varOnly || md->isVariable()))
{
- //printf("found it %s!\n",md->qualifiedName().data());
- if (g_exampleBlock)
+ if (md->isLinkable())
{
- QCString anchor;
- anchor.sprintf("a%d",g_anchorCount);
- //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),g_exampleName.data(),
- // g_exampleFile.data());
- if (md->addExample(anchor,g_exampleName,g_exampleFile))
+ //printf("found it %s!\n",md->qualifiedName().data());
+ if (g_exampleBlock)
{
- ol.writeCodeAnchor(anchor);
- g_anchorCount++;
+ QCString anchor;
+ anchor.sprintf("a%d",g_anchorCount);
+ //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),g_exampleName.data(),
+ // g_exampleFile.data());
+ if (md->addExample(anchor,g_exampleName,g_exampleFile))
+ {
+ ol.writeCodeAnchor(anchor);
+ g_anchorCount++;
+ }
}
- }
-
- Definition *d = md->getOuterScope()==Doxygen::globalScope ?
- md->getFileDef() : md->getOuterScope();
- if (md->getGroupDef()) d = md->getGroupDef();
- if (d && d->isLinkable())
- {
- g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
- //printf("g_currentDefinition=%p g_currentMemberDef=%p g_insideBody=%d\n",
- // g_currentDefinition,g_currentMemberDef,g_insideBody);
- if (g_currentDefinition && g_currentMemberDef &&
- md!=g_currentMemberDef && g_insideBody && g_collectXRefs)
+ Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+ md->getFileDef() : md->getOuterScope();
+ if (md->getGroupDef()) d = md->getGroupDef();
+ if (d && d->isLinkable())
{
- addDocCrossReference(g_currentMemberDef,md);
+ g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
+ //printf("g_currentDefinition=%p g_currentMemberDef=%p g_insideBody=%d\n",
+ // g_currentDefinition,g_currentMemberDef,g_insideBody);
+
+ if (g_currentDefinition && g_currentMemberDef &&
+ md!=g_currentMemberDef && g_insideBody && g_collectXRefs)
+ {
+ addDocCrossReference(g_currentMemberDef,md);
+ }
+ //printf("d->getReference()=`%s' d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data());
+
+ writeMultiLineCodeLink(ol,md, text ? text : memberText);
+ addToSearchIndex(text ? text : memberText);
+ return TRUE;
}
- //printf("d->getReference()=`%s' d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data());
-
- writeMultiLineCodeLink(ol,md, text ? text : memberText);
- addToSearchIndex(text ? text : memberText);
- return TRUE;
- }
+ }
+ else // found member, but is is not linkable, so make sure content inside is not assign
+ // to the previous member, see bug762760
+ {
+ DBG_CTX((stderr,"unlinkable member %s\n",md->name().data()));
+ g_currentMemberDef = 0;
+ }
}
return FALSE;
}
@@ -1705,6 +1718,21 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
codifyLines(pWord->data());
}
}
+ else if (nc=='d') // comment block
+ {
+ nc=*p++;
+ QCString refIdStr;
+ while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+ p--;
+ int refId=refIdStr.toInt();
+ QCString *pComment = g_commentDict.find(refId);
+ if (pComment)
+ {
+ startFontClass("comment");
+ codifyLines(pComment->data());
+ endFontClass();
+ }
+ }
else // illegal marker
{
ASSERT(!"invalid escape sequence");
@@ -1717,7 +1745,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
s[0]=c;s[1]=0;
codifyLines(s);
}
- }
+ }
//printf("%s %s]\n",ctx->objectTypeOrName.data(),ctx->methodName.data());
//printf("}=(type='%s',name='%s')",
// ctx->objectTypeOrName.data(),
@@ -1754,6 +1782,15 @@ static QCString escapeWord(const char *s)
return result;
}
+static QCString escapeComment(const char *s)
+{
+ QCString result;
+ result.sprintf("$d%d",g_currentCommentId);
+ g_commentDict.insert(g_currentCommentId,new QCString(s));
+ g_currentCommentId++;
+ return result;
+}
+
/* -----------------------------------------------------------------
*/
#undef YY_INPUT
@@ -1827,6 +1864,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
%x ObjCCall
%x ObjCMName
%x ObjCSkipStr
+%x ObjCCallComment
%x OldStyleArgs
%x UsingName
%x RawString
@@ -2723,10 +2761,12 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
g_nameDict.setAutoDelete(TRUE);
g_objectDict.setAutoDelete(TRUE);
g_wordDict.setAutoDelete(TRUE);
+ g_commentDict.setAutoDelete(TRUE);
g_contextDict.clear();
g_nameDict.clear();
g_objectDict.clear();
g_wordDict.clear();
+ g_commentDict.clear();
g_currentCtxId = 0;
g_currentNameId = 0;
g_currentObjId = 0;
@@ -2811,13 +2851,13 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
BEGIN(Body);
}
*/
-<ObjCCall,ObjCMName>"[" {
- saveObjCContext();
- g_currentCtx->format+=*yytext;
- BEGIN(ObjCCall);
- //printf("open\n");
- }
-<ObjCCall,ObjCMName>"]" {
+<ObjCCall,ObjCMName>"["|"{" {
+ saveObjCContext();
+ g_currentCtx->format+=*yytext;
+ BEGIN(ObjCCall);
+ //printf("open\n");
+ }
+<ObjCCall,ObjCMName>"]"|"}" {
g_currentCtx->format+=*yytext;
restoreObjCContext();
BEGIN(ObjCMName);
@@ -2829,6 +2869,23 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
}
//printf("close\n");
}
+<ObjCCall,ObjCMName>"//".* {
+ g_currentCtx->format+=escapeComment(yytext);
+ }
+<ObjCCall,ObjCMName>"/*" {
+ g_lastObjCCallContext = YY_START;
+ g_currentCtx->comment=yytext;
+ BEGIN(ObjCCallComment);
+ }
+<ObjCCallComment>"*/" {
+ g_currentCtx->comment+=yytext;
+ g_currentCtx->format+=escapeComment(g_currentCtx->comment);
+ BEGIN(g_lastObjCCallContext);
+ }
+<ObjCCallComment>[^*\n]+ { g_currentCtx->comment+=yytext; }
+<ObjCCallComment>"//"|"/*" { g_currentCtx->comment+=yytext; }
+<ObjCCallComment>\n { g_currentCtx->comment+=*yytext; }
+<ObjCCallComment>. { g_currentCtx->comment+=*yytext; }
<ObjCCall>{ID} {
g_currentCtx->format+=escapeObject(yytext);
if (g_braceCount==0)
@@ -3602,16 +3659,17 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
g_searchCtx = searchCtx;
g_collectXRefs = collectXRefs;
g_inFunctionTryBlock = FALSE;
- if (endLine!=-1)
- g_inputLines = endLine+1;
- else
- g_inputLines = countLines();
if (startLine!=-1)
g_yyLineNr = startLine;
else
g_yyLineNr = 1;
+ if (endLine!=-1)
+ g_inputLines = endLine+1;
+ else
+ g_inputLines = g_yyLineNr + countLines() - 1;
+
g_curlyCount = 0;
g_bodyCurlyCount = 0;
g_bracketCount = 0;
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 5457738..6409b0b 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -379,6 +379,12 @@ void replaceComment(int offset);
g_inRoseComment=TRUE;
BEGIN(SComment);
}
+<Scan>"//"[!\/]/.*\n[ \t]*"//"[|\/][ \t]*[@\\]"}" { // next line contains an end marker, see bug 752712
+ g_inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
+ copyToOutput(yytext,(int)yyleng);
+ g_readLineCtx=YY_START;
+ BEGIN(ReadLine);
+ }
<Scan>"//"/.*\n { /* one line C++ comment */
g_inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
copyToOutput(yytext,(int)yyleng);
@@ -459,7 +465,7 @@ void replaceComment(int offset);
}
BEGIN(VerbatimCode);
}
-<CComment,ReadLine>[\\@]("f$"|"f["|"f{"[a-z]*) {
+<CComment,ReadLine>[\\@]("f$"|"f["|"f{") {
copyToOutput(yytext,(int)yyleng);
g_blockName=&yytext[1];
if (g_blockName.at(1)=='[')
@@ -482,9 +488,9 @@ void replaceComment(int offset);
<Scan>. { /* any ather character */
copyToOutput(yytext,(int)yyleng);
}
-<Verbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"docbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}") { /* end of verbatim block */
+<Verbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}") { /* end of verbatim block */
copyToOutput(yytext,(int)yyleng);
- if (yytext[1]=='f') // end of formula
+ if (&yytext[1]==g_blockName) // end of formula
{
BEGIN(g_lastCommentContext);
}
diff --git a/src/commentscan.l b/src/commentscan.l
index 98f2093..f31452a 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -254,6 +254,7 @@ static DocCmdMap docCmdMap[] =
{ "result", 0, TRUE },
{ "return", 0, TRUE },
{ "returns", 0, TRUE },
+ { "exception", 0, TRUE },
{ "retval", 0, TRUE },
{ "sa", 0, TRUE },
{ "see", 0, TRUE },
diff --git a/src/config.xml b/src/config.xml
index 0aa8fda..4c13e9c 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -617,6 +617,16 @@ Go to the <a href="commands.html">next</a> section or return to the
]]>
</docs>
</option>
+ <option type='int' id='TOC_INCLUDE_HEADINGS' minval='0' maxval='99' defval='0' depends='MARKDOWN_SUPPORT'>
+ <docs>
+<![CDATA[
+ When the \c TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings
+ up to that level are automatically included in the table of contents, even if
+ they do not have an id attribute.
+ \note This feature currently applies only to Markdown headings.
+]]>
+ </docs>
+ </option>
<option type='bool' id='AUTOLINK_SUPPORT' defval='1'>
<docs>
<![CDATA[
@@ -1327,6 +1337,9 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<value name='*.py'/>
<value name='*.pyw'/>
<value name='*.f90'/>
+ <value name='*.f95'/>
+ <value name='*.f03'/>
+ <value name='*.f08'/>
<value name='*.f'/>
<value name='*.for'/>
<value name='*.tcl'/>
@@ -1334,8 +1347,6 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<value name='*.vhdl'/>
<value name='*.ucf'/>
<value name='*.qsf'/>
- <value name='*.as'/>
- <value name='*.js'/>
</option>
<option type='bool' id='RECURSIVE' defval='0'>
<docs>
diff --git a/src/configimpl.h b/src/configimpl.h
index 4dd96be..c901198 100644
--- a/src/configimpl.h
+++ b/src/configimpl.h
@@ -119,15 +119,16 @@ class ConfigList : public ConfigOption
m_doc = doc;
m_widgetType = String;
}
- void addValue(const char *v) { m_value.append(v); }
+ void addValue(const char *v) { m_defaultValue.append(v); }
void setWidgetType(WidgetType w) { m_widgetType = w; }
WidgetType widgetType() const { return m_widgetType; }
QStrList *valueRef() { return &m_value; }
void writeTemplate(FTextStream &t,bool sl,bool);
void substEnvVars();
- void init() { m_value.clear(); }
+ void init() { m_value = m_defaultValue; }
private:
QStrList m_value;
+ QStrList m_defaultValue;
WidgetType m_widgetType;
};
diff --git a/src/configimpl.l b/src/configimpl.l
index f1d33c0..2cf698a 100644
--- a/src/configimpl.l
+++ b/src/configimpl.l
@@ -1155,24 +1155,27 @@ static void cleanUpPaths(QStrList &str)
char c;
while ((c=*p))
{
- if (c=='\\') *p='/';
- p++;
+ if (c=='\\') *p='/';
+ p++;
}
}
QCString path = sfp;
if ((path.at(0)!='/' && (path.length()<=2 || path.at(1)!=':')) ||
- path.at(path.length()-1)!='/'
+ path.at(path.length()-1)!='/'
)
{
QFileInfo fi(path);
if (fi.exists() && fi.isDir())
{
- int i = str.at();
- str.remove();
- if (str.at()==i) // did not remove last item
- str.insert(i,fi.absFilePath().utf8()+"/");
- else
- str.append(fi.absFilePath().utf8()+"/");
+ int i = str.at();
+ QString p = fi.absFilePath();
+ if (p.at(p.length()-1)!='/')
+ p.append('/');
+ str.remove();
+ if (str.at()==i) // did not remove last item
+ str.insert(i,p.utf8());
+ else
+ str.append(p.utf8());
}
}
sfp = str.next();
@@ -1190,26 +1193,6 @@ static void checkFileName(QCString &s,const char *optionName)
}
}
-static void initFilePattern(void)
-{
- // add default pattern if needed
- QStrList &filePatternList = ConfigImpl_getList("FILE_PATTERNS");
- if (filePatternList.isEmpty())
- {
- QDictIterator<int> it( getExtensionLookup() );
- QCString pattern;
- bool caseSens = portable_fileSystemIsCaseSensitive();
- for (;it.current();++it)
- {
- pattern = "*";
- pattern += it.currentKey();
- filePatternList.append(pattern.data());
- if (caseSens) filePatternList.append(pattern.upper().data());
- }
- }
-}
-
-
#include "config.h"
void Config::init()
@@ -1281,7 +1264,10 @@ void Config::checkAndCorrect()
char *sfp = stripFromPath.first();
if (sfp==0) // by default use the current path
{
- stripFromPath.append(QDir::currentDirPath().utf8()+"/");
+ QString p = QDir::currentDirPath();
+ if (p.at(p.length()-1)!='/')
+ p.append('/');
+ stripFromPath.append(p.utf8());
}
else
{
@@ -1565,7 +1551,16 @@ void Config::checkAndCorrect()
}
}
- initFilePattern();
+ // add default file patterns if needed
+ QStrList &filePatternList = ConfigImpl_getList("FILE_PATTERNS");
+ if (filePatternList.isEmpty())
+ {
+ ConfigOption * opt = ConfigImpl::instance()->get("FILE_PATTERNS");
+ if (opt->kind()==ConfigOption::O_List)
+ {
+ ((ConfigList*)opt)->init();
+ }
+ }
// add default pattern if needed
QStrList &examplePatternList = ConfigImpl_getList("EXAMPLE_PATTERNS");
diff --git a/src/context.cpp b/src/context.cpp
index 67b4e12..f2f1419 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -35,6 +35,7 @@
#include "docparser.h"
#include "htmlgen.h"
#include "htmldocvisitor.h"
+#include "htmlhelp.h"
#include "latexgen.h"
#include "latexdocvisitor.h"
#include "dot.h"
@@ -46,12 +47,11 @@
#include "arguments.h"
#include "groupdef.h"
#include "searchindex.h"
+#include "resourcemgr.h"
// TODO: pass the current file to Dot*::writeGraph, so the user can put dot graphs in other
// files as well
-#define ADD_PROPERTY(name) addProperty(#name,this,&Private::name);
-
enum ContextOutputFormat
{
ContextOutputFormat_Unspecified=0,
@@ -1007,6 +1007,10 @@ class TranslateContext::Private
{
return theTranslator->trExamplesDescription();
}
+ TemplateVariant langString() const
+ {
+ return HtmlHelp::getLanguageString();
+ }
Private()
{
static bool init=FALSE;
@@ -1196,6 +1200,8 @@ class TranslateContext::Private
s_inst.addProperty("extendsClass", &Private::extendsClass);
//%% string examplesDescription
s_inst.addProperty("examplesDescription",&Private::examplesDescription);
+ //%% string langstring
+ s_inst.addProperty("langString", &Private::langString);
init=TRUE;
}
@@ -10168,6 +10174,7 @@ void generateOutputViaTemplate()
//if (Config_getBool(GENERATE_HTML))
{ // render HTML output
+ e.setTemplateDir("templates/html"); // TODO: make template part user configurable
Template *tpl = e.loadByName("htmllayout.tpl",1);
if (tpl)
{
@@ -10192,6 +10199,7 @@ void generateOutputViaTemplate()
//if (Config_getBool(GENERATE_LATEX))
if (0)
{ // render LaTeX output
+ e.setTemplateDir("templates/latex"); // TODO: make template part user configurable
Template *tpl = e.loadByName("latexlayout.tpl",1);
if (tpl)
{
@@ -10241,3 +10249,20 @@ void generateOutputViaTemplate()
#endif
}
+void generateTemplateFiles(const char *templateDir)
+{
+ if (!templateDir) return;
+ QDir thisDir;
+ if (!thisDir.exists(templateDir) && !thisDir.mkdir(templateDir))
+ {
+ err("Failed to create output directory '%s'\n",templateDir);
+ return;
+ }
+ QCString outDir = QCString(templateDir)+"/html";
+ if (!thisDir.exists(outDir) && !thisDir.mkdir(outDir))
+ {
+ err("Failed to create output directory '%s'\n",templateDir);
+ return;
+ }
+ ResourceMgr::instance().writeCategory("html",outDir);
+}
diff --git a/src/context.h b/src/context.h
index 7c98222..e082c4b 100644
--- a/src/context.h
+++ b/src/context.h
@@ -1347,5 +1347,6 @@ class SearchIndicesContext : public RefCountedContext, public TemplateListIntf
//----------------------------------------------------
void generateOutputViaTemplate();
+void generateTemplateFiles(const char *templateDir);
#endif
diff --git a/src/definition.cpp b/src/definition.cpp
index ec30cd5..7e6e8ec 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -526,7 +526,7 @@ void Definition::writeDocAnchorsToTagFile(FTextStream &tagFile)
SectionInfo *si;
for (;(si=sdi.current());++sdi)
{
- if (!si->generated)
+ if (!si->generated && si->ref.isEmpty())
{
//printf("write an entry!\n");
if (definitionType()==TypeMember) tagFile << " ";
@@ -878,6 +878,7 @@ bool readCodeFragment(const char *fileName,
}
}
result = transcodeCharacterStringToUTF8(result);
+ if (!result.isEmpty() && result.at(result.length()-1)!='\n') result += "\n";
//fprintf(stderr,"readCodeFragement(%d-%d)=%s\n",startLine,endLine,result.data());
return found;
}
@@ -1507,19 +1508,6 @@ QList<ListItemInfo> *Definition::xrefListItems() const
return m_impl->xrefListItems;
}
-
-QCString Definition::convertNameToFile(const char *name,bool allowDots) const
-{
- if (!m_impl->ref.isEmpty())
- {
- return name;
- }
- else
- {
- return ::convertNameToFile(name,allowDots);
- }
-}
-
QCString Definition::pathFragment() const
{
QCString result;
@@ -1888,6 +1876,21 @@ GroupList *Definition::partOfGroups() const
return m_impl->partOfGroups;
}
+bool Definition::isLinkableViaGroup() const
+{
+ GroupList *gl = partOfGroups();
+ if (gl)
+ {
+ GroupListIterator gli(*gl);
+ GroupDef *gd;
+ for (gli.toFirst();(gd=gli.current());++gli)
+ {
+ if (gd->isLinkable()) return TRUE;
+ }
+ }
+ return FALSE;
+}
+
Definition *Definition::getOuterScope() const
{
return m_impl->outerScope;
diff --git a/src/definition.h b/src/definition.h
index 6277c6c..48c572d 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -257,6 +257,7 @@ class Definition : public DefinitionIntf
SrcLangExt getLanguage() const;
GroupList *partOfGroups() const;
+ bool isLinkableViaGroup() const;
QList<ListItemInfo> *xrefListItems() const;
@@ -326,7 +327,6 @@ class Definition : public DefinitionIntf
// --- actions ----
//-----------------------------------------------------------------------------------
- QCString convertNameToFile(const char *name,bool allowDots=FALSE) const;
void writeSourceDef(OutputList &ol,const char *scopeName);
void writeInlineCode(OutputList &ol,const char *scopeName);
void writeSourceRefs(OutputList &ol,const char *scopeName);
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index d458777..d6f4f55 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -223,37 +223,48 @@ void DirDef::writeDirectoryGraph(OutputList &ol)
void DirDef::writeSubDirList(OutputList &ol)
{
+ int numSubdirs = 0;
+ QListIterator<DirDef> it(m_subdirs);
+ DirDef *dd;
+ for (it.toFirst();(dd=it.current());++it)
+ {
+ if (dd->hasDocumentation() || dd->getFiles()->count()>0)
+ {
+ numSubdirs++;
+ }
+ }
+
// write subdir list
- if (m_subdirs.count()>0)
+ if (numSubdirs>0)
{
ol.startMemberHeader("subdirs");
ol.parseText(theTranslator->trDir(TRUE,FALSE));
ol.endMemberHeader();
ol.startMemberList();
- QListIterator<DirDef> it(m_subdirs);
- DirDef *dd;
- for (;(dd=it.current());++it)
+ for (it.toFirst();(dd=it.current());++it)
{
- if (!dd->hasDocumentation()) continue;
- ol.startMemberDeclaration();
- ol.startMemberItem(dd->getOutputFileBase(),0);
- ol.parseText(theTranslator->trDir(FALSE,TRUE)+" ");
- ol.insertMemberAlign();
- ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
- ol.endMemberItem();
- if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
+ if (dd->hasDocumentation() || dd->getFiles()->count()==0)
{
- ol.startMemberDescription(dd->getOutputFileBase());
- ol.generateDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),
- FALSE, // indexWords
- FALSE, // isExample
- 0, // exampleName
- TRUE, // single line
- TRUE // link from index
- );
- ol.endMemberDescription();
+ ol.startMemberDeclaration();
+ ol.startMemberItem(dd->getOutputFileBase(),0);
+ ol.parseText(theTranslator->trDir(FALSE,TRUE)+" ");
+ ol.insertMemberAlign();
+ ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
+ ol.endMemberItem();
+ if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
+ {
+ ol.startMemberDescription(dd->getOutputFileBase());
+ ol.generateDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),
+ FALSE, // indexWords
+ FALSE, // isExample
+ 0, // exampleName
+ TRUE, // single line
+ TRUE // link from index
+ );
+ ol.endMemberDescription();
+ }
+ ol.endMemberDeclaration(0,0);
}
- ol.endMemberDeclaration(0,0);
}
ol.endMemberList();
@@ -262,8 +273,19 @@ void DirDef::writeSubDirList(OutputList &ol)
void DirDef::writeFileList(OutputList &ol)
{
+ int numFiles = 0;
+ QListIterator<FileDef> it(*m_fileList);
+ FileDef *fd;
+ for (it.toFirst();(fd=it.current());++it)
+ {
+ if (fd->hasDocumentation())
+ {
+ numFiles++;
+ }
+ }
+
// write file list
- if (m_fileList->count()>0)
+ if (numFiles>0)
{
ol.startMemberHeader("files");
ol.parseText(theTranslator->trFile(TRUE,FALSE));
@@ -273,47 +295,49 @@ void DirDef::writeFileList(OutputList &ol)
FileDef *fd;
for (;(fd=it.current());++it)
{
- if (!fd->hasDocumentation()) continue;
- ol.startMemberDeclaration();
- ol.startMemberItem(fd->getOutputFileBase(),0);
- ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
- ol.insertMemberAlign();
- if (fd->isLinkable())
- {
- ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
- }
- else
+ if (fd->hasDocumentation())
{
- ol.startBold();
- ol.docify(fd->name());
- ol.endBold();
- }
- if (fd->generateSourceFile())
- {
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
- ol.docify(" ");
- ol.startTextLink(fd->includeName(),0);
- ol.docify("[");
- ol.parseText(theTranslator->trCode());
- ol.docify("]");
- ol.endTextLink();
- ol.popGeneratorState();
- }
- ol.endMemberItem();
- if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
- {
- ol.startMemberDescription(fd->getOutputFileBase());
- ol.generateDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),
- FALSE, // indexWords
- FALSE, // isExample
- 0, // exampleName
- TRUE, // single line
- TRUE // link from index
- );
- ol.endMemberDescription();
+ ol.startMemberDeclaration();
+ ol.startMemberItem(fd->getOutputFileBase(),0);
+ ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
+ ol.insertMemberAlign();
+ if (fd->isLinkable())
+ {
+ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
+ }
+ else
+ {
+ ol.startBold();
+ ol.docify(fd->name());
+ ol.endBold();
+ }
+ if (fd->generateSourceFile())
+ {
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Html);
+ ol.docify(" ");
+ ol.startTextLink(fd->includeName(),0);
+ ol.docify("[");
+ ol.parseText(theTranslator->trCode());
+ ol.docify("]");
+ ol.endTextLink();
+ ol.popGeneratorState();
+ }
+ ol.endMemberItem();
+ if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
+ {
+ ol.startMemberDescription(fd->getOutputFileBase());
+ ol.generateDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),
+ FALSE, // indexWords
+ FALSE, // isExample
+ 0, // exampleName
+ TRUE, // single line
+ TRUE // link from index
+ );
+ ol.endMemberDescription();
+ }
+ ol.endMemberDeclaration(0,0);
}
- ol.endMemberDeclaration(0,0);
}
ol.endMemberList();
}
@@ -924,7 +948,6 @@ void buildDirectories()
DirSDict::Iterator sdi(*Doxygen::directories);
for (sdi.toFirst();(dir=sdi.current());++sdi)
{
- //printf("New dir %s\n",dir->displayName().data());
QCString name = dir->name();
int i=name.findRev('/',name.length()-2);
if (i>0)
diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp
index ec320e9..ab10da0 100644
--- a/src/docbookvisitor.cpp
+++ b/src/docbookvisitor.cpp
@@ -359,6 +359,33 @@ void DocbookDocVisitor::visit(DocInclude *inc)
);
m_t << "</computeroutput></literallayout>";
break;
+ case DocInclude::SnipWithLines:
+ {
+ QFileInfo cfi( inc->file() );
+ FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ m_t << "<literallayout><computeroutput>";
+ Doxygen::parserManager->getParser(inc->extension())
+ ->parseCode(m_ci,
+ inc->context(),
+ extractBlock(inc->text(),inc->blockId()),
+ langExt,
+ inc->isExample(),
+ inc->exampleFile(),
+ &fd,
+ lineBlock(inc->text(),inc->blockId()),
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
+ TRUE // show line number
+ );
+ m_t << "</computeroutput></literallayout>";
+ }
+ break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
}
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 5dfa7b3..2602f78 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -123,6 +123,7 @@ struct DocParserContext
QStack<DocStyleChange> initialStyleStack;
QList<Definition> copyStack;
QCString fileName;
+ int lineNo;
QCString relPath;
bool hasParamCommand;
@@ -144,7 +145,6 @@ struct DocParserContext
static QStack<DocParserContext> g_parserStack;
//---------------------------------------------------------------------------
-
static void docParserPushContext(bool saveParamInfo=TRUE)
{
//QCString indent;
@@ -163,6 +163,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE)
ctx->initialStyleStack = g_initialStyleStack;
ctx->copyStack = g_copyStack;
ctx->fileName = g_fileName;
+ ctx->lineNo = doctokenizerYYlineno;
ctx->relPath = g_relPath;
if (saveParamInfo)
@@ -201,6 +202,7 @@ static void docParserPopContext(bool keepParamInfo=FALSE)
g_initialStyleStack = ctx->initialStyleStack;
g_copyStack = ctx->copyStack;
g_fileName = ctx->fileName;
+ doctokenizerYYlineno = ctx->lineNo;
g_relPath = ctx->relPath;
if (!keepParamInfo)
@@ -1264,9 +1266,6 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN
if (tok==TK_WORD && (g_token->name=="width=" || g_token->name=="height="))
{
// special case: no title, but we do have a size indicator
- doctokenizerYYsetStateTitleAttrValue();
- // strip =
- g_token->name = g_token->name.left(g_token->name.length()-1);
break;
}
if (!defaultHandleToken(parent,tok,children))
@@ -1293,21 +1292,32 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN
{
tok=doctokenizerYYlex();
}
- while (tok==TK_WORD) // there are values following the title
+ while (tok==TK_WHITESPACE || tok==TK_WORD) // there are values following the title
{
- if (g_token->name=="width")
- {
- width = g_token->chars;
- }
- else if (g_token->name=="height")
- {
- height = g_token->chars;
- }
- else
+ if(tok == TK_WORD)
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unknown option '%s' after \\%s command, expected 'width' or 'height'",
- qPrint(g_token->name), Mappers::cmdMapper->find(cmd).data());
+ if (g_token->name=="width=" || g_token->name=="height=")
+ {
+ doctokenizerYYsetStateTitleAttrValue();
+ g_token->name = g_token->name.left(g_token->name.length()-1);
+ }
+
+ if (g_token->name=="width")
+ {
+ width = g_token->chars;
+ }
+ else if (g_token->name=="height")
+ {
+ height = g_token->chars;
+ }
+ else
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Unknown option '%s' after \\%s command, expected 'width' or 'height'",
+ qPrint(g_token->name), Mappers::cmdMapper->find(cmd).data());
+ break;
+ }
}
+
tok=doctokenizerYYlex();
}
doctokenizerYYsetStatePara();
@@ -1921,6 +1931,7 @@ void DocInclude::parse()
readTextFileByName(m_file,m_text);
break;
case Snippet:
+ case SnipWithLines:
readTextFileByName(m_file,m_text);
// check here for the existence of the blockId inside the file, so we
// only generate the warning once.
@@ -1931,6 +1942,11 @@ void DocInclude::parse()
m_blockId.data(),m_file.data(),count);
}
break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
}
@@ -5132,7 +5148,6 @@ endref:
doctokenizerYYsetStatePara();
}
-
void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
{
DBG(("handleInclude(%s)\n",qPrint(cmdName)));
@@ -5160,7 +5175,7 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
}
QCString fileName = g_token->name;
QCString blockId;
- if (t==DocInclude::Snippet)
+ if (t==DocInclude::Snippet || t==DocInclude::SnipWithLines || t==DocInclude::SnippetDoc)
{
if (fileName == "this") fileName=g_fileName;
doctokenizerYYsetStateSnippet();
@@ -5174,9 +5189,31 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
}
blockId = "["+g_token->name+"]";
}
- DocInclude *inc = new DocInclude(this,fileName,g_context,t,g_isExample,g_exampleName,blockId);
- m_children.append(inc);
- inc->parse();
+
+ // This is the only place to handle the \includedoc and \snippetdoc commands,
+ // as the content is included here as if it is really here.
+ if (t==DocInclude::IncludeDoc || t==DocInclude::SnippetDoc)
+ {
+ QCString inc_text;
+ int inc_line = 1;
+ readTextFileByName(fileName,inc_text);
+ if (t==DocInclude::SnippetDoc)
+ {
+ inc_line = lineBlock(inc_text, blockId);
+ inc_text = extractBlock(inc_text, blockId);
+ }
+ docParserPushContext();
+ g_fileName = fileName;
+ doctokenizerYYlineno=inc_line;
+ internalValidatingParseDoc(this,m_children,inc_text);
+ docParserPopContext();
+ }
+ else
+ {
+ DocInclude *inc = new DocInclude(this,fileName,g_context,t,g_isExample,g_exampleName,blockId);
+ m_children.append(inc);
+ inc->parse();
+ }
}
void DocPara::handleSection(const QCString &cmdName)
@@ -5411,15 +5448,15 @@ int DocPara::handleCommand(const QCString &cmdName)
break;
case CMD_LI:
{
- DocSimpleList *sl=new DocSimpleList(this);
- m_children.append(sl);
+ DocSimpleList *sl=new DocSimpleList(this);
+ m_children.append(sl);
retval = sl->parse();
}
break;
case CMD_SECTION:
{
handleSection(cmdName);
- retval = RetVal_Section;
+ retval = RetVal_Section;
}
break;
case CMD_SUBSECTION:
@@ -5665,6 +5702,15 @@ int DocPara::handleCommand(const QCString &cmdName)
case CMD_SNIPPET:
handleInclude(cmdName,DocInclude::Snippet);
break;
+ case CMD_SNIPWITHLINES:
+ handleInclude(cmdName,DocInclude::SnipWithLines);
+ break;
+ case CMD_INCLUDEDOC:
+ handleInclude(cmdName,DocInclude::IncludeDoc);
+ break;
+ case CMD_SNIPPETDOC:
+ handleInclude(cmdName,DocInclude::SnippetDoc);
+ break;
case CMD_SKIP:
handleIncludeOperator(cmdName,DocIncOperator::Skip);
break;
@@ -6152,8 +6198,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
case XML_INHERITDOC:
handleInheritDoc();
break;
-
- default:
+ default:
// we should not get here!
ASSERT(0);
break;
diff --git a/src/docparser.h b/src/docparser.h
index e2751d8..f5167dc 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -483,7 +483,8 @@ class DocVerbatim : public DocNode
class DocInclude : public DocNode
{
public:
- enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude, IncWithLines, Snippet };
+ enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude,
+ IncWithLines, Snippet , IncludeDoc, SnippetDoc, SnipWithLines};
DocInclude(DocNode *parent,const QCString &file,
const QCString context, Type t,
bool isExample,const QCString exampleFile,
diff --git a/src/dot.cpp b/src/dot.cpp
index 8c33d18..4189748 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -2953,7 +2953,8 @@ DotClassGraph::DotClassGraph(ClassDef *cd,DotNode::GraphType t)
openNodeQueue.append(m_startNode);
determineTruncatedNodes(openNodeQueue,t==DotNode::Inheritance);
- m_diskName = cd->getFileBase().copy();
+ m_collabFileName = cd->collaborationGraphFileName();
+ m_inheritFileName = cd->inheritanceGraphFileName();
}
bool DotClassGraph::isTrivial() const
@@ -3071,27 +3072,6 @@ static bool updateDotGraph(DotNode *root,
return checkAndUpdateMd5Signature(baseName,md5); // graph needs to be regenerated
}
-QCString DotClassGraph::diskName() const
-{
- QCString result=m_diskName.copy();
- switch (m_graphType)
- {
- case DotNode::Collaboration:
- result+="_coll_graph";
- break;
- //case Interface:
- // result+="_intf_graph";
- // break;
- case DotNode::Inheritance:
- result+="_inherit_graph";
- break;
- default:
- ASSERT(0);
- break;
- }
- return result;
-}
-
QCString DotClassGraph::writeGraph(FTextStream &out,
GraphOutputFormat graphFormat,
EmbeddedOutputFormat textFormat,
@@ -3116,18 +3096,16 @@ QCString DotClassGraph::writeGraph(FTextStream &out,
{
case DotNode::Collaboration:
mapName="coll_map";
+ baseName=m_collabFileName;
break;
- //case Interface:
- // mapName="intf_map";
- // break;
case DotNode::Inheritance:
mapName="inherit_map";
+ baseName=m_inheritFileName;
break;
default:
ASSERT(0);
break;
}
- baseName = convertNameToFile(diskName());
// derive target file names from baseName
QCString imgExt = getDotImageExtension();
@@ -3425,8 +3403,9 @@ DotInclDepGraph::DotInclDepGraph(FileDef *fd,bool inverse)
{
m_inverse = inverse;
ASSERT(fd!=0);
- m_diskName = fd->getFileBase().copy();
- QCString tmp_url=fd->getReference()+"$"+fd->getFileBase();
+ m_inclDepFileName = fd->includeDependencyGraphFileName();
+ m_inclByDepFileName = fd->includedByDependencyGraphFileName();
+ QCString tmp_url=fd->getReference()+"$"+fd->getOutputFileBase();
m_startNode = new DotNode(m_curNodeNumber++,
fd->docName(),
"",
@@ -3458,14 +3437,6 @@ DotInclDepGraph::~DotInclDepGraph()
delete m_usedNodes;
}
-QCString DotInclDepGraph::diskName() const
-{
- QCString result=m_diskName.copy();
- if (m_inverse) result+="_dep";
- result+="_incl";
- return convertNameToFile(result);
-}
-
QCString DotInclDepGraph::writeGraph(FTextStream &out,
GraphOutputFormat graphFormat,
EmbeddedOutputFormat textFormat,
@@ -3484,10 +3455,15 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out,
}
static bool usePDFLatex = Config_getBool(USE_PDFLATEX);
- QCString baseName=m_diskName;
- if (m_inverse) baseName+="_dep";
- baseName+="_incl";
- baseName=convertNameToFile(baseName);
+ QCString baseName;
+ if (m_inverse)
+ {
+ baseName=m_inclByDepFileName;
+ }
+ else
+ {
+ baseName=m_inclDepFileName;
+ }
QCString mapName=escapeCharsInString(m_startNode->m_label,FALSE);
if (m_inverse) mapName+="dep";
diff --git a/src/dot.h b/src/dot.h
index cb2e83c..dce1a3a 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -180,7 +180,6 @@ class DotClassGraph
void writeXML(FTextStream &t);
void writeDocbook(FTextStream &t);
void writeDEF(FTextStream &t);
- QCString diskName() const;
static void resetNumbering();
private:
@@ -195,7 +194,8 @@ class DotClassGraph
QDict<DotNode> * m_usedNodes;
static int m_curNodeNumber;
DotNode::GraphType m_graphType;
- QCString m_diskName;
+ QCString m_collabFileName;
+ QCString m_inheritFileName;
bool m_lrRank;
};
@@ -223,7 +223,8 @@ class DotInclDepGraph
DotNode *m_startNode;
QDict<DotNode> *m_usedNodes;
static int m_curNodeNumber;
- QCString m_diskName;
+ QCString m_inclDepFileName;
+ QCString m_inclByDepFileName;
bool m_inverse;
};
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 12e2c5d..07214cb 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -2052,7 +2052,7 @@ static void findUsingDeclarations(EntryNav *rootNav)
// file scope).
QCString name = substitute(root->name,".","::"); //Java/C# scope->internal
- usingCd = getClass(name);
+ usingCd = getResolvedClass(nd,fd,name);
if (usingCd==0)
{
usingCd = Doxygen::hiddenClasses->find(name);
@@ -2654,7 +2654,10 @@ static MemberDef *addVariableToFile(
*/
static int findFunctionPtr(const QCString &type,int lang, int *pLength=0)
{
- if (lang == SrcLangExt_Fortran) return -1; // Fortran does not have function pointers
+ if (lang == SrcLangExt_Fortran || lang == SrcLangExt_VHDL)
+ {
+ return -1; // Fortran and VHDL do not have function pointers
+ }
static const QRegExp re("([^)]*[\\*\\^][^)]*)");
int i=-1,l;
int bb=type.find('<');
@@ -9255,7 +9258,7 @@ static void copyStyleSheet()
}
}
-static void copyLogo()
+static void copyLogo(const QCString &outputOption)
{
QCString &projectLogo = Config_getString(PROJECT_LOGO);
if (!projectLogo.isEmpty())
@@ -9268,7 +9271,7 @@ static void copyLogo()
}
else
{
- QCString destFileName = Config_getString(HTML_OUTPUT)+"/"+fi.fileName().data();
+ QCString destFileName = outputOption+"/"+fi.fileName().data();
copyFile(projectLogo,destFileName);
Doxygen::indexList->addImageFile(fi.fileName().data());
}
@@ -9984,6 +9987,8 @@ void initDoxygen()
setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
setlocale(LC_NUMERIC,"C");
+ portable_correct_path();
+
Doxygen::runningTime.start();
initPreprocessor();
@@ -10064,7 +10069,6 @@ void initDoxygen()
g_compoundKeywordDict.insert("union",(void *)8);
g_compoundKeywordDict.insert("interface",(void *)8);
g_compoundKeywordDict.insert("exception",(void *)8);
-
}
void cleanUpDoxygen()
@@ -10255,21 +10259,17 @@ void readConfiguration(int argc, char **argv)
}
else if (qstricmp(formatName,"html")==0)
{
+ Config::init();
if (optind+4<argc || QFileInfo("Doxyfile").exists())
+ // explicit config file mentioned or default found on disk
{
QCString df = optind+4<argc ? argv[optind+4] : QCString("Doxyfile");
- if (!Config::parse(df))
+ if (!Config::parse(df)) // parse the config file
{
err("error opening or reading configuration file %s!\n",argv[optind+4]);
cleanUpDoxygen();
exit(1);
}
- Config::postProcess(TRUE);
- Config::checkAndCorrect();
- }
- else
- {
- Config::init();
}
if (optind+3>=argc)
{
@@ -10277,6 +10277,8 @@ void readConfiguration(int argc, char **argv)
cleanUpDoxygen();
exit(1);
}
+ Config::postProcess(TRUE);
+ Config::checkAndCorrect();
QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE);
if (!setTranslator(outputLanguage))
@@ -10304,6 +10306,7 @@ void readConfiguration(int argc, char **argv)
}
else if (qstricmp(formatName,"latex")==0)
{
+ Config::init();
if (optind+4<argc || QFileInfo("Doxyfile").exists())
{
QCString df = optind+4<argc ? argv[optind+4] : QCString("Doxyfile");
@@ -10313,12 +10316,6 @@ void readConfiguration(int argc, char **argv)
cleanUpDoxygen();
exit(1);
}
- Config::postProcess(TRUE);
- Config::checkAndCorrect();
- }
- else // use default config
- {
- Config::init();
}
if (optind+3>=argc)
{
@@ -10326,6 +10323,8 @@ void readConfiguration(int argc, char **argv)
cleanUpDoxygen();
exit(1);
}
+ Config::postProcess(TRUE);
+ Config::checkAndCorrect();
QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE);
if (!setTranslator(outputLanguage))
@@ -10414,6 +10413,13 @@ void readConfiguration(int argc, char **argv)
Config::init();
+ if (genConfig && g_useOutputTemplate)
+ {
+ generateTemplateFiles("templates");
+ cleanUpDoxygen();
+ exit(0);
+ }
+
if (genConfig)
{
generateConfigFile(configName,shortList);
@@ -11657,14 +11663,19 @@ void generateOutput()
{
FTVHelp::generateTreeViewImages();
copyStyleSheet();
- copyLogo();
+ copyLogo(Config_getString(HTML_OUTPUT));
copyExtraFiles(Config_getList(HTML_EXTRA_FILES),"HTML_EXTRA_FILES",Config_getString(HTML_OUTPUT));
}
if (generateLatex)
{
copyLatexStyleSheet();
+ copyLogo(Config_getString(LATEX_OUTPUT));
copyExtraFiles(Config_getList(LATEX_EXTRA_FILES),"LATEX_EXTRA_FILES",Config_getString(LATEX_OUTPUT));
}
+ if (generateRtf)
+ {
+ copyLogo(Config_getString(RTF_OUTPUT));
+ }
if (generateHtml &&
Config_getBool(GENERATE_HTMLHELP) &&
@@ -11674,7 +11685,7 @@ void generateOutput()
QString oldDir = QDir::currentDirPath();
QDir::setCurrent(Config_getString(HTML_OUTPUT));
portable_sysTimerStart();
- if (portable_system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd)))
+ if (portable_system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1)
{
err("failed to run html help compiler on index.hhp\n");
}
diff --git a/src/filedef.cpp b/src/filedef.cpp
index d5f736d..0a1e6e2 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -82,8 +82,7 @@ FileDef::FileDef(const char *p,const char *nm,
m_path=p;
m_filePath=m_path+nm;
m_fileName=nm;
- m_diskName=dn;
- if (m_diskName.isEmpty()) m_diskName=nm;
+ setDiskName(dn?dn:nm);
setReference(lref);
m_classSDict = 0;
m_includeList = 0;
@@ -125,6 +124,13 @@ FileDef::~FileDef()
delete m_memberGroupSDict;
}
+void FileDef::setDiskName(const QCString &name)
+{
+ m_outputDiskName = convertNameToFile(name);
+ m_inclDepFileName = convertNameToFile(name+"_incl");
+ m_inclByDepFileName = convertNameToFile(name+"_dep_incl");
+}
+
/*! Compute the HTML anchor names for all members in the class */
void FileDef::computeAnchors()
{
@@ -1769,17 +1775,22 @@ void FileDef::acquireFileVersion()
QCString FileDef::getSourceFileBase() const
-{
+{
if (Htags::useHtags)
{
return Htags::path2URL(m_filePath);
}
else
{
- return convertNameToFile(m_diskName)+"_source";
+ return m_outputDiskName+"_source";
}
}
+QCString FileDef::getOutputFileBase() const
+{
+ return m_outputDiskName;
+}
+
/*! Returns the name of the verbatim copy of this file (if any). */
QCString FileDef::includeName() const
{
@@ -1877,7 +1888,7 @@ void FileDef::writeMemberDocumentation(OutputList &ol,MemberListType lt,const QC
bool FileDef::isLinkableInProject() const
{
static bool showFiles = Config_getBool(SHOW_FILES);
- return hasDocumentation() && !isReference() && showFiles;
+ return hasDocumentation() && !isReference() && (showFiles || isLinkableViaGroup());
}
static void getAllIncludeFilesRecursively(
@@ -1916,3 +1927,14 @@ QCString FileDef::fileVersion() const
{
return m_fileVersion;
}
+
+QCString FileDef::includeDependencyGraphFileName() const
+{
+ return m_inclDepFileName;
+}
+
+QCString FileDef::includedByDependencyGraphFileName() const
+{
+ return m_inclByDepFileName;
+}
+
diff --git a/src/filedef.h b/src/filedef.h
index 712128c..9167249 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -63,8 +63,6 @@ struct IncludeInfo
*/
class FileDef : public Definition
{
- friend class FileName;
-
public:
//enum FileType { Source, Header, Unknown };
@@ -80,17 +78,18 @@ class FileDef : public Definition
QCString displayName(bool=TRUE) const { return name(); }
QCString fileName() const { return m_fileName; }
- QCString getOutputFileBase() const
- { return convertNameToFile(m_diskName); }
+ QCString getOutputFileBase() const;
QCString anchor() const { return QCString(); }
- QCString getFileBase() const { return m_diskName; }
-
QCString getSourceFileBase() const;
/*! Returns the name of the verbatim copy of this file (if any). */
QCString includeName() const;
+
+ QCString includeDependencyGraphFileName() const;
+
+ QCString includedByDependencyGraphFileName() const;
/*! Returns the absolute path including the file name. */
QCString absFilePath() const { return m_filePath; }
@@ -153,8 +152,8 @@ class FileDef : public Definition
void writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu);
void parseSource(bool sameTu,QStrList &filesInSameTu);
void finishParsing();
+ void setDiskName(const QCString &name);
- friend void generatedFileNames();
void insertMember(MemberDef *md);
void insertClass(ClassDef *cd);
void insertNamespace(NamespaceDef *nd);
@@ -219,7 +218,9 @@ class FileDef : public Definition
SDict<Definition> *m_usingDeclList;
QCString m_path;
QCString m_filePath;
- QCString m_diskName;
+ QCString m_inclDepFileName;
+ QCString m_inclByDepFileName;
+ QCString m_outputDiskName;
QCString m_fileName;
QCString m_docname;
QIntDict<Definition> *m_srcDefDict;
diff --git a/src/filename.cpp b/src/filename.cpp
index dfa763c..ae3b596 100644
--- a/src/filename.cpp
+++ b/src/filename.cpp
@@ -49,7 +49,7 @@ void FileName::generateDiskNames()
{
// name if unique, so diskname is simply the name
//printf("!!!!!!!! Unique disk name=%s for fd=%s\n",name.data(),fd->diskname.data());
- fd->m_diskName=name;
+ fd->setDiskName(name);
}
}
else if (count>1) // multiple occurrences of the same file name
@@ -62,21 +62,22 @@ void FileName::generateDiskNames()
for (it.toFirst();(fd=it.current()) && fd->isReference();++it) { }
if (fd)
{
- char c=fd->m_path.at(i);
+ char c=fd->getPath().at(i);
if (c=='/') j=i; // remember last position of dirname
++it;
while ((fd=it.current()) && !found)
{
+ QCString path = fd->getPath();
if (!fd->isReference())
{
//printf("i=%d j=%d fd->path=`%s' fd->name=`%s'\n",i,j,fd->path.left(i).data(),fd->name().data());
- if (i==(int)fd->m_path.length())
+ if (i==(int)path.length())
{
//warning("Input file %s found multiple times!\n"
// " The generated documentation for this file may not be correct!\n",fd->absFilePath().data());
found=TRUE;
}
- else if (fd->m_path[i]!=c)
+ else if (path[i]!=c)
{
found=TRUE;
}
@@ -91,10 +92,11 @@ void FileName::generateDiskNames()
//printf("fd->setName(%s)\n",(fd->path.right(fd->path.length()-j-1)+name).data());
if (!fd->isReference())
{
- QCString prefix = fd->m_path.right(fd->m_path.length()-j-1);
+ QCString path = fd->getPath();
+ QCString prefix = path.right(path.length()-j-1);
fd->setName(prefix+name);
- //printf("!!!!!!!! non unique disk name=%s for fd=%s\n",(prefix+name).data(),fd->diskname.data());
- fd->m_diskName=prefix+name;
+ //printf("!!!!!!!! non unique disk name=%s:%s\n",prefix.data(),name.data());
+ fd->setDiskName(prefix+name);
}
}
}
diff --git a/src/fileparser.cpp b/src/fileparser.cpp
index b54b243..6883622 100644
--- a/src/fileparser.cpp
+++ b/src/fileparser.cpp
@@ -22,7 +22,7 @@ void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
SrcLangExt, // lang
bool, // isExampleBlock
const char *, // exampleName
- FileDef *, // fileDef
+ FileDef * fileDef,
int startLine,
int endLine,
bool, // inlineFragment
@@ -40,8 +40,8 @@ void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
int j=i;
while (j<length && input[j]!='\n') j++;
QCString lineStr = input.mid(i,j-i);
- codeOutIntf.startCodeLine(showLineNumbers);
- if (showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
+ codeOutIntf.startCodeLine(fileDef != 0 && showLineNumbers);
+ if (fileDef != 0 && showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr);
codeOutIntf.endCodeLine();
lineNr++;
diff --git a/src/formula.cpp b/src/formula.cpp
index a4415a9..6fe617d 100644
--- a/src/formula.cpp
+++ b/src/formula.cpp
@@ -70,12 +70,7 @@ void FormulaList::generateBitmaps(const char *path)
if (Config_getBool(LATEX_BATCHMODE)) t << "\\batchmode" << endl;
t << "\\documentclass{article}" << endl;
t << "\\usepackage{epsfig}" << endl; // for those who want to include images
- const char *s=Config_getList(EXTRA_PACKAGES).first();
- while (s)
- {
- t << "\\usepackage{" << s << "}\n";
- s=Config_getList(EXTRA_PACKAGES).next();
- }
+ writeExtraLatexPackages(t);
t << "\\pagestyle{empty}" << endl;
t << "\\begin{document}" << endl;
int page=0;
diff --git a/src/fortrancode.l b/src/fortrancode.l
index b6e9d67..6abb676 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -484,7 +484,7 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam
if (mn) // name is known
{
- MemberListIterator mli(*mn);
+ MemberNameIterator mli(*mn);
for (mli.toFirst();(md=mli.current());++mli) // all found functions with given name
{
FileDef *fd=md->getFileDef();
@@ -925,7 +925,12 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
startScope();
generateLink(*g_code,yytext);
}
-<Subprog>"(".* { // ignore rest of line
+<Subprog>"result"/{BS}"("[^)]*")" {
+ startFontClass("keyword");
+ codifyLines(yytext);
+ endFontClass();
+ }
+<Subprog>"("[^)]*")" { // ignore rest of line
codifyLines(yytext);
}
<Subprog,Subprogend>"\n" { codifyLines(yytext);
@@ -1123,6 +1128,16 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
codifyLines(yytext);
endFontClass();
}
+<*>"assignment"/{BS}"("{BS}"="{BS}")" {
+ startFontClass("keyword");
+ codifyLines(yytext);
+ endFontClass();
+ }
+<*>"operator"/{BS}"("[^)]*")" {
+ startFontClass("keyword");
+ codifyLines(yytext);
+ endFontClass();
+ }
/*------ preprocessor --------------------------------------------*/
<Start>"#".*\n {
@@ -1248,16 +1263,17 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
g_needsTermination = FALSE;
g_searchCtx = searchCtx;
g_collectXRefs = collectXRefs;
- if (endLine!=-1)
- g_inputLines = endLine+1;
- else
- g_inputLines = countLines();
-
if (startLine!=-1)
g_yyLineNr = startLine;
else
g_yyLineNr = 1;
+ if (endLine!=-1)
+ g_inputLines = endLine+1;
+ else
+ g_inputLines = g_yyLineNr + countLines() - 1;
+
+
g_exampleBlock = exBlock;
g_exampleName = exName;
g_sourceFileDef = fd;
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index ad4a63f..0b59eb7 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -322,6 +322,12 @@ SCOPENAME ({ID}{BS}"::"{BS})*
/*-----------------------------------------------------------------------------------*/
+<Prepass>^{BS}[&]*{BS}!.*\n { /* skip lines with just comment. Note code was in free format or has been converted to it */
+ lineCountPrepass ++;
+ }
+<Prepass>^{BS}\n { /* skip empty lines */
+ lineCountPrepass ++;
+ }
<*>^.*\n { // prepass: look for line continuations
functionLine = FALSE;
@@ -1422,6 +1428,7 @@ static const char* prepassFixedForm(const char* contents)
bool inSingle=FALSE;
bool inDouble=FALSE;
bool inBackslash=FALSE;
+ bool fullCommentLine=TRUE;
int newContentsSize = strlen(contents)+3; // \000, \n (when necessary) and one spare character (to avoid reallocation)
char* newContents = (char*)malloc(newContentsSize);
@@ -1435,8 +1442,17 @@ static const char* prepassFixedForm(const char* contents)
char c = contents[i];
switch(c) {
case '\n':
- prevLineLength=column;
- prevLineAmpOrExclIndex=getAmpOrExclAtTheEnd(&contents[i-prevLineLength+1], prevLineLength,prevQuote);
+ if (!fullCommentLine)
+ {
+ prevLineLength=column;
+ prevLineAmpOrExclIndex=getAmpOrExclAtTheEnd(&contents[i-prevLineLength+1], prevLineLength,prevQuote);
+ if (prevLineAmpOrExclIndex == -1) prevLineAmpOrExclIndex = column - 1;
+ }
+ else
+ {
+ prevLineLength+=column;
+ }
+ fullCommentLine=TRUE;
column=0;
emptyLabel=TRUE;
commented=FALSE;
@@ -1463,7 +1479,8 @@ static const char* prepassFixedForm(const char* contents)
case '\\':
if ((column <= fixedCommentAfter) && (column!=6) && !commented)
{
- // we have some special cases in respect to strings and exscaped string characters
+ // we have some special cases in respect to strings and escaped string characters
+ fullCommentLine=FALSE;
newContents[j]=c;
if (c == '\\')
{
@@ -1512,6 +1529,7 @@ static const char* prepassFixedForm(const char* contents)
}
else
{
+ if (!commented) fullCommentLine=FALSE;
newContents[j]=c;
}
break;
@@ -1519,6 +1537,7 @@ static const char* prepassFixedForm(const char* contents)
// fallthrough
default:
if(column==6 && emptyLabel) { // continuation
+ if (!commented) fullCommentLine=FALSE;
if (c != '0') { // 0 not allowed as continuation character, see f95 standard paragraph 3.3.2.3
newContents[j]=' ';
@@ -1532,6 +1551,7 @@ static const char* prepassFixedForm(const char* contents)
} else {
newContents[j]=c; // , just handle like space
}
+ prevLineLength=0;
} else if ((column > fixedCommentAfter) && !commented) {
// first non commented non blank character after position fixedCommentAfter
if (c != '!') {
@@ -1542,6 +1562,7 @@ static const char* prepassFixedForm(const char* contents)
newContents[j]=c;
commented = TRUE;
} else {
+ if (!commented) fullCommentLine=FALSE;
newContents[j]=c;
emptyLabel=FALSE;
}
@@ -2491,7 +2512,11 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra
//printf("---strlen=%d\n", strlen(fileBuf));
//clock_t start=clock();
+ //printf("Input fixed form string:\n%s\n", fileBuf);
+ //printf("===========================\n");
inputString = prepassFixedForm(fileBuf);
+ //printf("Resulting free form string:\n%s\n", inputString);
+ //printf("===========================\n");
//clock_t end=clock();
//printf("CPU time used=%f\n", ((double) (end-start))/CLOCKS_PER_SEC);
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index 3ec1b88..7249574 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -694,8 +694,6 @@ void FTVHelp::generateTreeViewImages()
rm.copyResource("doc.luma",dname);
rm.copyResource("folderopen.luma",dname);
rm.copyResource("folderclosed.luma",dname);
- rm.copyResource("arrowdown.luma",dname);
- rm.copyResource("arrowright.luma",dname);
rm.copyResource("splitbar.lum",dname);
}
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index 48acb68..6b6d659 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -61,7 +61,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t,
}
else
{
- fileName = (QCString)"group_"+na;
+ fileName = convertNameToFile(QCString("group_")+na);
}
setGroupTitle( t );
memberGroupSDict = new MemberGroupSDict;
@@ -1509,16 +1509,9 @@ void addExampleToGroups(Entry *root,PageDef *eg)
}
}
-QCString GroupDef::getOutputFileBase() const
-{
- if (isReference())
- {
- return fileName;
- }
- else
- {
- return convertNameToFile(fileName);
- }
+QCString GroupDef::getOutputFileBase() const
+{
+ return fileName;
}
void GroupDef::addListReferences()
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index f4e2ce4..a42a8ec 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -50,7 +50,7 @@ static QCString convertIndexWordToAnchor(const QString &word)
while ((c = *str++))
{
if ((c >= 'a' && c <= 'z') || // ALPHA
- (c >= 'A' && c <= 'A') || // ALPHA
+ (c >= 'A' && c <= 'Z') || // ALPHA
(c >= '0' && c <= '9') || // DIGIT
c == '-' ||
c == '.' ||
@@ -578,6 +578,31 @@ void HtmlDocVisitor::visit(DocInclude *inc)
-1, // endLine
TRUE, // inlineFragment
0, // memberDef
+ FALSE, // show line number
+ m_ctx // search context
+ );
+ m_t << PREFRAG_END;
+ forceStartParagraph(inc);
+ }
+ break;
+ case DocInclude::SnipWithLines:
+ {
+ forceEndParagraph(inc);
+ m_t << PREFRAG_START;
+ QFileInfo cfi( inc->file() );
+ FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ Doxygen::parserManager->getParser(inc->extension())
+ ->parseCode(m_ci,
+ inc->context(),
+ extractBlock(inc->text(),inc->blockId()),
+ langExt,
+ inc->isExample(),
+ inc->exampleFile(),
+ &fd,
+ lineBlock(inc->text(),inc->blockId()),
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
TRUE, // show line number
m_ctx // search context
);
@@ -585,6 +610,11 @@ void HtmlDocVisitor::visit(DocInclude *inc)
forceStartParagraph(inc);
}
break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
}
@@ -1312,7 +1342,7 @@ void HtmlDocVisitor::visitPre(DocHtmlTable *t)
}
else
{
- m_t << "<table " << htmlAttribsToString(t->attribs()) << ">\n";
+ m_t << "<table" << htmlAttribsToString(t->attribs()) << ">\n";
}
}
@@ -1429,17 +1459,43 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
m_t << "<div class=\"image\">" << endl;
QCString url = img->url();
+ QCString sizeAttribs;
+ if (!img->width().isEmpty())
+ {
+ sizeAttribs+=" width=\""+img->width()+"\"";
+ }
+ if (!img->height().isEmpty())
+ {
+ sizeAttribs+=" height=\""+img->height()+"\"";
+ }
if (url.isEmpty())
{
- m_t << "<img src=\"" << img->relPath() << img->name() << "\" alt=\""
- << baseName << "\"" << htmlAttribsToString(img->attribs())
- << "/>" << endl;
+ if (img->name().right(4)==".svg")
+ {
+ m_t << "<object type=\"image/svg+xml\" data=\"" << img->relPath() << img->name()
+ << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << ">" << baseName
+ << "</object>" << endl;
+ }
+ else
+ {
+ m_t << "<img src=\"" << img->relPath() << img->name() << "\" alt=\""
+ << baseName << "\"" << sizeAttribs << htmlAttribsToString(img->attribs())
+ << "/>" << endl;
+ }
}
else
{
- m_t << "<img src=\"" << correctURL(url,img->relPath()) << "\" "
- << htmlAttribsToString(img->attribs())
- << "/>" << endl;
+ if (url.right(4)==".svg")
+ {
+ m_t << "<object type=\"image/svg+xml\" data=\"" << correctURL(url,img->relPath())
+ << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << "></object>" << endl;
+ }
+ else
+ {
+ m_t << "<img src=\"" << correctURL(url,img->relPath()) << "\""
+ << sizeAttribs << htmlAttribsToString(img->attribs())
+ << "/>" << endl;
+ }
}
if (img->hasCaption())
{
@@ -1810,7 +1866,7 @@ void HtmlDocVisitor::visitPre(DocHtmlBlockQuote *b)
}
else
{
- m_t << "<blockquote " << htmlAttribsToString(b->attribs()) << ">\n";
+ m_t << "<blockquote" << htmlAttribsToString(b->attribs()) << ">\n";
}
}
diff --git a/src/htmlentity.cpp b/src/htmlentity.cpp
index ff3c574..668c224 100644
--- a/src/htmlentity.cpp
+++ b/src/htmlentity.cpp
@@ -199,7 +199,7 @@ static struct htmlEntityInfo
{ SYM(oline), "\xe2\x80\xbe", "&oline;", "<oline/>", "&#8254;", "{$\\overline{\\,}$}", NULL, "\\u8254?", { NULL, DocSymbol::Perl_unknown }},
{ SYM(frasl), "\xe2\x81\x84", "&frasl;", "<frasl/>", "&#8260;", "/", NULL, "\\u8260?", { NULL, DocSymbol::Perl_unknown }},
{ SYM(weierp), "\xe2\x84\x98", "&weierp;", "<weierp/>", "&#8472;", "{$\\wp$}", NULL, "\\u8472?", { NULL, DocSymbol::Perl_unknown }},
- { SYM(image), "\xe2\x84\x91", "&image;", "<image/>", "&#8465;", "{$\\Im$}", NULL, "\\u8465?", { NULL, DocSymbol::Perl_unknown }},
+ { SYM(image), "\xe2\x84\x91", "&image;", "<imaginary/>", "&#8465;", "{$\\Im$}", NULL, "\\u8465?", { NULL, DocSymbol::Perl_unknown }},
{ SYM(real), "\xe2\x84\x9c", "&real;", "<real/>", "&#8476;", "{$\\Re$}", NULL, "\\u8476?", { NULL, DocSymbol::Perl_unknown }},
{ SYM(trade), "\xe2\x84\xa2", "&trade;", "<trademark/>", "&#8482;", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }},
{ SYM(alefsym), "\xe2\x85\xb5", "&alefsym;", "<alefsym/>", "&#8501;", "{$\\aleph$}", NULL, "\\u8501?", { NULL, DocSymbol::Perl_unknown }},
@@ -297,7 +297,7 @@ static struct htmlEntityInfo
{ SYM(euro), "\xe2\x82\xac", "&euro;", "<euro/>", "&#8364;", "\\texteuro{}", NULL, "\\'80", { NULL, DocSymbol::Perl_unknown }},
// doxygen extension to the HTML4 table of HTML entities
- { SYM(tm), "\xe2\x84\xa2", "&trade;", "<trademark/>", "&#8482;", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }},
+ { SYM(tm), "\xe2\x84\xa2", "&trade;", "<tm/>", "&#8482;", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }},
{ SYM(apos), "'", "'", "'", "&apos;", "\\textquotesingle{}", "'", "'", { "\\\'", DocSymbol::Perl_string }},
// doxygen commands represented as HTML entities
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index 239a9fe..24af9fc 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -52,6 +52,8 @@ static QCString g_footer;
static QCString g_mathjax_code;
+// note: this is only active if DISABLE_INDEX=YES, if DISABLE_INDEX is disabled, this
+// part will be rendered inside menu.js
static void writeClientSearchBox(FTextStream &t,const char *relPath)
{
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
@@ -72,6 +74,8 @@ static void writeClientSearchBox(FTextStream &t,const char *relPath)
t << " </div>\n";
}
+// note: this is only active if DISABLE_INDEX=YES. if DISABLE_INDEX is disabled, this
+// part will be rendered inside menu.js
static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlightSearch)
{
static bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
@@ -292,7 +296,6 @@ static QCString substituteHtmlKeywords(const QCString &s,
"<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n"
"<script type=\"text/javascript\">\n"
" $(document).ready(initResizable);\n"
- " $(window).load(resizeHeight);\n"
"</script>";
}
@@ -305,19 +308,25 @@ static QCString substituteHtmlKeywords(const QCString &s,
}
searchCssJs += "<script type=\"text/javascript\" src=\"$relpath^search/search.js\"></script>\n";
- if (!serverBasedSearch)
+ if (!serverBasedSearch)
{
- searchCssJs += "<script type=\"text/javascript\">\n"
- " $(document).ready(function() { init_search(); });\n"
- "</script>";
+ if (disableIndex)
+ {
+ searchCssJs += "<script type=\"text/javascript\">\n"
+ " $(document).ready(function() { init_search(); });\n"
+ "</script>";
+ }
}
- else
+ else
{
- searchCssJs += "<script type=\"text/javascript\">\n"
- " $(document).ready(function() {\n"
- " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n"
- " });\n"
- "</script>\n";
+ if (disableIndex)
+ {
+ searchCssJs += "<script type=\"text/javascript\">\n"
+ " $(document).ready(function() {\n"
+ " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n"
+ " });\n"
+ "</script>\n";
+ }
// OPENSEARCH_PROVIDER {
searchCssJs += "<link rel=\"search\" href=\"" + relPath +
@@ -727,6 +736,10 @@ void HtmlGenerator::init()
{
mgr.copyResource("svgpan.js",dname);
}
+ if (!Config_getBool(DISABLE_INDEX))
+ {
+ mgr.copyResource("menu.js",dname);
+ }
{
QFile f(dname+"/dynsections.js");
@@ -808,13 +821,16 @@ void HtmlGenerator::writeSearchData(const char *dir)
if (f.open(IO_WriteOnly))
{
FTextStream t(&f);
- QCString searchCss = replaceColorMarkers(mgr.getAsString("search.css"));
- searchCss = substitute(searchCss,"$doxygenversion",versionString);
+ QCString searchCss;
if (Config_getBool(DISABLE_INDEX))
{
- // move up the search box if there are no tabs
- searchCss = substitute(searchCss,"margin-top: 8px;","margin-top: 0px;");
+ searchCss = mgr.getAsString("search_nomenu.css");
}
+ else
+ {
+ searchCss = mgr.getAsString("search.css");
+ }
+ searchCss = substitute(replaceColorMarkers(searchCss),"$doxygenversion",versionString);
t << searchCss;
Doxygen::indexList->addStyleSheetFile("search/search.css");
}
@@ -1017,7 +1033,7 @@ void HtmlGenerator::startDoxyAnchor(const char *,const char *,
const char *anchor, const char *,
const char *)
{
- t << "<a class=\"anchor\" id=\"" << anchor << "\"></a>";
+ t << "<a id=\"" << anchor << "\"></a>";
}
void HtmlGenerator::endDoxyAnchor(const char *,const char *)
@@ -1193,7 +1209,7 @@ void HtmlGenerator::startSection(const char *lab,const char *,SectionInfo::Secti
case SectionInfo::Paragraph: t << "\n\n<h5>"; break;
default: ASSERT(0); break;
}
- t << "<a class=\"anchor\" id=\"" << lab << "\"></a>";
+ t << "<a id=\"" << lab << "\"></a>";
}
void HtmlGenerator::endSection(const char *,SectionInfo::SectionType type)
@@ -1539,10 +1555,20 @@ void HtmlGenerator::endMemberDocList()
DBG_HTML(t << "<!-- endMemberDocList -->" << endl;)
}
-void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const char *,bool)
-{
+void HtmlGenerator::startMemberDoc( const char *clName, const char *memName,
+ const char *anchor, const char *title,
+ int memCount, int memTotal, bool showInline)
+{
DBG_HTML(t << "<!-- startMemberDoc -->" << endl;)
-
+ t << "\n<h2 class=\"memtitle\">"
+ << "<span class=\"permalink\"><a href=\"#" << anchor << "\">&sect;&nbsp;</a></span>"
+ << title;
+ if (memTotal>1)
+ {
+ t << " <span class=\"overload\">[" << memCount << "/" << memTotal <<"]</span>";
+ }
+ t << "</h2>"
+ << endl;
t << "\n<div class=\"memitem\">" << endl;
t << "<div class=\"memproto\">" << endl;
}
@@ -1837,6 +1863,46 @@ void HtmlGenerator::writeNonBreakableSpace(int n)
}
}
+void HtmlGenerator::startDescTable(const char *title)
+{
+ t << "<table class=\"fieldtable\">" << endl
+ << "<tr><th colspan=\"2\">" << title << "</th></tr>";
+}
+void HtmlGenerator::endDescTable()
+{
+ t << "</table>" << endl;
+}
+
+void HtmlGenerator::startDescTableRow()
+{
+ t << "<tr>";
+}
+
+void HtmlGenerator::endDescTableRow()
+{
+ t << "</tr>" << endl;
+}
+
+void HtmlGenerator::startDescTableTitle()
+{
+ t << "<td class=\"fieldname\">";
+}
+
+void HtmlGenerator::endDescTableTitle()
+{
+ t << "&#160;</td>";
+}
+
+void HtmlGenerator::startDescTableData()
+{
+ t << "<td class=\"fielddoc\">";
+}
+
+void HtmlGenerator::endDescTableData()
+{
+ t << "</td>";
+}
+
void HtmlGenerator::startSimpleSect(SectionTypes,
const char *filename,const char *anchor,
const char *title)
@@ -2070,59 +2136,47 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
const char *file,
const QCString &relPath)
{
+ static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
+ static bool searchEngine = Config_getBool(SEARCHENGINE);
+ static bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
LayoutNavEntry *root = LayoutDocManager::instance().rootNavEntry();
- LayoutNavEntry::Kind kind = (LayoutNavEntry::Kind)-1;
- LayoutNavEntry::Kind altKind = (LayoutNavEntry::Kind)-1; // fall back for the old layout file
- bool highlightParent=FALSE;
- switch (hli) // map HLI enums to LayoutNavEntry::Kind enums
- {
- case HLI_Main: kind = LayoutNavEntry::MainPage; break;
- case HLI_Modules: kind = LayoutNavEntry::Modules; break;
- //case HLI_Directories: kind = LayoutNavEntry::Dirs; break;
- case HLI_Namespaces: kind = LayoutNavEntry::NamespaceList; altKind = LayoutNavEntry::Namespaces; break;
- case HLI_Hierarchy: kind = LayoutNavEntry::ClassHierarchy; break;
- case HLI_Classes: kind = LayoutNavEntry::ClassIndex; altKind = LayoutNavEntry::Classes; break;
- case HLI_Annotated: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes; break;
- case HLI_Files: kind = LayoutNavEntry::FileList; altKind = LayoutNavEntry::Files; break;
- case HLI_NamespaceMembers: kind = LayoutNavEntry::NamespaceMembers; break;
- case HLI_Functions: kind = LayoutNavEntry::ClassMembers; break;
- case HLI_Globals: kind = LayoutNavEntry::FileGlobals; break;
- case HLI_Pages: kind = LayoutNavEntry::Pages; break;
- case HLI_Examples: kind = LayoutNavEntry::Examples; break;
- case HLI_UserGroup: kind = LayoutNavEntry::UserGroup; break;
- case HLI_ClassVisible: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes;
- highlightParent = TRUE; break;
- case HLI_NamespaceVisible: kind = LayoutNavEntry::NamespaceList; altKind = LayoutNavEntry::Namespaces;
- highlightParent = TRUE; break;
- case HLI_FileVisible: kind = LayoutNavEntry::FileList; altKind = LayoutNavEntry::Files;
- highlightParent = TRUE; break;
- case HLI_None: break;
- case HLI_Search: break;
- }
-
+
if (compact)
{
- // find highlighted index item
- LayoutNavEntry *hlEntry = root->find(kind,kind==LayoutNavEntry::UserGroup ? file : 0);
- if (!hlEntry && altKind!=(LayoutNavEntry::Kind)-1) { hlEntry=root->find(altKind); kind=altKind; }
- if (!hlEntry) // highlighted item not found in the index! -> just show the level 1 index...
+ QCString searchPage;
+ if (externalSearch)
{
- highlightParent=TRUE;
- hlEntry = root->children().getFirst();
- if (hlEntry==0)
- {
- return; // argl, empty index!
- }
+ searchPage = "search" + Doxygen::htmlFileExtension;
+ }
+ else
+ {
+ searchPage = "search.php";
}
- if (kind==LayoutNavEntry::UserGroup)
+ t << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>" << endl;
+ t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>" << endl;
+ t << "<script type=\"text/javascript\">" << endl;
+ t << "$(function() {" << endl;
+ t << " initMenu('" << relPath << "',"
+ << (searchEngine?"true":"false") << ","
+ << (serverBasedSearch?"true":"false") << ",'"
+ << searchPage << "','"
+ << theTranslator->trSearch() << "');" << endl;
+ if (Config_getBool(SEARCHENGINE))
{
- LayoutNavEntry *e = hlEntry->children().getFirst();
- if (e)
+ if (!serverBasedSearch)
+ {
+ t << " $(document).ready(function() { init_search(); });\n";
+ }
+ else
{
- hlEntry = e;
+ t << " $(document).ready(function() {\n"
+ << " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n"
+ << " });\n";
}
}
- renderQuickLinksAsTabs(t,relPath,hlEntry,kind,highlightParent,hli==HLI_Search);
+ t << "});" << endl;
+ t << "</script>" << endl;
+ t << "<div id=\"main-nav\"></div>" << endl;
}
else
{
@@ -2258,9 +2312,7 @@ void HtmlGenerator::writeSearchPage()
// Write empty navigation path, to make footer connect properly
if (generateTreeView)
{
- t << "</div><!-- doc-contents -->\n";
- //t << "<div id=\"nav-path\" class=\"navpath\">\n";
- //t << " <ul>\n";
+ t << "</div><!-- doc-content -->\n";
}
writePageFooter(t,"Search","","");
@@ -2281,6 +2333,7 @@ void HtmlGenerator::writeSearchPage()
void HtmlGenerator::writeExternalSearchPage()
{
static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
+ static bool disableIndex = Config_getBool(DISABLE_INDEX);
QCString fileName = Config_getString(HTML_OUTPUT)+"/search"+Doxygen::htmlFileExtension;
QFile f(fileName);
if (f.open(IO_WriteOnly))
@@ -2323,10 +2376,11 @@ void HtmlGenerator::writeExternalSearchPage()
if (generateTreeView)
{
- t << "</div><!-- doc-contents -->" << endl;
+ t << "</div><!-- doc-content -->" << endl;
}
writePageFooter(t,"Search","","");
+
}
QCString scriptName = Config_getString(HTML_OUTPUT)+"/search/search.js";
QFile sf(scriptName);
@@ -2474,14 +2528,16 @@ void HtmlGenerator::endInlineHeader()
t << "</h3></td></tr>" << endl;
}
-void HtmlGenerator::startMemberDocSimple()
+void HtmlGenerator::startMemberDocSimple(bool isEnum)
{
DBG_HTML(t << "<!-- startMemberDocSimple -->" << endl;)
t << "<table class=\"fieldtable\">" << endl;
- t << "<tr><th colspan=\"3\">" << theTranslator->trCompoundMembers() << "</th></tr>" << endl;
+ t << "<tr><th colspan=\"" << (isEnum?"2":"3") << "\">";
+ t << (isEnum? theTranslator->trEnumerationValues() :
+ theTranslator->trCompoundMembers()) << "</th></tr>" << endl;
}
-void HtmlGenerator::endMemberDocSimple()
+void HtmlGenerator::endMemberDocSimple(bool)
{
DBG_HTML(t << "<!-- endMemberDocSimple -->" << endl;)
t << "</table>" << endl;
diff --git a/src/htmlgen.h b/src/htmlgen.h
index 924d04f..30f54f4 100644
--- a/src/htmlgen.h
+++ b/src/htmlgen.h
@@ -225,7 +225,9 @@ class HtmlGenerator : public OutputGenerator
void endDescForItem() { t << "</dd>\n"; }
void lineBreak(const char *style);
void writeChar(char c);
- void startMemberDoc(const char *,const char *,const char *,const char *,bool);
+ void startMemberDoc(const char *clName, const char *memName,
+ const char *anchor, const char *title,
+ int memCount, int memTotal, bool showInline);
void endMemberDoc(bool);
void startDoxyAnchor(const char *fName,const char *manName,
const char *anchor,const char *name,
@@ -270,25 +272,16 @@ class HtmlGenerator : public OutputGenerator
void startContents();
void endContents();
void writeNonBreakableSpace(int);
-
- void startDescTable(const char *title)
- //{ t << "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">" << endl; }
- { t << "<table class=\"fieldtable\">" << endl
- << "<tr><th colspan=\"2\">" << title << "</th></tr>";
- }
- void endDescTable()
- { t << "</table>" << endl; }
- void startDescTableTitle()
- //{ t << "<tr><td valign=\"top\"><em>"; }
- { t << "<tr><td class=\"fieldname\">"; }
- void endDescTableTitle()
- { t << "&#160;</td>"; }
- void startDescTableData()
- //{ t << "<td>" << endl; }
- { t << "<td class=\"fielddoc\">" << endl; }
- void endDescTableData()
- { t << "</td></tr>" << endl; }
-
+
+ void startDescTable(const char *title);
+ void endDescTable();
+ void startDescTableRow();
+ void endDescTableRow();
+ void startDescTableTitle();
+ void endDescTableTitle();
+ void startDescTableData();
+ void endDescTableData();
+
void startDotGraph();
void endDotGraph(const DotClassGraph &g);
void startInclDepGraph();
@@ -328,8 +321,8 @@ class HtmlGenerator : public OutputGenerator
void endConstraintDocs();
void endConstraintList();
- void startMemberDocSimple();
- void endMemberDocSimple();
+ void startMemberDocSimple(bool);
+ void endMemberDocSimple(bool);
void startInlineMemberType();
void endInlineMemberType();
void startInlineMemberName();
diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp
index d365744..ad56de8 100644
--- a/src/htmlhelp.cpp
+++ b/src/htmlhelp.cpp
@@ -134,7 +134,8 @@ static QCString field2URL(const IndexField *f,bool checkReversed)
QCString result = f->url + Doxygen::htmlFileExtension;
if (!f->anchor.isEmpty() && (!checkReversed || f->reversed))
{
- result+="#"+f->anchor;
+ // HTML Help needs colons in link anchors to be escaped in the .hhk file.
+ result+="#"+substitute(f->anchor,":","%3A");
}
return result;
}
@@ -190,7 +191,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t)
{ // finish old list at level 2
if (level2Started) t << " </UL>" << endl;
level2Started=FALSE;
-
+
// <Antony>
// Added this code so that an item with only one subitem is written
// without any subitem.
@@ -214,7 +215,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t)
if (level2.isEmpty())
{
t << " <LI><OBJECT type=\"text/sitemap\">";
- t << "<param name=\"Local\" value=\"" << field2URL(f,TRUE);
+ t << "<param name=\"Local\" value=\"" << field2URL(f,FALSE);
t << "\">";
t << "<param name=\"Name\" value=\"" << m_help->recode(level1) << "\">"
"</OBJECT>\n";
@@ -446,7 +447,7 @@ void HtmlHelp::initialize()
}
-static QCString getLanguageString()
+QCString HtmlHelp::getLanguageString()
{
if (!theTranslator->idLanguage().isEmpty())
{
diff --git a/src/htmlhelp.h b/src/htmlhelp.h
index 8191d03..9c3fa04 100644
--- a/src/htmlhelp.h
+++ b/src/htmlhelp.h
@@ -84,6 +84,7 @@ class HtmlHelp : public IndexIntf
void addIndexFile(const char *name);
void addImageFile(const char *);
void addStyleSheetFile(const char *) {}
+ static QCString getLanguageString();
private:
friend class HtmlHelpIndex;
diff --git a/src/index.cpp b/src/index.cpp
index 8c7452e..96909c7 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1777,7 +1777,7 @@ static void writeAlphabeticalClassList(OutputList &ol)
int index = getPrefixIndex(cd->className());
//printf("name=%s index=%d %d\n",cd->className().data(),index,cd->protection());
- startLetter=getUtf8CodeToUpper(cd->className(),index);
+ startLetter=getUtf8CodeToLower(cd->className(),index);
indexLettersUsed.add(startLetter);
}
}
@@ -1828,7 +1828,7 @@ static void writeAlphabeticalClassList(OutputList &ol)
if (cd->isLinkableInProject() && cd->templateMaster()==0)
{
int index = getPrefixIndex(cd->className());
- startLetter=getUtf8Code(cd->className(),index);
+ startLetter=getUtf8CodeToLower(cd->className(),index);
// Do some sorting again, since the classes are sorted by name with
// prefix, which should be ignored really.
if (cd->getLanguage()==SrcLangExt_VHDL)
@@ -2571,6 +2571,7 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
if (!disableIndex)
{
ol.writeQuickLinks(TRUE,HLI_Functions,0);
+#if 0
startQuickIndexList(ol);
// index item for global member list
@@ -2601,6 +2602,7 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
writeQuickMemberIndex(ol,g_memberIndexLetterUsed[hl],page,
getCmhlInfo(hl)->fname,multiPageIndex);
}
+#endif
}
ol.endQuickIndices();
ol.writeSplitBar(fileName);
@@ -2743,6 +2745,7 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
if (!disableIndex)
{
ol.writeQuickLinks(TRUE,HLI_Globals,0);
+#if 0
startQuickIndexList(ol);
// index item for all file member lists
@@ -2771,6 +2774,7 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
writeQuickMemberIndex(ol,g_fileIndexLetterUsed[hl],page,
getFmhlInfo(hl)->fname,multiPageIndex);
}
+#endif
}
ol.endQuickIndices();
ol.writeSplitBar(fileName);
@@ -2911,6 +2915,7 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol,
if (!disableIndex)
{
ol.writeQuickLinks(TRUE,HLI_NamespaceMembers,0);
+#if 0
startQuickIndexList(ol);
// index item for all namespace member lists
@@ -2939,7 +2944,7 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol,
writeQuickMemberIndex(ol,g_namespaceIndexLetterUsed[hl],page,
getNmhlInfo(hl)->fname,multiPageIndex);
}
-
+#endif
}
ol.endQuickIndices();
ol.writeSplitBar(fileName);
@@ -4277,8 +4282,166 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
}
}
+static bool quickLinkVisible(LayoutNavEntry::Kind kind)
+{
+ static bool showFiles = Config_getBool(SHOW_FILES);
+ static bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
+ switch (kind)
+ {
+ case LayoutNavEntry::MainPage: return TRUE;
+ case LayoutNavEntry::User: return TRUE;
+ case LayoutNavEntry::UserGroup: return TRUE;
+ case LayoutNavEntry::Pages: return indexedPages>0;
+ case LayoutNavEntry::Modules: return documentedGroups>0;
+ case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces;
+ case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces;
+ case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0;
+ case LayoutNavEntry::Classes: return annotatedClasses>0;
+ case LayoutNavEntry::ClassList: return annotatedClasses>0;
+ case LayoutNavEntry::ClassIndex: return annotatedClasses>0;
+ case LayoutNavEntry::ClassHierarchy: return hierarchyClasses>0;
+ case LayoutNavEntry::ClassMembers: return documentedClassMembers[CMHL_All]>0;
+ case LayoutNavEntry::Files: return documentedHtmlFiles>0 && showFiles;
+ case LayoutNavEntry::FileList: return documentedHtmlFiles>0 && showFiles;
+ case LayoutNavEntry::FileGlobals: return documentedFileMembers[FMHL_All]>0;
+ //case LayoutNavEntry::Dirs: return documentedDirs>0;
+ case LayoutNavEntry::Examples: return Doxygen::exampleSDict->count()>0;
+ }
+ return FALSE;
+}
+
+template<class T>
+void renderMemberIndicesAsJs(FTextStream &t,
+ int total,const int *numDocumented,const LetterToIndexMap<MemberIndexList> *memberLists,
+ const T *(*getInfo)(int hl))
+{
+ // index items per category member lists
+ bool firstMember=TRUE;
+ for (int i=0;i<total;i++)
+ {
+ if (numDocumented[i]>0)
+ {
+ t << ",";
+ if (firstMember)
+ {
+ t << "children:[";
+ firstMember=FALSE;
+ }
+ t << endl << "{text:'" << convertToJSString(getInfo(i)->title) << "',url:'"
+ << convertToJSString(getInfo(i)->fname+Doxygen::htmlFileExtension) << "'";
+
+ // Check if we have many members, then add sub entries per letter...
+ // quick alphabetical index
+ bool quickIndex = numDocumented[i]>maxItemsBeforeQuickIndex;
+ if (quickIndex)
+ {
+ bool multiPageIndex=FALSE;
+ if (numDocumented[i]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
+ {
+ multiPageIndex=TRUE;
+ }
+ t << ",children:[" << endl;
+ bool firstLetter=TRUE;
+ SIntDict<MemberIndexList>::Iterator it(memberLists[i]);
+ MemberIndexList *ml;
+ for (it.toFirst();(ml=it.current());++it)
+ {
+ if (!firstLetter) t << "," << endl;
+ uint letter = ml->letter();
+ QCString is = letterToLabel(letter);
+ QCString ci = QString(QChar(letter)).utf8();
+ QCString anchor;
+ QCString extension=Doxygen::htmlFileExtension;
+ QCString fullName = getInfo(i)->fname;
+ if (!multiPageIndex || firstLetter)
+ anchor=fullName+extension+"#index_";
+ else // other pages of multi page index
+ anchor=fullName+"_"+is+extension+"#index_";
+ t << "{text:'" << convertToJSString(ci) << "',url:'"
+ << convertToJSString(anchor+is) << "'}";
+ firstLetter=FALSE;
+ }
+ t << "]";
+ }
+ t << "}";
+ }
+ }
+ if (!firstMember)
+ {
+ t << "]";
+ }
+}
+
+static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
+{
+ QListIterator<LayoutNavEntry> li(root->children());
+ LayoutNavEntry *entry;
+ int count=0;
+ for (li.toFirst();(entry=li.current());++li)
+ {
+ if (entry->visible() && quickLinkVisible(entry->kind())) count++;
+ }
+ if (count>0) // at least one item is visible
+ {
+ bool firstChild = TRUE;
+ if (!first) t << ",";
+ t << "children:[" << endl;
+ for (li.toFirst();(entry=li.current());++li)
+ {
+ if (entry->visible() && quickLinkVisible(entry->kind()))
+ {
+ if (!firstChild) t << "," << endl;
+ firstChild=FALSE;
+ QCString url = entry->url();
+ t << "{text:'" << convertToJSString(entry->title()) << "',url:'"
+ << convertToJSString(url) << "'";
+ bool hasChildren=FALSE;
+ if (entry->kind()==LayoutNavEntry::NamespaceMembers)
+ {
+ renderMemberIndicesAsJs(t,NMHL_Total,documentedNamespaceMembers,
+ g_namespaceIndexLetterUsed,getNmhlInfo);
+ }
+ else if (entry->kind()==LayoutNavEntry::ClassMembers)
+ {
+ renderMemberIndicesAsJs(t,CMHL_Total,documentedClassMembers,
+ g_memberIndexLetterUsed,getCmhlInfo);
+ }
+ else if (entry->kind()==LayoutNavEntry::FileGlobals)
+ {
+ renderMemberIndicesAsJs(t,FMHL_Total,documentedFileMembers,
+ g_fileIndexLetterUsed,getFmhlInfo);
+ }
+ else // recursive into child list
+ {
+ hasChildren = renderQuickLinksAsJs(t,entry,FALSE);
+ }
+ if (hasChildren) t << "]";
+ t << "}";
+ }
+ }
+ }
+ return count>0;
+}
+
+static void writeMenuData()
+{
+ if (!Config_getBool(GENERATE_HTML) || Config_getBool(DISABLE_INDEX)) return;
+ QCString outputDir = Config_getBool(HTML_OUTPUT);
+ QFile f(outputDir+"/menudata.js");
+ LayoutNavEntry *root = LayoutDocManager::instance().rootNavEntry();
+ if (f.open(IO_WriteOnly))
+ {
+ FTextStream t(&f);
+ t << "var menudata={";
+ bool hasChildren = renderQuickLinksAsJs(t,root,TRUE);
+ if (hasChildren) t << "]";
+ t << "}" << endl;
+ }
+}
+
void writeIndexHierarchy(OutputList &ol)
{
+ writeMenuData();
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry();
if (lne)
{
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 184511f..467800c 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -431,7 +431,14 @@ void LatexDocVisitor::visit(DocInclude *inc)
inc->text(),
langExt,
inc->isExample(),
- inc->exampleFile(), &fd);
+ inc->exampleFile(),
+ &fd, // fileDef,
+ -1, // start line
+ -1, // end line
+ FALSE, // inline fragment
+ 0, // memberDef
+ TRUE // show line numbers
+ );
m_t << "\\end{DoxyCodeInclude}" << endl;
}
break;
@@ -440,7 +447,14 @@ void LatexDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(),
inc->text(),langExt,inc->isExample(),
- inc->exampleFile());
+ inc->exampleFile(),
+ 0, // fileDef
+ -1, // startLine
+ -1, // endLine
+ TRUE, // inlineFragment
+ 0, // memberDef
+ FALSE
+ );
m_t << "\\end{DoxyCodeInclude}\n";
break;
case DocInclude::DontInclude:
@@ -469,6 +483,33 @@ void LatexDocVisitor::visit(DocInclude *inc)
m_t << "\\end{DoxyCodeInclude}" << endl;
}
break;
+ case DocInclude::SnipWithLines:
+ {
+ QFileInfo cfi( inc->file() );
+ FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ m_t << "\n\\begin{DoxyCodeInclude}\n";
+ Doxygen::parserManager->getParser(inc->extension())
+ ->parseCode(m_ci,
+ inc->context(),
+ extractBlock(inc->text(),inc->blockId()),
+ langExt,
+ inc->isExample(),
+ inc->exampleFile(),
+ &fd,
+ lineBlock(inc->text(),inc->blockId()),
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
+ TRUE // show line number
+ );
+ m_t << "\\end{DoxyCodeInclude}" << endl;
+ }
+ break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
}
@@ -908,7 +949,7 @@ static void writeStartTableCommand(FTextStream &t,const DocNode *n,int cols)
}
else
{
- t << "\\tabulinesep=1mm\n\\begin{longtabu} spread 0pt [c]{*" << cols << "{|X[-1]}|}\n";
+ t << "\\tabulinesep=1mm\n\\begin{longtabu} spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
}
//return isNested ? "TabularNC" : "TabularC";
}
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 7082485..ca60b50 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -619,21 +619,7 @@ static void writeDefaultHeaderPart1(FTextStream &t)
"\\makeindex\n"
"\n";
- // User-specified packages
- QStrList &extraPackages = Config_getList(EXTRA_PACKAGES);
- if (!extraPackages.isEmpty()) {
- t << "% Packages requested by user\n";
- const char *pkgName=extraPackages.first();
- while (pkgName)
- {
- if ((pkgName[0] == '[') || (pkgName[0] == '{'))
- t << "\\usepackage" << pkgName << "\n";
- else
- t << "\\usepackage{" << pkgName << "}\n";
- pkgName=extraPackages.next();
- }
- t << "\n";
- }
+ writeExtraLatexPackages(t);
// Hyperlinks
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
@@ -1306,7 +1292,7 @@ void LatexGenerator::endIndexItem(const char *ref,const char *fn)
//{
// t << "\\item\\contentsline{section}{";
// docify(text);
-// t << "}{\\pageref{" << text << "}}" << endl;
+// t << "}{\\pageref{" << stripPath(text) << "}}" << endl;
//}
@@ -1350,7 +1336,7 @@ void LatexGenerator::writeStartAnnoItem(const char *,const char *,
void LatexGenerator::writeEndAnnoItem(const char *name)
{
- t << "}{\\pageref{" << name << "}}{}" << endl;
+ t << "}{\\pageref{" << stripPath(name) << "}}{}" << endl;
}
void LatexGenerator::startIndexKey()
@@ -1371,7 +1357,7 @@ void LatexGenerator::startIndexValue(bool hasBrief)
void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/)
{
//if (hasBrief) t << ")";
- t << "}{\\pageref{" << name << "}}{}" << endl;
+ t << "}{\\pageref{" << stripPath(name) << "}}{}" << endl;
}
//void LatexGenerator::writeClassLink(const char *,const char *,
@@ -1536,8 +1522,10 @@ void LatexGenerator::startMemberDoc(const char *clname,
const char *memname,
const char *,
const char *title,
+ int memCount,
+ int memTotal,
bool showInline)
-{
+{
if (memname && memname[0]!='@')
{
t << "\\index{";
@@ -1564,7 +1552,7 @@ void LatexGenerator::startMemberDoc(const char *clname,
t << latexEscapeLabelName(clname,insideTabbing);
t << "@{";
t << latexEscapeIndexChars(clname,insideTabbing);
- t << "}";
+ t << "}";
}
t << "}" << endl;
}
@@ -1574,9 +1562,9 @@ void LatexGenerator::startMemberDoc(const char *clname,
int level=0;
if (showInline) level+=2;
if (compactLatex) level++;
- t << "\\" << levelLab[level];
+ t << "\\" << levelLab[level];
- t << "[{";
+ t << "{";
if (pdfHyperlinks)
{
t << "\\texorpdfstring{";
@@ -1586,15 +1574,19 @@ void LatexGenerator::startMemberDoc(const char *clname,
{
t << "}{" << latexEscapePDFString(title) << "}";
}
- t << "}]";
- t << "{\\setlength{\\rightskip}{0pt plus 5cm}";
- disableLinks=TRUE;
+ if (memTotal>1)
+ {
+ t << "\\hspace{0.1cm}{\\footnotesize\\ttfamily [" << memCount << "/" << memTotal << "]}";
+ }
+ t << "}";
+ t << "\n{\\footnotesize\\ttfamily ";
+ //disableLinks=TRUE;
}
void LatexGenerator::endMemberDoc(bool)
{
disableLinks=FALSE;
- t << "}";
+ t << "}\n\n";
//if (Config_getBool(COMPACT_LATEX)) t << "\\hfill";
}
@@ -1602,10 +1594,6 @@ void LatexGenerator::startDoxyAnchor(const char *fName,const char *,
const char *anchor, const char *,
const char *)
{
-}
-
-void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
-{
static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
static bool usePDFLatex = Config_getBool(USE_PDFLATEX);
if (usePDFLatex && pdfHyperlinks)
@@ -1618,7 +1606,11 @@ void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
t << "\\label{";
if (fName) t << stripPath(fName);
if (anchor) t << "_" << anchor;
- t << "}" << endl;
+ t << "} " << endl;
+}
+
+void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
+{
}
void LatexGenerator::writeAnchor(const char *fName,const char *name)
@@ -1834,6 +1826,65 @@ void LatexGenerator::writeNonBreakableSpace(int)
}
}
+// ----------------------------------------------
+// nesting of functions below:
+// startDescTable()
+// - startDescTableRow()
+// - startDescTableTitle()
+// - endDescTabelTitle()
+// - startDescTableData()
+// - endDescTableData()
+// - endDescTableRow()
+// - startDescTableRow()
+// - ...
+// - endDescTableRow()
+// endDescTable()
+
+void LatexGenerator::startDescTable(const char *title)
+{
+ t << "\\begin{DoxyEnumFields}{" << title << "}" << endl;
+}
+
+void LatexGenerator::endDescTable()
+{
+ t << "\\end{DoxyEnumFields}" << endl;
+}
+
+void LatexGenerator::startDescTableRow()
+{
+ // this is needed to prevent the \hypertarget, \label, and \index commands from messing up
+ // the row height (based on http://tex.stackexchange.com/a/186102)
+ t << "\\raisebox{\\heightof{T}}[0pt][0pt]{";
+}
+
+void LatexGenerator::endDescTableRow()
+{
+}
+
+void LatexGenerator::startDescTableTitle()
+{
+ t << "}";
+}
+
+void LatexGenerator::endDescTableTitle()
+{
+}
+
+void LatexGenerator::startDescTableData()
+{
+ t << "&";
+}
+
+void LatexGenerator::endDescTableData()
+{
+ t << "\\\\\n\\hline\n" << endl;
+}
+
+void LatexGenerator::lastIndexPage()
+{
+}
+
+
void LatexGenerator::startMemberList()
{
if (!insideTabbing)
@@ -2006,7 +2057,7 @@ void LatexGenerator::startParameterList(bool openBracket)
{
/* start of ParameterType ParameterName list */
if (openBracket) t << "(";
- t << endl << "\\begin{DoxyParamCaption}" << endl;
+ t << "\\begin{DoxyParamCaption}";
}
void LatexGenerator::endParameterList()
@@ -2029,13 +2080,12 @@ void LatexGenerator::startParameterName(bool /*oneArgOnly*/)
t << "{";
}
-void LatexGenerator::endParameterName(bool last,bool /* emptyList */,bool closeBracket)
+void LatexGenerator::endParameterName(bool last,bool /*emptyList*/,bool closeBracket)
{
- t << "}" << endl;
-
+ t << " }";
if (last)
{
- t << "\\end{DoxyParamCaption}" << endl;
+ t << "\\end{DoxyParamCaption}";
if (closeBracket) t << ")";
}
}
@@ -2133,20 +2183,35 @@ void LatexGenerator::lineBreak(const char *)
}
else
{
- t << "\\\\*\n";
+ t << "\\newline\n";
}
}
-void LatexGenerator::startMemberDocSimple()
+void LatexGenerator::startMemberDocSimple(bool isEnum)
{
- t << "\\begin{DoxyFields}{";
- docify(theTranslator->trCompoundMembers());
+ if (isEnum)
+ {
+ t << "\\begin{DoxyEnumFields}{";
+ docify(theTranslator->trEnumerationValues());
+ }
+ else
+ {
+ t << "\\begin{DoxyFields}{";
+ docify(theTranslator->trCompoundMembers());
+ }
t << "}" << endl;
}
-void LatexGenerator::endMemberDocSimple()
+void LatexGenerator::endMemberDocSimple(bool isEnum)
{
- t << "\\end{DoxyFields}" << endl;
+ if (isEnum)
+ {
+ t << "\\end{DoxyEnumFields}" << endl;
+ }
+ else
+ {
+ t << "\\end{DoxyFields}" << endl;
+ }
}
void LatexGenerator::startInlineMemberType()
diff --git a/src/latexgen.h b/src/latexgen.h
index 84382a7..7b21ea4 100644
--- a/src/latexgen.h
+++ b/src/latexgen.h
@@ -208,7 +208,7 @@ class LatexGenerator : public OutputGenerator
void startDescItem();
void endDescItem();
void lineBreak(const char *style=0);
- void startMemberDoc(const char *,const char *,const char *,const char *,bool);
+ void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
void endMemberDoc(bool);
void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
void endDoxyAnchor(const char *,const char *);
@@ -259,23 +259,16 @@ class LatexGenerator : public OutputGenerator
void startContents() {}
void endContents() {}
void writeNonBreakableSpace(int);
-
- void startDescTable(const char *title)
- { startSimpleSect(EnumValues,0,0,title);
- startDescForItem();
- t << "\\begin{description}" << endl; }
- void endDescTable()
- { t << "\\end{description}" << endl;
- endDescForItem();
- endSimpleSect();
- }
- void startDescTableTitle()
- { t << "\\item[{\\em " << endl; }
- void endDescTableTitle()
- { t << "}]"; }
- void startDescTableData() {}
- void endDescTableData() {}
- void lastIndexPage() {}
+
+ void startDescTable(const char *title);
+ void endDescTable();
+ void startDescTableRow();
+ void endDescTableRow();
+ void startDescTableTitle();
+ void endDescTableTitle();
+ void startDescTableData();
+ void endDescTableData();
+ void lastIndexPage();
void startDotGraph();
void endDotGraph(const DotClassGraph &);
@@ -293,7 +286,7 @@ class LatexGenerator : public OutputGenerator
void endTextBlock(bool) {}
void startMemberDocPrefixItem() {}
- void endMemberDocPrefixItem() {}
+ void endMemberDocPrefixItem() { t << "\\\\" << endl; }
void startMemberDocName(bool) {}
void endMemberDocName() {}
void startParameterType(bool,const char *);
@@ -313,8 +306,8 @@ class LatexGenerator : public OutputGenerator
void endConstraintDocs();
void endConstraintList();
- void startMemberDocSimple();
- void endMemberDocSimple();
+ void startMemberDocSimple(bool);
+ void endMemberDocSimple(bool);
void startInlineMemberType();
void endInlineMemberType();
void startInlineMemberName();
diff --git a/src/lodepng.cpp b/src/lodepng.cpp
index dbbced5..66335aa 100644
--- a/src/lodepng.cpp
+++ b/src/lodepng.cpp
@@ -622,7 +622,7 @@ static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigne
/*keep the coins with lowest weight, so that they add up to the amount of symbols - 1*/
vector_resized(&coins, numpresent - 1, Coin_cleanup);
- /*calculate the lenghts of each symbol, as the amount of times a coin of each symbol is used*/
+ /*calculate the lengths of each symbol, as the amount of times a coin of each symbol is used*/
for(i = 0; i < coins.size; i++)
{
Coin* coin = (Coin*)vector_get(&coins, i);
@@ -1114,7 +1114,7 @@ static unsigned encodeLZ77_brute(uivector* out, const unsigned char* in, size_t
size_t current_length = 1;
size_t backtest = backpos + 1;
size_t foretest = pos + 1;
- while(foretest < size && in[backtest] == in[foretest] && current_length < MAX_SUPPORTED_DEFLATE_LENGTH) /*maximum supporte length by deflate is max length*/
+ while(foretest < size && in[backtest] == in[foretest] && current_length < MAX_SUPPORTED_DEFLATE_LENGTH) /*maximum support length by deflate is max length*/
{
if(backpos >= pos) backpos -= current_offset; /*continue as if we work on the decoded bytes after pos by jumping back before pos*/
current_length++;
@@ -1213,7 +1213,7 @@ static unsigned encodeLZ77(uivector* out, const unsigned char* in, size_t size,
unsigned current_length = 0;
unsigned backtest = backpos;
unsigned foretest = pos;
- while(foretest < size && in[backtest] == in[foretest] && current_length < MAX_SUPPORTED_DEFLATE_LENGTH) /*maximum supporte length by deflate is max length*/
+ while(foretest < size && in[backtest] == in[foretest] && current_length < MAX_SUPPORTED_DEFLATE_LENGTH) /*maximum support length by deflate is max length*/
{
if(backpos >= pos) backpos -= current_offset; /*continue as if we work on the decoded bytes after pos by jumping back before pos*/
current_length++;
@@ -1330,7 +1330,7 @@ static unsigned deflateDynamic(ucvector* out, const unsigned char* data, size_t
after the BFINAL and BTYPE, the dynamic block consists out of the following:
- 5 bits HLIT, 5 bits HDIST, 4 bits HCLEN
- (HCLEN+4)*3 bits code lengths of code length alphabet
- - HLIT + 257 code lenghts of lit/length alphabet (encoded using the code length alphabet, + possible repetition codes 16, 17, 18)
+ - HLIT + 257 code lengths of lit/length alphabet (encoded using the code length alphabet, + possible repetition codes 16, 17, 18)
- HDIST + 1 code lengths of distance alphabet (encoded using the code length alphabet, + possible repetition codes 16, 17, 18)
- compressed data
- 256 (end code)
@@ -1346,7 +1346,7 @@ static unsigned deflateDynamic(ucvector* out, const unsigned char* data, size_t
uivector frequenciesD;
uivector amounts; /*the amounts in the "normal" order*/
uivector lldl;
- uivector lldll; /*lit/len & dist code lenghts*/
+ uivector lldll; /*lit/len & dist code lengths*/
uivector clcls;
unsigned BFINAL = 1; /*make only one block... the first and final one*/
@@ -1448,7 +1448,7 @@ static unsigned deflateDynamic(ucvector* out, const unsigned char* data, size_t
if(error) break;
if(!uivector_resize(&clcls, 19)) { error = 9927; break; }
- for(i = 0; i < 19; i++) clcls.data[i] = HuffmanTree_getLength(&codelengthcodes, CLCL[i]); /*lenghts of code length tree is in the order as specified by deflate*/
+ for(i = 0; i < 19; i++) clcls.data[i] = HuffmanTree_getLength(&codelengthcodes, CLCL[i]); /*lengths of code length tree is in the order as specified by deflate*/
while(clcls.data[clcls.size - 1] == 0 && clcls.size > 4)
{
if(!uivector_resize(&clcls, clcls.size - 1)) { error = 9928; break; } /*remove zeros at the end, but minimum size must be 4*/
@@ -1463,10 +1463,10 @@ static unsigned deflateDynamic(ucvector* out, const unsigned char* data, size_t
addBitsToStream(&bp, out, HDIST, 5);
addBitsToStream(&bp, out, HCLEN, 4);
- /*write the code lenghts of the code length alphabet*/
+ /*write the code lengths of the code length alphabet*/
for(i = 0; i < HCLEN + 4; i++) addBitsToStream(&bp, out, clcls.data[i], 3);
- /*write the lenghts of the lit/len AND the dist alphabet*/
+ /*write the lengths of the lit/len AND the dist alphabet*/
for(i = 0; i < lldl.size; i++)
{
addHuffmanSymbol(&bp, out, HuffmanTree_getCode(&codelengthcodes, lldl.data[i]), HuffmanTree_getLength(&codelengthcodes, lldl.data[i]));
@@ -1734,7 +1734,7 @@ const LodeZlib_DecompressSettings LodeZlib_defaultDecompressSettings = {0};
The two functions below (LodePNG_decompress and LodePNG_compress) directly call the
LodeZlib_decompress and LodeZlib_compress functions. The only purpose of the functions
below, is to provide the ability to let LodePNG use a different Zlib encoder by only
-changing the two functions below, instead of changing it inside the vareous places
+changing the two functions below, instead of changing it inside the various places
in the other LodePNG functions.
*out must be NULL and *outsize must be 0 initially, and after the function is done,
@@ -2813,7 +2813,7 @@ static unsigned postProcessScanlines(unsigned char* out, unsigned char* in, cons
if(error) return error;
removePaddingBits(out, in, w * bpp, ((w * bpp + 7) / 8) * 8, h);
}
- else error = unfilter(out, in, w, h, bpp); /*we can immediatly filter into the out buffer, no other steps needed*/
+ else error = unfilter(out, in, w, h, bpp); /*we can immediately filter into the out buffer, no other steps needed*/
}
else /*interlaceMethod is 1 (Adam7)*/
{
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index 8acffc7..2233cc6 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -237,7 +237,14 @@ void ManDocVisitor::visit(DocInclude *inc)
inc->text(),
langExt,
inc->isExample(),
- inc->exampleFile(), &fd);
+ inc->exampleFile(),
+ &fd, // fileDef,
+ -1, // start line
+ -1, // end line
+ FALSE, // inline fragment
+ 0, // memberDef
+ TRUE
+ );
if (!m_firstCol) m_t << endl;
m_t << ".fi" << endl;
m_t << ".PP" << endl;
@@ -253,7 +260,14 @@ void ManDocVisitor::visit(DocInclude *inc)
inc->text(),
langExt,
inc->isExample(),
- inc->exampleFile());
+ inc->exampleFile(),
+ 0, // fileDef
+ -1, // startLine
+ -1, // endLine
+ TRUE, // inlineFragment
+ 0, // memberDef
+ FALSE
+ );
if (!m_firstCol) m_t << endl;
m_t << ".fi" << endl;
m_t << ".PP" << endl;
@@ -292,6 +306,38 @@ void ManDocVisitor::visit(DocInclude *inc)
m_t << ".PP" << endl;
m_firstCol=TRUE;
break;
+ case DocInclude::SnipWithLines:
+ {
+ if (!m_firstCol) m_t << endl;
+ m_t << ".PP" << endl;
+ m_t << ".nf" << endl;
+ QFileInfo cfi( inc->file() );
+ FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ Doxygen::parserManager->getParser(inc->extension())
+ ->parseCode(m_ci,
+ inc->context(),
+ extractBlock(inc->text(),inc->blockId()),
+ langExt,
+ inc->isExample(),
+ inc->exampleFile(),
+ &fd,
+ lineBlock(inc->text(),inc->blockId()),
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
+ TRUE // show line number
+ );
+ if (!m_firstCol) m_t << endl;
+ m_t << ".fi" << endl;
+ m_t << ".PP" << endl;
+ m_firstCol=TRUE;
+ }
+ break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
}
diff --git a/src/mangen.cpp b/src/mangen.cpp
index 88d2ce5..963f66c 100644
--- a/src/mangen.cpp
+++ b/src/mangen.cpp
@@ -418,7 +418,7 @@ void ManGenerator::endCodeFragment()
col=0;
}
-void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,bool)
+void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool)
{
if (!firstCol) t << endl;
t << ".SS \"";
@@ -762,19 +762,26 @@ void ManGenerator::endInlineHeader()
firstCol = FALSE;
}
-void ManGenerator::startMemberDocSimple()
+void ManGenerator::startMemberDocSimple(bool isEnum)
{
if (!firstCol)
{
t << endl << ".PP" << endl;
}
t << "\\fB";
- docify(theTranslator->trCompoundMembers());
+ if (isEnum)
+ {
+ docify(theTranslator->trEnumerationValues());
+ }
+ else
+ {
+ docify(theTranslator->trCompoundMembers());
+ }
t << ":\\fP" << endl;
t << ".RS 4" << endl;
}
-void ManGenerator::endMemberDocSimple()
+void ManGenerator::endMemberDocSimple(bool)
{
if (!firstCol) t << endl;
t << ".RE" << endl;
diff --git a/src/mangen.h b/src/mangen.h
index 93111cf..daaae0c 100644
--- a/src/mangen.h
+++ b/src/mangen.h
@@ -144,7 +144,7 @@ class ManGenerator : public OutputGenerator
void endDescItem();
void lineBreak(const char *) { t << "\n.br" << endl; }
void writeChar(char c);
- void startMemberDoc(const char *,const char *,const char *,const char *,bool);
+ void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
void endMemberDoc(bool);
void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
void endDoxyAnchor(const char *,const char *) {}
@@ -160,8 +160,8 @@ class ManGenerator : public OutputGenerator
void endCenter() {}
void startSmall() {}
void endSmall() {}
- void startMemberDescription(const char *,const char *) { t << "\n.RI \"\\fI"; firstCol=FALSE; }
- void endMemberDescription() { t << "\\fP\""; firstCol=FALSE; }
+ void startMemberDescription(const char *,const char *) { t << "\n.RI \""; firstCol=FALSE; }
+ void endMemberDescription() { t << "\""; firstCol=FALSE; }
void startMemberDeclaration() {}
void endMemberDeclaration(const char *,const char *) {}
void writeInheritedSectionTitle(const char *,const char *,const char *,
@@ -199,6 +199,8 @@ class ManGenerator : public OutputGenerator
void startDescTable(const char *t)
{ startSimpleSect(EnumValues,0,0,t); startDescForItem(); }
void endDescTable() { endDescForItem(); endSimpleSect(); }
+ void startDescTableRow() {}
+ void endDescTableRow() {}
void startDescTableTitle() { startItemListItem(); startBold(); startEmphasis(); endItemListItem(); }
void endDescTableTitle() { endEmphasis(); endBold(); }
void startDescTableData() { t << endl; firstCol=TRUE; }
@@ -244,8 +246,8 @@ class ManGenerator : public OutputGenerator
void endConstraintDocs();
void endConstraintList();
- void startMemberDocSimple();
- void endMemberDocSimple();
+ void startMemberDocSimple(bool);
+ void endMemberDocSimple(bool);
void startInlineMemberType();
void endInlineMemberType();
void startInlineMemberName();
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 1723d1f..d63e149 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -111,19 +111,22 @@ static void processInline(GrowBuf &out,const char *data,int size);
static QCString escapeSpecialChars(const QCString &s)
{
if (s.isEmpty()) return "";
+ bool insideQuote=FALSE;
GrowBuf growBuf;
const char *p=s;
- char c;
+ char c,pc='\0';
while ((c=*p++))
{
switch (c)
{
- case '<': growBuf.addStr("\\<"); break;
- case '>': growBuf.addStr("\\>"); break;
- case '\\': growBuf.addStr("\\\\"); break;
- case '@': growBuf.addStr("\\@"); break;
- default: growBuf.addChar(c); break;
+ case '"': if (pc!='\\') { insideQuote=!insideQuote; } growBuf.addChar(c); break;
+ case '<': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('<'); break;
+ case '>': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('>'); break;
+ case '\\': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('\\'); break;
+ case '@': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('@'); break;
+ default: growBuf.addChar(c); break;
}
+ pc=c;
}
growBuf.addChar(0);
return growBuf.get();
@@ -838,7 +841,7 @@ static int processLink(GrowBuf &out,const char *data,int,int size)
out.addStr("@image html ");
out.addStr(link.mid(fd ? 0 : 5));
if (!explicitTitle && !content.isEmpty())
- {
+ {
out.addStr(" \"");
out.addStr(content);
out.addStr("\"");
@@ -1018,26 +1021,21 @@ static int processSpecialCommand(GrowBuf &out, const char *data, int offset, int
if (size>1 && data[0]=='\\')
{
char c=data[1];
- if (c=='[' || c==']' || c=='*' || /* c=='+' || c=='-' || c=='.' || */
- c=='!' || c=='(' || c==')' || c=='`' || c=='_')
+ if (c=='[' || c==']' || c=='*' || c=='!' || c=='(' || c==')' || c=='`' || c=='_')
{
- if (c=='-' && size>3 && data[2]=='-' && data[3]=='-') // \---
- {
- out.addStr(&data[1],3);
- return 4;
- }
- else if (c=='-' && size>2 && data[2]=='-') // \--
- {
- out.addStr(&data[1],2);
- return 3;
- }
- else if (c=='-') // \-
- {
- out.addChar(c);
- }
out.addChar(data[1]);
return 2;
}
+ else if (c=='-' && size>3 && data[2]=='-' && data[3]=='-') // \---
+ {
+ out.addStr(&data[1],3);
+ return 4;
+ }
+ else if (c=='-' && size>2 && data[2]=='-') // \--
+ {
+ out.addStr(&data[1],2);
+ return 3;
+ }
}
return 0;
}
@@ -1231,7 +1229,7 @@ static int isHRuler(const char *data,int size)
return n>=3; // at least 3 characters needed for a hruler
}
-static QCString extractTitleId(QCString &title)
+static QCString extractTitleId(QCString &title, int level)
{
//static QRegExp r1("^[a-z_A-Z][a-z_A-Z0-9\\-]*:");
static QRegExp r2("\\{#[a-z_A-Z][a-z_A-Z0-9\\-]*\\}");
@@ -1244,6 +1242,14 @@ static QCString extractTitleId(QCString &title)
//printf("found id='%s' title='%s'\n",id.data(),title.data());
return id;
}
+ if ((level > 0) && (level <= Config_getInt(TOC_INCLUDE_HEADINGS)))
+ {
+ static int autoId = 0;
+ QCString id;
+ id.sprintf("autotoc_md%d",autoId++);
+ //printf("auto-generated id='%s' title='%s'\n",id.data(),title.data());
+ return id;
+ }
//printf("no id found in title '%s'\n",title.data());
return "";
}
@@ -1275,7 +1281,7 @@ static int isAtxHeader(const char *data,int size,
// store result
convertStringFragment(header,data+i,end-i);
- id = extractTitleId(header);
+ id = extractTitleId(header, level);
if (!id.isEmpty()) // strip #'s between title and id
{
i=header.length()-1;
@@ -2084,7 +2090,7 @@ static QCString processBlocks(const QCString &s,int indent)
while (pi<size && data[pi]==' ') pi++;
QCString header,id;
convertStringFragment(header,data+pi,i-pi-1);
- id = extractTitleId(header);
+ id = extractTitleId(header, level);
//printf("header='%s' is='%s'\n",header.data(),id.data());
if (!header.isEmpty())
{
@@ -2195,6 +2201,29 @@ static QCString processBlocks(const QCString &s,int indent)
return out.get();
}
+/** returns TRUE if input string docs starts with \@page or \@mainpage command */
+static bool isExplicitPage(const QCString &docs)
+{
+ int i=0;
+ const char *data = docs.data();
+ if (data)
+ {
+ int size=docs.size();
+ while (i<size && (data[i]==' ' || data[i]=='\n'))
+ {
+ i++;
+ }
+ if (i<size+1 &&
+ (data[i]=='\\' || data[i]=='@') &&
+ (qstrncmp(&data[i+1],"page ",5)==0 || qstrncmp(&data[i+1],"mainpage",8)==0)
+ )
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
static QCString extractPageTitle(QCString &docs,QCString &id)
{
int ln=0;
@@ -2225,7 +2254,7 @@ static QCString extractPageTitle(QCString &docs,QCString &id)
QCString lns;
lns.fill('\n',ln);
docs=lns+docs.mid(end2);
- id = extractTitleId(title);
+ id = extractTitleId(title, 0);
//printf("extractPageTitle(title='%s' docs='%s' id='%s')\n",title.data(),docs.data(),id.data());
return title;
}
@@ -2368,23 +2397,26 @@ void MarkdownFileParser::parseInput(const char *fileName,
QCString fn = QFileInfo(fileName).fileName().utf8();
static QCString mdfileAsMainPage = Config_getString(USE_MDFILE_AS_MAINPAGE);
if (id.isEmpty()) id = markdownFileNameToId(fileName);
- if (!mdfileAsMainPage.isEmpty() &&
- (fn==mdfileAsMainPage || // name reference
- QFileInfo(fileName).absFilePath()==
- QFileInfo(mdfileAsMainPage).absFilePath()) // file reference with path
- )
+ if (!isExplicitPage(docs))
{
- docs.prepend("@mainpage "+title+"\n");
- }
- else if (id=="mainpage" || id=="index")
- {
- if (title.isEmpty()) title = titleFn;
- docs.prepend("@mainpage "+title+"\n");
- }
- else
- {
- if (title.isEmpty()) title = titleFn;
- docs.prepend("@page "+id+" "+title+"\n");
+ if (!mdfileAsMainPage.isEmpty() &&
+ (fn==mdfileAsMainPage || // name reference
+ QFileInfo(fileName).absFilePath()==
+ QFileInfo(mdfileAsMainPage).absFilePath()) // file reference with path
+ )
+ {
+ docs.prepend("@mainpage "+title+"\n");
+ }
+ else if (id=="mainpage" || id=="index")
+ {
+ if (title.isEmpty()) title = titleFn;
+ docs.prepend("@mainpage "+title+"\n");
+ }
+ else
+ {
+ if (title.isEmpty()) title = titleFn;
+ docs.prepend("@page "+id+" "+title+"\n");
+ }
}
int lineNr=1;
int position=0;
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 5aa8154..952be64 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -1422,6 +1422,12 @@ void MemberDef::writeDeclaration(OutputList &ol,
Definition *d=0;
ASSERT (cd!=0 || nd!=0 || fd!=0 || gd!=0); // member should belong to something
if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd;
+ if (d==gd) // see bug 753608
+ {
+ if (getClassDef()) d = getClassDef();
+ else if (getNamespaceDef()) d = getNamespaceDef();
+ else if (getFileDef()) d = getFileDef();
+ }
//_writeTagData(compoundType);
_addToSearchIndex();
@@ -2071,11 +2077,9 @@ void MemberDef::_writeCallGraph(OutputList &ol)
{
msg("Generating call graph for function %s\n",qPrint(qualifiedName()));
ol.disable(OutputGenerator::Man);
- ol.startParagraph();
ol.startCallGraph();
ol.parseText(theTranslator->trCallGraph());
ol.endCallGraph(callGraph);
- ol.endParagraph();
ol.enableAll();
}
}
@@ -2096,11 +2100,9 @@ void MemberDef::_writeCallerGraph(OutputList &ol)
{
msg("Generating caller graph for function %s\n",qPrint(qualifiedName()));
ol.disable(OutputGenerator::Man);
- ol.startParagraph();
ol.startCallGraph();
ol.parseText(theTranslator->trCallerGraph());
ol.endCallGraph(callerGraph);
- ol.endParagraph();
ol.enableAll();
}
}
@@ -2340,6 +2342,7 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
ol.startDescTable(theTranslator->trEnumerationValues());
}
+ ol.startDescTableRow();
ol.addIndexItem(fmd->name(),ciname);
ol.addIndexItem(ciname,fmd->name());
@@ -2389,6 +2392,7 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
fmd,fmd->documentation()+"\n",TRUE,FALSE);
}
ol.endDescTableData();
+ ol.endDescTableRow();
}
}
}
@@ -2526,7 +2530,9 @@ void MemberDef::_writeGroupInclude(OutputList &ol,bool inGroup)
/*! Writes the "detailed documentation" section of this member to
* all active output formats.
*/
-void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
+void MemberDef::writeDocumentation(MemberList *ml,
+ int memCount,int memTotal,
+ OutputList &ol,
const char *scName,
Definition *container,
bool inGroup,
@@ -2542,8 +2548,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
//printf("MemberDef::writeDocumentation(): name=`%s' hasDocs=`%d' containerType=%d inGroup=%d sectionLinkable=%d\n",
// name().data(),hasDocs,container->definitionType(),inGroup,isDetailedSectionLinkable());
- if ( !hasDocs ) return;
- if (isEnumValue() && !showEnumValues) return;
+ //if ( !hasDocs ) return;
+ //if (isEnumValue() && !showEnumValues) return;
SrcLangExt lang = getLanguage();
//printf("member=%s lang=%d\n",name().data(),lang);
@@ -2553,11 +2559,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
QCString scopeName = scName;
QCString memAnchor = anchor();
QCString ciname = container->name();
+ Definition *scopedContainer = container; // see bug 753608
if (container->definitionType()==TypeGroup)
{
- if (getClassDef()) scopeName=getClassDef()->displayName();
- else if (getNamespaceDef()) scopeName=getNamespaceDef()->displayName();
- else if (getFileDef()) scopeName=getFileDef()->displayName();
+ if (getClassDef()) { scopeName=getClassDef()->displayName(); scopedContainer=getClassDef(); }
+ else if (getNamespaceDef()) { scopeName=getNamespaceDef()->displayName(); scopedContainer=getNamespaceDef(); }
+ else if (getFileDef()) { scopeName=getFileDef()->displayName(); scopedContainer=getFileDef(); }
ciname = ((GroupDef *)container)->groupTitle();
}
else if (container->definitionType()==TypeFile && getNamespaceDef())
@@ -2605,7 +2612,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
else if (isFunction())
{
- title+=argsString();
+ title += "()";
}
int i=0,l;
static QRegExp r("@[0-9]+");
@@ -2616,12 +2623,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
bool htmlEndLabelTable=FALSE;
QStrList sl;
- getLabels(sl,container);
+ getLabels(sl,scopedContainer);
if ((isVariable() || isTypedef()) && (i=r.match(ldef,0,&l))!=-1)
{
// find enum type and insert it in the definition
- QListIterator<MemberDef> vmli(*ml);
+ MemberListIterator vmli(*ml);
MemberDef *vmd;
bool found=FALSE;
for ( ; (vmd=vmli.current()) && !found ; ++vmli)
@@ -2629,10 +2636,10 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (vmd->isEnumerate() && ldef.mid(i,l)==vmd->name())
{
ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
- ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline);
- linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.left(i));
+ ol.startMemberDoc(ciname,name(),memAnchor,name(),memCount,memTotal,showInline);
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef.left(i));
vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef());
- linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-i-l));
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef.right(ldef.length()-i-l));
found=TRUE;
}
@@ -2641,7 +2648,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{
//printf("Anonymous compound `%s'\n",cname.data());
ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
- ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline);
+ ol.startMemberDoc(ciname,name(),memAnchor,name(),memCount,memTotal,showInline);
// search for the last anonymous compound name in the definition
int si=ldef.find(' '),pi,ei=i+l;
if (si==-1) si=0;
@@ -2657,13 +2664,13 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
// last ei characters of ldef contain pointer/reference specifiers
int ni=ldef.find("::",si);
if (ni>=ei) ei=ni+2;
- linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-ei));
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef.right(ldef.length()-ei));
}
}
else // not an enum value or anonymous compound
{
ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
- ol.startMemberDoc(ciname,name(),memAnchor,title,showInline);
+ ol.startMemberDoc(ciname,name(),memAnchor,title,memCount,memTotal,showInline);
ClassDef *cd=getClassDef();
NamespaceDef *nd=getNamespaceDef();
@@ -2767,12 +2774,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (optVhdl)
{
- hasParameterList=VhdlDocGen::writeVHDLTypeDocumentation(this,container,ol);
+ hasParameterList=VhdlDocGen::writeVHDLTypeDocumentation(this,scopedContainer,ol);
}
else
{
linkifyText(TextGeneratorOLImpl(ol),
- container,
+ scopedContainer,
getBodyDef(),
this,
substitute(ldef,"::",sep)
@@ -2789,12 +2796,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
//ol.docify(" = ");
ol.docify(" ");
QCString init = m_impl->initializer.simplifyWhiteSpace();
- linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,init);
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,init);
}
else
{
ol.writeNonBreakableSpace(3);
- linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,m_impl->initializer);
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,m_impl->initializer);
}
}
if (excpString()) // add exception list
@@ -2902,7 +2909,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{
ol.startParagraph();
ol.generateDoc(briefFile(),briefLine(),
- getOuterScope()?getOuterScope():container,this,
+ scopedContainer,this,
brief,FALSE,FALSE,0,TRUE,FALSE);
ol.endParagraph();
}
@@ -2919,13 +2926,13 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
else
{
- ol.generateDoc(docFile(),docLine(),getOuterScope()?getOuterScope():container,this,detailed+"\n",TRUE,FALSE);
+ ol.generateDoc(docFile(),docLine(),scopedContainer,this,detailed+"\n",TRUE,FALSE);
}
if (!inbodyDocumentation().isEmpty())
{
ol.generateDoc(inbodyFile(),inbodyLine(),
- getOuterScope()?getOuterScope():container,this,
+ scopedContainer,this,
inbodyDocumentation()+"\n",TRUE,FALSE);
}
}
@@ -2934,7 +2941,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{
if (!inbodyDocumentation().isEmpty())
{
- ol.generateDoc(inbodyFile(),inbodyLine(),getOuterScope()?getOuterScope():container,this,inbodyDocumentation()+"\n",TRUE,FALSE);
+ ol.generateDoc(inbodyFile(),inbodyLine(),scopedContainer,this,inbodyDocumentation()+"\n",TRUE,FALSE);
}
}
@@ -2959,7 +2966,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
// feed the result to the documentation parser
ol.generateDoc(
docFile(),docLine(),
- getOuterScope()?getOuterScope():container,
+ scopedContainer,
this, // memberDef
paramDocs, // docStr
TRUE, // indexWords
@@ -2968,7 +2975,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
- _writeEnumValues(ol,container,cfname,ciname,cname);
+ _writeEnumValues(ol,scopedContainer,cfname,ciname,cname);
_writeReimplements(ol);
_writeReimplementedBy(ol);
_writeCategoryRelation(ol);
@@ -3113,43 +3120,47 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container)
ClassDef *cd = m_impl->accessorClass;
//printf("===> %s::anonymous: %s\n",name().data(),cd?cd->name().data():"<none>");
- ol.startInlineMemberType();
- ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
+ if (container && container->definitionType()==Definition::TypeClass &&
+ !((ClassDef*)container)->isJavaEnum())
+ {
+ ol.startInlineMemberType();
+ ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
- QCString ts = fieldType();
+ QCString ts = fieldType();
- if (cd) // cd points to an anonymous struct pointed to by this member
- // so we add a link to it from the type column.
- {
- int i=0;
- const char *prefixes[] = { "struct ","union ","class ", 0 };
- const char **p = prefixes;
- while (*p)
+ if (cd) // cd points to an anonymous struct pointed to by this member
+ // so we add a link to it from the type column.
{
- int l=qstrlen(*p);
- if (ts.left(l)==*p)
+ int i=0;
+ const char *prefixes[] = { "struct ","union ","class ", 0 };
+ const char **p = prefixes;
+ while (*p)
{
- ol.writeString(*p);
- i=l;
+ int l=qstrlen(*p);
+ if (ts.left(l)==*p)
+ {
+ ol.writeString(*p);
+ i=l;
+ }
+ p++;
}
- p++;
+ ol.writeObjectLink(cd->getReference(),
+ cd->getOutputFileBase(),
+ cd->anchor(),ts.mid(i));
}
- ol.writeObjectLink(cd->getReference(),
- cd->getOutputFileBase(),
- cd->anchor(),ts.mid(i));
- }
- else // use standard auto linking
- {
- linkifyText(TextGeneratorOLImpl(ol), // out
- scope, // scope
- getBodyDef(), // fileScope
- this, // self
- ts, // text
- TRUE // autoBreak
- );
+ else // use standard auto linking
+ {
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ scope, // scope
+ getBodyDef(), // fileScope
+ this, // self
+ ts, // text
+ TRUE // autoBreak
+ );
+ }
+ ol.endDoxyAnchor(cfname,memAnchor);
+ ol.endInlineMemberType();
}
- ol.endDoxyAnchor(cfname,memAnchor);
- ol.endInlineMemberType();
ol.startInlineMemberName();
ol.docify(doxyName);
diff --git a/src/memberdef.h b/src/memberdef.h
index 19a37ea..cda1baf 100644
--- a/src/memberdef.h
+++ b/src/memberdef.h
@@ -380,7 +380,7 @@ class MemberDef : public Definition
void writeDeclaration(OutputList &ol,
ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
bool inGroup, ClassDef *inheritFrom=0,const char *inheritId=0);
- void writeDocumentation(MemberList *ml,OutputList &ol,
+ void writeDocumentation(MemberList *ml,int memCount,int memTotal,OutputList &ol,
const char *scopeName,Definition *container,
bool inGroup,bool showEnumValues=FALSE,bool
showInline=FALSE);
diff --git a/src/membergroup.cpp b/src/membergroup.cpp
index cbda94d..aaa504f 100644
--- a/src/membergroup.cpp
+++ b/src/membergroup.cpp
@@ -147,7 +147,8 @@ void MemberGroup::addGroupedInheritedMembers(OutputList &ol,ClassDef *cd,
for (li.toFirst();(md=li.current());++li)
{
//printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType());
- if (lt==md->getSectionList(m_parent)->listType())
+ MemberList *ml = md->getSectionList(m_parent);
+ if (ml && lt==ml->listType())
{
MemberList ml(lt);
ml.append(md);
@@ -165,7 +166,8 @@ int MemberGroup::countGroupedInheritedMembers(MemberListType lt)
for (li.toFirst();(md=li.current());++li)
{
//printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType());
- if (lt==md->getSectionList(m_parent)->listType())
+ MemberList *ml = md->getSectionList(m_parent);
+ if (ml && lt==ml->listType())
{
count++;
}
diff --git a/src/memberlist.cpp b/src/memberlist.cpp
index 1b81108..5349030 100644
--- a/src/memberlist.cpp
+++ b/src/memberlist.cpp
@@ -233,11 +233,6 @@ void MemberList::countDocMembers(bool countEnumValues)
//printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
}
-bool MemberList::insert(uint index,const MemberDef *md)
-{
- return QList<MemberDef>::insert(index,md);
-}
-
void MemberList::inSort(const MemberDef *md)
{
QList<MemberDef>::inSort(md);
@@ -248,11 +243,67 @@ void MemberList::append(const MemberDef *md)
QList<MemberDef>::append(md);
}
-MemberListIterator::MemberListIterator(const QList<MemberDef> &l) :
+void MemberList::remove(const MemberDef *md)
+{
+ QList<MemberDef>::remove(md);
+}
+
+void MemberList::sort()
+{
+ QList<MemberDef>::sort();
+}
+
+uint MemberList::count() const
+{
+ return QList<MemberDef>::count();
+}
+
+int MemberList::findRef(const MemberDef *md) const
+{
+ return QList<MemberDef>::findRef(md);
+}
+
+MemberDef *MemberList::getFirst() const
+{
+ return QList<MemberDef>::getFirst();
+}
+
+MemberDef *MemberList::take(uint index)
+{
+ return QList<MemberDef>::take(index);
+}
+
+MemberListIterator::MemberListIterator(const MemberList &l) :
QListIterator<MemberDef>(l)
{
}
+int MemberList::countEnumValues(MemberDef *md,bool setAnonEnumType) const
+{
+ int enumVars=0;
+ MemberListIterator vmli(*this);
+ MemberDef *vmd;
+ QCString name(md->name());
+ int i=name.findRev("::");
+ if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
+ if (name[0]=='@') // anonymous enum => append variables
+ {
+ for ( ; (vmd=vmli.current()) ; ++vmli)
+ {
+ QCString vtype=vmd->typeString();
+ if ((vtype.find(name))!=-1)
+ {
+ enumVars++;
+ if (setAnonEnumType)
+ {
+ vmd->setAnonymousEnumType(md);
+ }
+ }
+ }
+ }
+ return enumVars;
+}
+
bool MemberList::declVisible() const
{
MemberListIterator mli(*this);
@@ -277,26 +328,9 @@ bool MemberList::declVisible() const
return TRUE;
case MemberType_Enumeration:
{
- int enumVars=0;
- MemberListIterator vmli(*this);
- MemberDef *vmd;
- QCString name(md->name());
- int i=name.findRev("::");
- if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
- if (name[0]=='@') // anonymous enum => append variables
- {
- for ( ; (vmd=vmli.current()) ; ++vmli)
- {
- QCString vtype=vmd->typeString();
- if ((vtype.find(name))!=-1)
- {
- enumVars++;
- }
- }
- }
// if this is an anonymous enum and there are variables of this
// enum type (i.e. enumVars>0), then we do not show the enum here.
- if (enumVars==0) // show enum here
+ if (countEnumValues(md,FALSE)==0) // show enum here
{
return TRUE;
}
@@ -368,27 +402,9 @@ void MemberList::writePlainDeclarations(OutputList &ol,
}
case MemberType_Enumeration:
{
- int enumVars=0;
- MemberListIterator vmli(*this);
- MemberDef *vmd;
- QCString name(md->name());
- int i=name.findRev("::");
- if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
- if (name[0]=='@') // anonymous enum => append variables
- {
- for ( ; (vmd=vmli.current()) ; ++vmli)
- {
- QCString vtype=vmd->typeString();
- if ((vtype.find(name))!=-1)
- {
- enumVars++;
- vmd->setAnonymousEnumType(md);
- }
- }
- }
// if this is an anonymous enum and there are variables of this
// enum type (i.e. enumVars>0), then we do not show the enum here.
- if (enumVars==0 && !hideUndocMembers) // show enum here
+ if (countEnumValues(md,TRUE)==0) // show enum here
{
//printf("Enum!!\n");
if (first)
@@ -672,13 +688,44 @@ void MemberList::writeDocumentation(OutputList &ol,
ol.endGroupHeader(showInline ? 2 : 0);
}
ol.startMemberDocList();
-
+
MemberListIterator mli(*this);
MemberDef *md;
- for ( ; (md=mli.current()) ; ++mli)
+
+ // count the number of overloaded members
+ QDict<uint> overloadTotalDict(67);
+ QDict<uint> overloadCountDict(67);
+ overloadTotalDict.setAutoDelete(TRUE);
+ overloadCountDict.setAutoDelete(TRUE);
+ for (mli.toFirst() ; (md=mli.current()) ; ++mli)
+ {
+ if (md->isDetailedSectionVisible(m_inGroup,container->definitionType()==Definition::TypeFile) &&
+ !(md->isEnumValue() && !showInline))
+ {
+ uint *pCount = overloadTotalDict.find(md->name());
+ if (pCount)
+ {
+ (*pCount)++;
+ }
+ else
+ {
+ overloadTotalDict.insert(md->name(),new uint(1));
+ overloadCountDict.insert(md->name(),new uint(1));
+ }
+ }
+ }
+
+ for (mli.toFirst() ; (md=mli.current()) ; ++mli)
{
- md->writeDocumentation(this,ol,scopeName,container,
- m_inGroup,showEnumValues,showInline);
+ if (md->isDetailedSectionVisible(m_inGroup,container->definitionType()==Definition::TypeFile) &&
+ !(md->isEnumValue() && !showInline))
+ {
+ uint overloadCount = *overloadTotalDict.find(md->name());
+ uint *pCount = overloadCountDict.find(md->name());
+ md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container,
+ m_inGroup,showEnumValues,showInline);
+ (*pCount)++;
+ }
}
if (memberGroupList)
{
@@ -701,14 +748,19 @@ void MemberList::writeSimpleDocumentation(OutputList &ol,
//printf("MemberList count=%d\n",numDocMembers());
if (numDocMembers()==0) return;
- ol.startMemberDocSimple();
+ ClassDef *cd = 0;
+ if (container && container->definitionType()==Definition::TypeClass)
+ {
+ cd = (ClassDef*)container;
+ }
+ ol.startMemberDocSimple(cd && cd->isJavaEnum());
MemberListIterator mli(*this);
MemberDef *md;
for ( ; (md=mli.current()) ; ++mli)
{
md->writeMemberDocSimple(ol,container);
}
- ol.endMemberDocSimple();
+ ol.endMemberDocSimple(cd && cd->isJavaEnum());
}
// separate member pages
@@ -716,12 +768,37 @@ void MemberList::writeDocumentationPage(OutputList &ol,
const char *scopeName, Definition *container)
{
static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
+
+ // count the number of overloaded members
+ QDict<uint> overloadTotalDict(67);
+ QDict<uint> overloadCountDict(67);
+ overloadTotalDict.setAutoDelete(TRUE);
+ overloadCountDict.setAutoDelete(TRUE);
MemberListIterator mli(*this);
MemberDef *md;
- for ( ; (md=mli.current()) ; ++mli)
+ for (mli.toFirst() ; (md=mli.current()) ; ++mli)
{
if (md->isDetailedSectionLinkable())
{
+ uint *pCount = overloadTotalDict.find(md->name());
+ if (pCount)
+ {
+ (*pCount)++;
+ }
+ else
+ {
+ overloadTotalDict.insert(md->name(),new uint(1));
+ overloadCountDict.insert(md->name(),new uint(1));
+ }
+ }
+ }
+
+ for ( mli.toFirst() ; (md=mli.current()) ; ++mli)
+ {
+ if (md->isDetailedSectionLinkable())
+ {
+ uint overloadCount = *overloadTotalDict.find(md->name());
+ uint *pCount = overloadCountDict.find(md->name());
QCString diskName=md->getOutputFileBase();
QCString title=md->qualifiedName();
startFile(ol,diskName,md->name(),title,HLI_None,!generateTreeView,diskName);
@@ -734,7 +811,8 @@ void MemberList::writeDocumentationPage(OutputList &ol,
if (generateTreeView)
{
- md->writeDocumentation(this,ol,scopeName,container,m_inGroup);
+ md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container,m_inGroup);
+ (*pCount)++;
ol.endContents();
endFileWithNavPath(container,ol);
}
@@ -749,7 +827,8 @@ void MemberList::writeDocumentationPage(OutputList &ol,
ol.writeString(" </td>\n");
ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
- md->writeDocumentation(this,ol,scopeName,container,m_inGroup);
+ md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container,m_inGroup);
+ (*pCount)++;
ol.writeString(" </td>\n");
ol.writeString(" </tr>\n");
@@ -758,15 +837,15 @@ void MemberList::writeDocumentationPage(OutputList &ol,
endFile(ol);
}
}
- if (memberGroupList)
+ }
+ if (memberGroupList)
+ {
+ //printf("MemberList::writeDocumentation() -- member groups\n");
+ MemberGroupListIterator mgli(*memberGroupList);
+ MemberGroup *mg;
+ for (;(mg=mgli.current());++mgli)
{
- //printf("MemberList::writeDocumentation() -- member groups\n");
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeDocumentationPage(ol,scopeName,container);
- }
+ mg->writeDocumentationPage(ol,scopeName,container);
}
}
}
diff --git a/src/memberlist.h b/src/memberlist.h
index c293d22..38f0e89 100644
--- a/src/memberlist.h
+++ b/src/memberlist.h
@@ -29,17 +29,27 @@ class MemberGroupList;
class StorageIntf;
/** A list of MemberDef objects. */
-class MemberList : public QList<MemberDef>
-{
+class MemberList : private QList<MemberDef>
+{
+ friend class MemberListIterator;
public:
MemberList();
MemberList(MemberListType lt);
~MemberList();
MemberListType listType() const { return m_listType; }
static QCString listTypeAsString(MemberListType type);
- bool insert(uint index,const MemberDef *md);
+
+ /* ---- standard QList methods ---- */
void inSort(const MemberDef *md);
void append(const MemberDef *md);
+ void remove(const MemberDef *md);
+ void sort();
+ uint count() const;
+ int findRef(const MemberDef *md) const;
+ MemberDef *getFirst() const;
+ MemberDef *take(uint index);
+
+
int varCount() const { ASSERT(m_numDecMembers!=-1); return m_varCnt; }
int funcCount() const { ASSERT(m_numDecMembers!=-1); return m_funcCnt; }
int enumCount() const { ASSERT(m_numDecMembers!=-1); return m_enumCnt; }
@@ -82,6 +92,7 @@ class MemberList : public QList<MemberDef>
private:
int compareValues(const MemberDef *item1,const MemberDef *item2) const;
+ int countEnumValues(MemberDef *md,bool setAnonEnumType) const;
int m_varCnt;
int m_funcCnt;
int m_enumCnt;
@@ -97,13 +108,14 @@ class MemberList : public QList<MemberDef>
bool m_inFile; // is this list part of a file definition
MemberListType m_listType;
bool m_needsSorting;
+ QDict<int> m_overloadCount;
};
/** An iterator for MemberDef objects in a MemberList. */
class MemberListIterator : public QListIterator<MemberDef>
{
public:
- MemberListIterator(const QList<MemberDef> &list);
+ MemberListIterator(const MemberList &list);
virtual ~MemberListIterator() {}
};
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index ce50302..c04fa7b 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -42,7 +42,14 @@ NamespaceDef::NamespaceDef(const char *df,int dl,int dc,
{
if (fName)
{
- fileName = stripExtension(fName);
+ if (lref)
+ {
+ fileName = stripExtension(fName);
+ }
+ else
+ {
+ fileName = convertNameToFile(stripExtension(fName));
+ }
}
else
{
@@ -90,8 +97,14 @@ NamespaceDef::~NamespaceDef()
void NamespaceDef::setFileName(const QCString &fn)
{
- fileName="namespace";
- fileName+=fn;
+ if (isReference())
+ {
+ fileName = "namespace"+fn;
+ }
+ else
+ {
+ fileName = convertNameToFile("namespace"+fn);
+ }
}
void NamespaceDef::distributeMemberGroupDocumentation()
@@ -796,16 +809,9 @@ void NamespaceDef::addUsingDeclaration(Definition *d)
}
}
-QCString NamespaceDef::getOutputFileBase() const
-{
- if (isReference())
- {
- return fileName;
- }
- else
- {
- return convertNameToFile(fileName);
- }
+QCString NamespaceDef::getOutputFileBase() const
+{
+ return fileName;
}
Definition *NamespaceDef::findInnerCompound(const char *n)
diff --git a/src/outputgen.h b/src/outputgen.h
index c3099df..830fd49 100644
--- a/src/outputgen.h
+++ b/src/outputgen.h
@@ -299,6 +299,8 @@ class BaseOutputDocInterface : public CodeOutputInterface
virtual void writeNonBreakableSpace(int) = 0;
virtual void startDescTable(const char *title) = 0;
virtual void endDescTable() = 0;
+ virtual void startDescTableRow() = 0;
+ virtual void endDescTableRow() = 0;
virtual void startDescTableTitle() = 0;
virtual void endDescTableTitle() = 0;
virtual void startDescTableData() = 0;
@@ -402,7 +404,7 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void endMemberGroup(bool) = 0;
virtual void insertMemberAlign(bool) = 0;
virtual void startMemberDoc(const char *,const char *,
- const char *,const char *,bool) = 0;
+ const char *,const char *,int,int,bool) = 0;
virtual void endMemberDoc(bool) = 0;
virtual void startDoxyAnchor(const char *fName,const char *manName,
const char *anchor,const char *name,
@@ -468,8 +470,8 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void endConstraintDocs() = 0;
virtual void endConstraintList() = 0;
- virtual void startMemberDocSimple() = 0;
- virtual void endMemberDocSimple() = 0;
+ virtual void startMemberDocSimple(bool) = 0;
+ virtual void endMemberDocSimple(bool) = 0;
virtual void startInlineMemberType() = 0;
virtual void endInlineMemberType() = 0;
virtual void startInlineMemberName() = 0;
diff --git a/src/outputlist.cpp b/src/outputlist.cpp
index 79330d8..93a1b6e 100644
--- a/src/outputlist.cpp
+++ b/src/outputlist.cpp
@@ -353,6 +353,7 @@ FORALL5(const char *a1,const char *a2,const char *a3,const char *a4,const char *
FORALL5(const char *a1,const char *a2,const char *a3,const char *a4,bool a5,a1,a2,a3,a4,a5)
FORALL6(const char *a1,const char *a2,const char *a3,const char *a4,const char *a5,const char *a6,a1,a2,a3,a4,a5,a6)
FORALL6(const char *a1,const DocLinkInfo &a2,const char *a3,const char *a4,const SourceLinkInfo &a5,const SourceLinkInfo &a6,a1,a2,a3,a4,a5,a6)
+FORALL7(const char *a1,const char *a2,const char *a3,const char *a4,int a5,int a6,bool a7,a1,a2,a3,a4,a5,a6,a7)
//--------------------------------------------------------------------------
diff --git a/src/outputlist.h b/src/outputlist.h
index 4abb100..78a2ea0 100644
--- a/src/outputlist.h
+++ b/src/outputlist.h
@@ -259,8 +259,9 @@ class OutputList : public OutputDocInterface
void writeChar(char c)
{ forall(&OutputGenerator::writeChar,c); }
void startMemberDoc(const char *clName,const char *memName,
- const char *anchor,const char *title,bool showInline)
- { forall(&OutputGenerator::startMemberDoc,clName,memName,anchor,title,showInline); }
+ const char *anchor,const char *title,
+ int memCount,int memTotal,bool showInline)
+ { forall(&OutputGenerator::startMemberDoc,clName,memName,anchor,title,memCount,memTotal,showInline); }
void endMemberDoc(bool hasArgs)
{ forall(&OutputGenerator::endMemberDoc,hasArgs); }
void startDoxyAnchor(const char *fName,const char *manName,
@@ -371,6 +372,10 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startDescTable,title); }
void endDescTable()
{ forall(&OutputGenerator::endDescTable); }
+ void startDescTableRow()
+ { forall(&OutputGenerator::startDescTableRow); }
+ void endDescTableRow()
+ { forall(&OutputGenerator::endDescTableRow); }
void startDescTableTitle()
{ forall(&OutputGenerator::startDescTableTitle); }
void endDescTableTitle()
@@ -447,10 +452,10 @@ class OutputList : public OutputDocInterface
void endConstraintList()
{ forall(&OutputGenerator::endConstraintList); }
- void startMemberDocSimple()
- { forall(&OutputGenerator::startMemberDocSimple); }
- void endMemberDocSimple()
- { forall(&OutputGenerator::endMemberDocSimple); }
+ void startMemberDocSimple(bool b)
+ { forall(&OutputGenerator::startMemberDocSimple,b); }
+ void endMemberDocSimple(bool b)
+ { forall(&OutputGenerator::endMemberDocSimple,b); }
void startInlineMemberType()
{ forall(&OutputGenerator::startInlineMemberType); }
void endInlineMemberType()
@@ -546,6 +551,7 @@ class OutputList : public OutputDocInterface
FORALLPROTO5(const char *,const char *,const char *,const char *,bool);
FORALLPROTO6(const char *,const char *,const char *,const char *,const char *,const char *);
FORALLPROTO6(const char *,const DocLinkInfo &,const char *,const char *,const SourceLinkInfo &,const SourceLinkInfo &);
+ FORALLPROTO7(const char *,const char *,const char *,const char *,int,int,bool);
OutputList(const OutputList &ol);
QList<OutputGenerator> m_outputs;
diff --git a/src/pagedef.cpp b/src/pagedef.cpp
index 1abcb0d..6146a3c 100644
--- a/src/pagedef.cpp
+++ b/src/pagedef.cpp
@@ -308,6 +308,6 @@ void PageDef::setNestingLevel(int l)
void PageDef::setShowToc(bool b)
{
- m_showToc = b;
+ m_showToc |= b;
}
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index 38ebbb2..ef5cbc2 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -653,8 +653,8 @@ void PerlModDocVisitor::visit(DocVerbatim *s)
m_output.add("<programlisting>");
parseCode(m_ci,s->context(),s->text(),FALSE,0);
m_output.add("</programlisting>");
-#endif
return;
+#endif
case DocVerbatim::Verbatim: type = "preformatted"; break;
case DocVerbatim::HtmlOnly: type = "htmlonly"; break;
case DocVerbatim::RtfOnly: type = "rtfonly"; break;
@@ -667,6 +667,14 @@ void PerlModDocVisitor::visit(DocVerbatim *s)
case DocVerbatim::PlantUML: type = "plantuml"; break;
}
openItem(type);
+ if (s->hasCaption())
+ {
+ openSubBlock("caption");
+ QListIterator<DocNode> cli(s->children());
+ DocNode *n;
+ for (cli.toFirst();(n=cli.current());++cli) n->accept(this);
+ closeSubBlock();
+ }
m_output.addFieldQuotedString("content", s->text());
closeItem();
}
@@ -708,6 +716,12 @@ void PerlModDocVisitor::visit(DocInclude *inc)
case DocInclude::LatexInclude: type = "latexonly"; break;
case DocInclude::VerbInclude: type = "preformatted"; break;
case DocInclude::Snippet: return;
+ case DocInclude::SnipWithLines: return;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
openItem(type);
m_output.addFieldQuotedString("content", inc->text());
@@ -897,6 +911,7 @@ void PerlModDocVisitor::visitPre(DocSection *s)
{
QCString sect = QCString().sprintf("sect%d",s->level());
openItem(sect);
+ m_output.addFieldQuotedString("title", s->title());
openSubBlock("content");
}
@@ -1260,17 +1275,43 @@ void PerlModDocVisitor::visitPre(DocParamList *pl)
DocNode *param;
for (li.toFirst();(param=li.current());++li)
{
- QCString s;
+ QCString name;
if (param->kind()==DocNode::Kind_Word)
{
- s = ((DocWord*)param)->word();
+ name = ((DocWord*)param)->word();
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- s = ((DocLinkedWord*)param)->word();
+ name = ((DocLinkedWord*)param)->word();
}
+
+ QCString dir = "";
+ DocParamSect *sect = 0;
+ if (pl->parent()->kind()==DocNode::Kind_ParamSect)
+ {
+ sect=(DocParamSect*)pl->parent();
+ }
+ if (sect && sect->hasInOutSpecifier())
+ {
+ if (pl->direction()!=DocParamSect::Unspecified)
+ {
+ if (pl->direction()==DocParamSect::In)
+ {
+ dir = "in";
+ }
+ else if (pl->direction()==DocParamSect::Out)
+ {
+ dir = "out";
+ }
+ else if (pl->direction()==DocParamSect::InOut)
+ {
+ dir = "in,out";
+ }
+ }
+ }
+
m_output.openHash()
- .addFieldQuotedString("name", s)
+ .addFieldQuotedString("name", name).addFieldQuotedString("dir", dir)
.closeHash();
}
m_output.closeList()
diff --git a/src/plantuml.cpp b/src/plantuml.cpp
index 288cbc0..169968e 100644
--- a/src/plantuml.cpp
+++ b/src/plantuml.cpp
@@ -43,7 +43,7 @@ QCString writePlantUMLSource(const QCString &outDir,const QCString &fileName,con
{
err("Could not open file %s for writing\n",baseName.data());
}
- QCString text = "@startuml";
+ QCString text = "@startuml\n";
text+=content;
text+="@enduml\n";
file.writeBlock( text, text.length() );
diff --git a/src/portable.cpp b/src/portable.cpp
index 5886793..1983fe7 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -448,4 +448,27 @@ bool portable_isAbsolutePath(const char *fileName)
return false;
}
-
+/**
+ * Correct a possible wrong PATH variable
+ *
+ * This routine was inspired by the cause for bug 766059 was that in the Windows path there were forward slahes.
+ */
+void portable_correct_path(void)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ const char *p = portable_getenv("PATH");
+ char *q = (char *)malloc(strlen(p) + 1);
+ strcpy(q, p);
+ bool found = false;
+ for (int i = 0 ; i < strlen(q); i++)
+ {
+ if (q[i] == '/')
+ {
+ q[i] = '\\';
+ found = true;
+ }
+ }
+ if (found) portable_setenv("PATH",q);
+ free(q);
+#endif
+}
diff --git a/src/portable.h b/src/portable.h
index 1471ce1..c5578a3 100644
--- a/src/portable.h
+++ b/src/portable.h
@@ -35,6 +35,7 @@ void portable_sysTimerStop();
double portable_getSysElapsedTime();
void portable_sleep(int ms);
bool portable_isAbsolutePath(const char *fileName);
+void portable_correct_path(void);
extern "C" {
void * portable_iconv_open(const char* tocode, const char* fromcode);
diff --git a/src/pre.l b/src/pre.l
index 13ca91f..e89a61c 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1737,6 +1737,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x SkipString
%x CopyLine
%x CopyString
+%x CopyStringFtn
%x Include
%x IncludeID
%x EndImport
@@ -1850,6 +1851,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputChar(*yytext);
BEGIN( CopyString );
}
+<CopyLine>\' {
+ if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
+ outputChar(*yytext);
+ BEGIN( CopyStringFtn );
+ }
<CopyString>[^\"\\\r\n]+ {
outputArray(yytext,(int)yyleng);
}
@@ -1860,6 +1866,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputChar(*yytext);
BEGIN( CopyLine );
}
+<CopyStringFtn>[^\'\\\r\n]+ {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtn>\\. {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtn>\' {
+ outputChar(*yytext);
+ BEGIN( CopyLine );
+ }
<CopyLine>{ID}/{BN}{0,80}"(" {
g_expectGuard = FALSE;
Define *def=0;
diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h
index b86670a..d1dbb74 100644
--- a/src/printdocvisitor.h
+++ b/src/printdocvisitor.h
@@ -22,6 +22,7 @@
#include <qglobal.h>
#include "docvisitor.h"
#include "htmlentity.h"
+#include "message.h"
/*! Concrete visitor implementation for pretty printing */
class PrintDocVisitor : public DocVisitor
@@ -170,6 +171,12 @@ class PrintDocVisitor : public DocVisitor
case DocInclude::LatexInclude: printf("latexinclude"); break;
case DocInclude::VerbInclude: printf("verbinclude"); break;
case DocInclude::Snippet: printf("snippet"); break;
+ case DocInclude::SnipWithLines: printf("snipwithlines"); break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
printf("\"/>");
}
diff --git a/src/pycode.l b/src/pycode.l
index 44adb3f..a31a0ed 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -1007,18 +1007,34 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
codify(yytext);
endFontClass();
}
+ "self."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER}"(" {
+ codify("self.");
+ findMemberLink(*g_code,&yytext[5]);
+ }
"self."{IDENTIFIER}/"(" {
codify("self.");
findMemberLink(*g_code,&yytext[5]);
}
+ "self."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER} {
+ codify("self.");
+ findMemberLink(*g_code,&yytext[5]);
+ }
"self."{IDENTIFIER} {
codify("self.");
findMemberLink(*g_code,&yytext[5]);
}
+ "cls."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER}"(" {
+ codify("cls.");
+ findMemberLink(*g_code,&yytext[4]);
+ }
"cls."{IDENTIFIER}/"(" {
codify("cls.");
findMemberLink(*g_code,&yytext[4]);
}
+ "cls."{IDENTIFIER}/"."({IDENTIFIER}".")*{IDENTIFIER} {
+ codify("cls.");
+ findMemberLink(*g_code,&yytext[4]);
+ }
"cls."{IDENTIFIER} {
codify("cls.");
findMemberLink(*g_code,&yytext[4]);
@@ -1126,6 +1142,10 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
codify(yytext);
}
+ "\n" {
+ codifyLines(yytext);
+ }
+
":" {
codify(yytext);
@@ -1514,8 +1534,8 @@ static void adjustScopesAndSuites(unsigned indentLength)
void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
const QCString &s,bool exBlock, const char *exName,
- FileDef *fd,int startLine,int endLine,bool /*inlineFragment*/,
- MemberDef *,bool,Definition *searchCtx,bool collectXRefs)
+ FileDef *fd,int startLine,int endLine,bool inlineFragment,
+ MemberDef *,bool,Definition *searchCtx,bool collectXRefs)
{
//printf("***parseCode()\n");
@@ -1531,22 +1551,22 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
g_needsTermination = FALSE;
g_searchCtx=searchCtx;
g_collectXRefs=collectXRefs;
- if (endLine!=-1)
- g_inputLines = endLine+1;
- else
- g_inputLines = countLines();
-
if (startLine!=-1)
g_yyLineNr = startLine;
else
g_yyLineNr = 1;
+ if (endLine!=-1)
+ g_inputLines = endLine+1;
+ else
+ g_inputLines = g_yyLineNr + countLines() - 1;
+
g_exampleBlock = exBlock;
g_exampleName = exName;
g_sourceFileDef = fd;
bool cleanupSourceDef = FALSE;
- if (fd==0)
+ if (exBlock && fd==0)
{
// create a dummy filedef for the example
g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
@@ -1557,6 +1577,7 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
setCurrentDoc("l00001");
}
+ g_includeCodeFragment = inlineFragment;
// Starts line 1 on the output
startCodeLine();
diff --git a/src/pyscanner.l b/src/pyscanner.l
index 35d305d..3bebe0e 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -1205,51 +1205,49 @@ STARTDOCSYMS "##"
current->initializer += " ";
}
{B} { // spaces
+ current->initializer += yytext;
}
{INTNUMBER} { // integer value
- current->type = "int";
+ if (current-> type.isEmpty()) current->type = "int";
current->initializer += yytext;
- BEGIN(VariableEnd);
}
{FLOATNUMBER} { // floating point value
- current->type = "float";
+ if (current->type.isEmpty()) current->type = "float";
current->initializer += yytext;
- BEGIN(VariableEnd);
}
{BOOL} { // boolean value
- current->type = "bool";
+ if (current->type.isEmpty()) current->type = "bool";
current->initializer += yytext;
- BEGIN(VariableEnd);
}
{STRINGPREFIX}?"'" { // string
- current->type = "string";
+ if (current->type.isEmpty()) current->type = "string";
current->initializer += yytext;
g_copyString=&current->initializer;
- g_stringContext=VariableEnd;
+ g_stringContext=VariableDec;
BEGIN( SingleQuoteString );
}
{STRINGPREFIX}?"\"" { // string
- current->type = "string";
+ if (current->type.isEmpty()) current->type = "string";
current->initializer += yytext;
g_copyString=&current->initializer;
- g_stringContext=VariableEnd;
+ g_stringContext=VariableDec;
BEGIN( DoubleQuoteString );
}
{TRIDOUBLEQUOTE} { // start of a comment block
- current->type = "string";
+ if (current->type.isEmpty()) current->type = "string";
current->initializer += yytext;
g_doubleQuote=TRUE;
g_copyString=&current->initializer;
- g_stringContext=VariableEnd;
+ g_stringContext=VariableDec;
BEGIN(TripleString);
}
{TRISINGLEQUOTE} { // start of a comment block
- current->type = "string";
+ if (current->type.isEmpty()) current->type = "string";
current->initializer += yytext;
g_doubleQuote=FALSE;
g_copyString=&current->initializer;
- g_stringContext=VariableEnd;
+ g_stringContext=VariableDec;
BEGIN(TripleString);
}
"(" { // tuple, only when direct after =
@@ -1283,6 +1281,20 @@ STARTDOCSYMS "##"
BEGIN( VariableEnd );
}
{IDENTIFIER} {
+ // do something based on the type of the IDENTIFIER
+ if (current->type.isEmpty())
+ {
+ QListIterator<Entry> eli(*(current_root->children()));
+ Entry *child;
+ for (eli.toFirst();(child=eli.current());++eli)
+ {
+ if (child->name == QCString(yytext))
+ {
+ current->type = child->type;
+ break;
+ }
+ }
+ }
g_start_init = FALSE;
current->initializer+=yytext;
}
diff --git a/src/resourcemgr.cpp b/src/resourcemgr.cpp
index 6bc1da4..ab7422a 100644
--- a/src/resourcemgr.cpp
+++ b/src/resourcemgr.cpp
@@ -56,7 +56,7 @@ void ResourceMgr::registerResources(const Resource resources[],int numResources)
}
}
-bool ResourceMgr::copyCategory(const char *categoryName,const char *targetDir) const
+bool ResourceMgr::writeCategory(const char *categoryName,const char *targetDir) const
{
QDictIterator<Resource> it(p->resources);
const Resource *res;
@@ -64,8 +64,11 @@ bool ResourceMgr::copyCategory(const char *categoryName,const char *targetDir) c
{
if (qstrcmp(res->category,categoryName)==0)
{
- if (!copyResource(res->name,targetDir))
+ QCString pathName = QCString(targetDir)+"/"+res->name;
+ QFile f(pathName);
+ if (!f.open(IO_WriteOnly) || f.writeBlock((const char *)res->data,res->size)!=res->size)
{
+ err("Failed to write resource '%s' to directory '%s'\n",res->name,targetDir);
return FALSE;
}
}
diff --git a/src/resourcemgr.h b/src/resourcemgr.h
index 57b3e37..6e1587d 100644
--- a/src/resourcemgr.h
+++ b/src/resourcemgr.h
@@ -38,8 +38,8 @@ class ResourceMgr
/** Registers an array of resources */
void registerResources(const Resource resources[],int numResources);
- /** Copies all resource belonging to a given category to a given target directory */
- bool copyCategory(const char *categoryName,const char *targetDir) const;
+ /** Writes all resource belonging to a given category to a given target directory */
+ bool writeCategory(const char *categoryName,const char *targetDir) const;
/** Copies a registered resource to a given target directory */
bool copyResource(const char *name,const char *targetDir) const;
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 07a1046..c85b638 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -386,7 +386,14 @@ void RTFDocVisitor::visit(DocInclude *inc)
inc->text(),
langExt,
inc->isExample(),
- inc->exampleFile(), &fd);
+ inc->exampleFile(),
+ &fd, // fileDef,
+ -1, // start line
+ -1, // end line
+ FALSE, // inline fragment
+ 0, // memberDef
+ TRUE // show line numbers
+ );
m_t << "\\par";
m_t << "}" << endl;
}
@@ -398,7 +405,14 @@ void RTFDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(),
inc->text(),langExt,inc->isExample(),
- inc->exampleFile());
+ inc->exampleFile(),
+ 0, // fileDef
+ -1, // startLine
+ -1, // endLine
+ TRUE, // inlineFragment
+ 0, // memberDef
+ FALSE // show line numbers
+ );
m_t << "\\par";
m_t << "}" << endl;
break;
@@ -430,6 +444,35 @@ void RTFDocVisitor::visit(DocInclude *inc)
);
m_t << "}";
break;
+ case DocInclude::SnipWithLines:
+ {
+ QFileInfo cfi( inc->file() );
+ FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ m_t << "{" << endl;
+ if (!m_lastIsPara) m_t << "\\par" << endl;
+ m_t << rtf_Style_Reset << getStyle("CodeExample");
+ Doxygen::parserManager->getParser(inc->extension())
+ ->parseCode(m_ci,
+ inc->context(),
+ extractBlock(inc->text(),inc->blockId()),
+ langExt,
+ inc->isExample(),
+ inc->exampleFile(),
+ &fd,
+ lineBlock(inc->text(),inc->blockId()),
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
+ TRUE // show line number
+ );
+ m_t << "}";
+ }
+ break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
m_lastIsPara=TRUE;
}
@@ -1015,17 +1058,17 @@ void RTFDocVisitor::visitPre(DocHtmlHeader *header)
heading.sprintf("Heading%d",level);
// set style
m_t << rtf_Style[heading]->reference;
- // make table of contents entry
- m_t << "{\\tc\\tcl \\v " << level << "}";
+ // make open table of contents entry that will be closed in visitPost method
+ m_t << "{\\tc\\tcl" << level << " ";
m_lastIsPara=FALSE;
-
}
void RTFDocVisitor::visitPost(DocHtmlHeader *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlHeader)}\n");
- m_t << "\\par";
+ // close open table of contens entry
+ m_t << "} \\par";
m_t << "}" << endl; // end section
m_lastIsPara=TRUE;
}
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index f5b997e..053d450 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -1482,6 +1482,8 @@ void RTFGenerator::startMemberDoc(const char *clname,
const char *memname,
const char *,
const char *,
+ int,
+ int,
bool showInline)
{
DBG_RTF(t << "{\\comment startMemberDoc}" << endl)
@@ -1984,50 +1986,67 @@ void RTFGenerator::endMemberList()
void RTFGenerator::startDescTable(const char *title)
{
DBG_RTF(t << "{\\comment (startDescTable) }" << endl)
- startSimpleSect(EnumValues,0,0,title);
- startDescForItem();
- //t << "{" << endl;
- //incrementIndentLevel();
- //t << rtf_Style_Reset << rtf_CList_DepthStyle();
+ t << "{\\par" << endl;
+ t << "{" << rtf_Style["Heading5"]->reference << endl;
+ docify(title);
+ t << ":\\par}" << endl;
+ t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ t << "\\trowd \\trgaph108\\trleft426\\tblind426"
+ "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
+ "\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
+ "\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
+ "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
+ "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
+ "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
+ int i,columnPos[2] = { 25, 100 };
+ for (i=0;i<2;i++)
+ {
+ t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
+ "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
+ "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
+ "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
+ "\\cltxlrtb "
+ "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << endl;
+ }
+ t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
}
void RTFGenerator::endDescTable()
{
- //decrementIndentLevel();
DBG_RTF(t << "{\\comment (endDescTable)}" << endl)
- endDescForItem();
- endSimpleSect();
- //t << "}" << endl;
- //t << rtf_Style_Reset << styleStack.top();
+ t << "}" << endl;
+}
+
+void RTFGenerator::startDescTableRow()
+{
+}
+
+void RTFGenerator::endDescTableRow()
+{
}
void RTFGenerator::startDescTableTitle()
{
- //t << rtf_BList_DepthStyle() << endl;
DBG_RTF(t << "{\\comment (startDescTableTitle) }" << endl)
- startBold();
- startEmphasis();
+ t << "{\\qr ";
}
void RTFGenerator::endDescTableTitle()
{
DBG_RTF(t << "{\\comment (endDescTableTitle) }" << endl)
- endEmphasis();
- endBold();
- t << " ";
+ t << "\\cell }";
}
void RTFGenerator::startDescTableData()
{
DBG_RTF(t << "{\\comment (startDescTableData) }" << endl)
- m_omitParagraph = FALSE;
+ t << "{";
}
void RTFGenerator::endDescTableData()
{
DBG_RTF(t << "{\\comment (endDescTableData) }" << endl)
- newParagraph();
- m_omitParagraph = TRUE;
+ t << "\\cell }{\\row }" << endl;
}
// a style for list formatted as a "bulleted list"
@@ -2904,12 +2923,20 @@ void RTFGenerator::endInlineHeader()
t << "}" << endl;
}
-void RTFGenerator::startMemberDocSimple()
+void RTFGenerator::startMemberDocSimple(bool isEnum)
{
DBG_RTF(t << "{\\comment (startMemberDocSimple)}" << endl)
t << "{\\par" << endl;
t << "{" << rtf_Style["Heading5"]->reference << endl;
- t << theTranslator->trCompoundMembers() << ":\\par}" << endl;
+ if (isEnum)
+ {
+ t << theTranslator->trEnumerationValues();
+ }
+ else
+ {
+ t << theTranslator->trCompoundMembers();
+ }
+ t << ":\\par}" << endl;
t << rtf_Style_Reset << rtf_DList_DepthStyle();
t << "\\trowd \\trgaph108\\trleft426\\tblind426"
"\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
@@ -2918,8 +2945,14 @@ void RTFGenerator::startMemberDocSimple()
"\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
- int i,columnPos[3] = { 25, 50, 100 };
- for (i=0;i<3;i++)
+ int i,n=3,columnPos[3] = { 25, 50, 100 };
+ if (isEnum)
+ {
+ columnPos[0]=30;
+ columnPos[1]=100;
+ n=2;
+ }
+ for (i=0;i<n;i++)
{
t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
@@ -2931,7 +2964,7 @@ void RTFGenerator::startMemberDocSimple()
t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
}
-void RTFGenerator::endMemberDocSimple()
+void RTFGenerator::endMemberDocSimple(bool)
{
DBG_RTF(t << "{\\comment (endMemberDocSimple)}" << endl)
t << "}" << endl;
diff --git a/src/rtfgen.h b/src/rtfgen.h
index f0f1f6e..27dd490 100644
--- a/src/rtfgen.h
+++ b/src/rtfgen.h
@@ -138,7 +138,7 @@ class RTFGenerator : public OutputGenerator
void startDescItem();
void endDescItem();
void lineBreak(const char *style=0);
- void startMemberDoc(const char *,const char *,const char *,const char *,bool);
+ void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
void endMemberDoc(bool);
void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
void endDoxyAnchor(const char *,const char *);
@@ -193,6 +193,8 @@ class RTFGenerator : public OutputGenerator
void startDescTable(const char *title);
void endDescTable();
+ void startDescTableRow();
+ void endDescTableRow();
void startDescTableTitle();
void endDescTableTitle();
void startDescTableData();
@@ -242,8 +244,8 @@ class RTFGenerator : public OutputGenerator
void endConstraintDocs();
void endConstraintList();
- void startMemberDocSimple();
- void endMemberDocSimple();
+ void startMemberDocSimple(bool);
+ void endMemberDocSimple(bool);
void startInlineMemberType();
void endInlineMemberType();
void startInlineMemberName();
diff --git a/src/scanner.l b/src/scanner.l
index 9ccd628..6c69224 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -1977,6 +1977,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
current->section=Entry::USINGDECL_SEC;
}
current_root->addSubEntry(current);
+ previous = current;
current = new Entry ;
initEntry();
BEGIN(Using);
@@ -6224,6 +6225,11 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
handleCommentBlock(docBlock.data(),current->brief.isEmpty());
BEGIN( docBlockContext );
}
+<DocLine>[^\n]*/"\n"{B}*"//"[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
+ docBlock+=yytext;
+ handleCommentBlock(docBlock.data(),current->brief.isEmpty());
+ BEGIN( docBlockContext );
+ }
<DocLine>[^\n]*/"\n" { // whole line
docBlock+=yytext;
handleCommentBlock(docBlock.data(),current->brief.isEmpty());
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index 670249e..6bc8789 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -60,7 +60,7 @@ const char * schema_queries[][2] = {
{ "innerclass",
"CREATE TABLE IF NOT EXISTS innerclass (\n"
"\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
- "\trefid TEXT NOT NULL,\n"
+ "\trefid INTEGER NOT NULL,\n"
"\tprot INTEGER NOT NULL,\n"
"\tname TEXT NOT NULL\n"
");"
@@ -92,47 +92,64 @@ const char * schema_queries[][2] = {
{ "memberdef",
"CREATE TABLE IF NOT EXISTS memberdef (\n"
"\t-- All processed identifiers.\n"
- "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
- "\tid_file INTEGER NOT NULL, -- file where this identifier is located\n"
- "\tline INTEGER NOT NULL, -- line where this identifier is located\n"
- "\tcolumn INTEGER NOT NULL, -- column where this identifier is located\n"
- "\trefid TEXT NOT NULL, -- see the refids table\n"
- "\tname TEXT NOT NULL,\n"
- "\tdefinition TEXT,\n"
- "\ttype TEXT,\n"
- "\targsstring TEXT,\n"
- "\tscope TEXT,\n"
- "\tinitializer TEXT,\n"
- "\tprot INTEGER DEFAULT 0, -- 0:public 1:protected 2:private 3:package\n"
- "\tconst INTEGER DEFAULT 0, -- 0:non-constant 1:constant\n"
- "\tvirt INTEGER DEFAULT 0, -- 0:non-virtual 1:virtual 2:pure-virtual\n"
- "\tstatic INTEGER DEFAULT 0, -- 0:non-static 1:static\n"
- "\texplicit INTEGER DEFAULT 0,\n"
- "\tinline INTEGER DEFAULT 0,\n"
- "\tfinal INTEGER DEFAULT 0,\n"
- "\tsealed INTEGER DEFAULT 0,\n"
- "\tnew INTEGER DEFAULT 0,\n"
- "\toptional INTEGER DEFAULT 0,\n"
- "\trequired INTEGER DEFAULT 0,\n"
- "\tmutable INTEGER DEFAULT 0,\n"
- "\tinitonly INTEGER DEFAULT 0,\n"
- "\treadable INTEGER DEFAULT 0,\n"
- "\twritable INTEGER DEFAULT 0,\n"
- "\tgettable INTEGER DEFAULT 0,\n"
- "\tsettable INTEGER DEFAULT 0,\n"
- "\taccessor INTEGER DEFAULT 0,\n"
- "\taddable INTEGER DEFAULT 0,\n"
- "\tremovable INTEGER DEFAULT 0,\n"
- "\traisable INTEGER DEFAULT 0,\n"
+ "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
+ "\trefid INTEGER NOT NULL, -- see the refids table\n"
+ "\tname TEXT NOT NULL,\n"
+ "\tdefinition TEXT,\n"
+ "\ttype TEXT,\n"
+ "\targsstring TEXT,\n"
+ "\tscope TEXT,\n"
+ "\tinitializer TEXT,\n"
+ "\tbitfield TEXT,\n"
+ "\tread TEXT,\n"
+ "\twrite TEXT,\n"
+ "\tprot INTEGER DEFAULT 0, -- 0:public 1:protected 2:private 3:package\n"
+ "\tstatic INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tconst INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\texplicit INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tinline INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tfinal INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tsealed INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tnew INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\toptional INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\trequired INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tvolatile INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tvirt INTEGER DEFAULT 0, -- 0:no 1:virtual 2:pure-virtual\n"
+ "\tmutable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tinitonly INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tattribute INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tproperty INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\treadonly INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tbound INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tconstrained INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\ttransient INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tmaybevoid INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tmaybedefault INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tmaybeambiguous INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\treadable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\twritable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tgettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tprivategettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tprotectedgettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tsettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tprivatesettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tprotectedsettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\taccessor INTEGER DEFAULT 0, -- 0:no 1:assign 2:copy 3:retain 4:string 5:weak\n"
+ "\taddable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\tremovable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
+ "\traisable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
/// @todo make a `kind' table
- "\tkind INTEGER DEFAULT 0, -- 0:define 1:function 2:variable 3:typedef 4:enum 5:enumvalue 6:signal 7:slot 8:friend 9:DCOP 10:property 11:event\n"
- "\tid_bodyfile INTEGER DEFAULT 0, -- file of definition\n"
- "\tbodystart INTEGER DEFAULT 0, -- starting line of definition\n"
- "\tbodyend INTEGER DEFAULT 0, -- ending line of definition\n"
+ "\tkind INTEGER DEFAULT 0, -- 0:define 1:function 2:variable 3:typedef 4:enum 5:enumvalue 6:signal 7:slot 8:friend 9:DCOP 10:property 11:event\n"
+ "\tbodystart INTEGER DEFAULT 0, -- starting line of definition\n"
+ "\tbodyend INTEGER DEFAULT 0, -- ending line of definition\n"
+ "\tid_bodyfile INTEGER DEFAULT 0, -- file of definition\n"
+ "\tid_file INTEGER NOT NULL, -- file where this identifier is located\n"
+ "\tline INTEGER NOT NULL, -- line where this identifier is located\n"
+ "\tcolumn INTEGER NOT NULL, -- column where this identifier is located\n"
/// @todo make a `detaileddescription' table
"\tdetaileddescription TEXT,\n"
"\tbriefdescription TEXT,\n"
- "\tinbodydescription TEXTi\n"
+ "\tinbodydescription TEXT\n"
");"
},
{ "compounddef",
@@ -141,7 +158,7 @@ const char * schema_queries[][2] = {
"\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
"\tname TEXT NOT NULL,\n"
"\tkind TEXT NOT NULL,\n"
- "\trefid TEXT NOT NULL,\n"
+ "\trefid INTEGER NOT NULL,\n"
"\tprot INTEGER NOT NULL,\n"
"\tid_file INTEGER NOT NULL,\n"
"\tline INTEGER NOT NULL,\n"
@@ -153,7 +170,7 @@ const char * schema_queries[][2] = {
"\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
"\tbase TEXT NOT NULL,\n"
"\tderived TEXT NOT NULL,\n"
- "\trefid TEXT NOT NULL,\n"
+ "\trefid INTEGER NOT NULL,\n"
"\tprot INTEGER NOT NULL,\n"
"\tvirt INTEGER NOT NULL\n"
");"
@@ -163,7 +180,7 @@ const char * schema_queries[][2] = {
"\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
"\tbase TEXT NOT NULL,\n"
"\tderived TEXT NOT NULL,\n"
- "\trefid TEXT NOT NULL,\n"
+ "\trefid INTEGER NOT NULL,\n"
"\tprot INTEGER NOT NULL,\n"
"\tvirt INTEGER NOT NULL\n"
");"
@@ -175,7 +192,7 @@ const char * schema_queries[][2] = {
"\tattributes TEXT,\n"
"\ttype TEXT,\n"
"\tdeclname TEXT,\n"
- "\tdefnname TEXT,\n"
+ "\tdefname TEXT,\n"
"\tarray TEXT,\n"
"\tdefval TEXT,\n"
"\tbriefdescription TEXT\n"
@@ -192,7 +209,7 @@ const char * schema_queries[][2] = {
{ "innernamespaces",
"CREATE TABLE IF NOT EXISTS innernamespaces (\n"
"\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
- "\trefid TEXT NOT NULL,\n"
+ "\trefid INTEGER NOT NULL,\n"
"\tname TEXT NOT NULL\n"
");"
}
@@ -251,9 +268,121 @@ SqlStmt xrefs_insert= {"INSERT INTO xrefs "
};
//////////////////////////////////////////////////////
SqlStmt memberdef_insert={"INSERT INTO memberdef "
- "( refid, prot, static, const, explicit, inline, final, sealed, new, optional, required, virt, mutable, initonly, readable, writable, gettable, settable, accessor, addable, removable, raisable, name, type, definition, argsstring, scope, initializer, kind, id_bodyfile, bodystart, bodyend, id_file, line, column, detaileddescription, briefdescription, inbodydescription)"
+ "("
+ "refid,"
+ "name,"
+ "definition,"
+ "type,"
+ "argsstring,"
+ "scope,"
+ "initializer,"
+ "bitfield,"
+ "read,"
+ "write,"
+ "prot,"
+ "static,"
+ "const,"
+ "explicit,"
+ "inline,"
+ "final,"
+ "sealed,"
+ "new,"
+ "optional,"
+ "required,"
+ "volatile,"
+ "virt,"
+ "mutable,"
+ "initonly,"
+ "attribute,"
+ "property,"
+ "readonly,"
+ "bound,"
+ "constrained,"
+ "transient,"
+ "maybevoid,"
+ "maybedefault,"
+ "maybeambiguous,"
+ "readable,"
+ "writable,"
+ "gettable,"
+ "protectedsettable,"
+ "protectedgettable,"
+ "settable,"
+ "privatesettable,"
+ "privategettable,"
+ "accessor,"
+ "addable,"
+ "removable,"
+ "raisable,"
+ "kind,"
+ "bodystart,"
+ "bodyend,"
+ "id_bodyfile,"
+ "id_file,"
+ "line,"
+ "column,"
+ "detaileddescription,"
+ "briefdescription,"
+ "inbodydescription"
+ ")"
"VALUES "
- "(:refid,:prot,:static,:const,:explicit,:inline,:final,:sealed,:new,:optional,:required,:virt,:mutable,:initonly,:readable,:writable,:gettable,:settable,:accessor,:addable,:removable,:raisable,:name,:type,:definition,:argsstring,:scope,:initializer,:kind,:id_bodyfile,:bodystart,:bodyend,:id_file,:line,:column,:detaileddescription,:briefdescription,:inbodydescription)"
+ "("
+ ":refid,"
+ ":name,"
+ ":definition,"
+ ":type,"
+ ":argsstring,"
+ ":scope,"
+ ":initializer,"
+ ":bitfield,"
+ ":read,"
+ ":write,"
+ ":prot,"
+ ":static,"
+ ":const,"
+ ":explicit,"
+ ":inline,"
+ ":final,"
+ ":sealed,"
+ ":new,"
+ ":optional,"
+ ":required,"
+ ":volatile,"
+ ":virt,"
+ ":mutable,"
+ ":initonly,"
+ ":attribute,"
+ ":property,"
+ ":readonly,"
+ ":bound,"
+ ":constrained,"
+ ":transient,"
+ ":maybevoid,"
+ ":maybedefault,"
+ ":maybeambiguous,"
+ ":readable,"
+ ":writable,"
+ ":gettable,"
+ ":privategettable,"
+ ":protectedgettable,"
+ ":settable,"
+ ":privatesettable,"
+ ":privategettable,"
+ ":accessor,"
+ ":addable,"
+ ":removable,"
+ ":raisable,"
+ ":kind,"
+ ":bodystart,"
+ ":bodyend,"
+ ":id_bodyfile,"
+ ":id_file,"
+ ":line,"
+ ":column,"
+ ":detaileddescription,"
+ ":briefdescription,"
+ ":inbodydescription"
+ ")"
,NULL
};
//////////////////////////////////////////////////////
@@ -282,16 +411,16 @@ SqlStmt params_select = { "SELECT rowid FROM params WHERE "
"(attributes IS NULL OR attributes=:attributes) AND "
"(type IS NULL OR type=:type) AND "
"(declname IS NULL OR declname=:declname) AND "
- "(defnname IS NULL OR defnname=:defnname) AND "
+ "(defname IS NULL OR defname=:defname) AND "
"(array IS NULL OR array=:array) AND "
"(defval IS NULL OR defval=:defval) AND "
"(briefdescription IS NULL OR briefdescription=:briefdescription)"
,NULL
};
SqlStmt params_insert = { "INSERT INTO params "
- "( attributes, type, declname, defnname, array, defval, briefdescription ) "
+ "( attributes, type, declname, defname, array, defval, briefdescription ) "
"VALUES "
- "(:attributes,:type,:declname,:defnname,:array,:defval,:briefdescription)"
+ "(:attributes,:type,:declname,:defname,:array,:defval,:briefdescription)"
,NULL
};
//////////////////////////////////////////////////////
@@ -400,11 +529,9 @@ static int insertRefid(sqlite3 *db, const char *refid)
}
-static void insertMemberReference(sqlite3 *db, const char*src, const char*dst, const char *file, int line, int column)
+static void insertMemberReference(sqlite3 *db, int refid_src, int refid_dst,
+ int id_file, int line, int column)
{
- int id_file = insertFile(db,file);
- int refid_src = insertRefid(db,src);
- int refid_dst = insertRefid(db,dst);
if (id_file==-1||refid_src==-1||refid_dst==-1)
return;
@@ -412,26 +539,20 @@ static void insertMemberReference(sqlite3 *db, const char*src, const char*dst, c
bindIntParameter(xrefs_insert,":refid_dst",refid_dst);
bindIntParameter(xrefs_insert,":id_file",id_file);
bindIntParameter(xrefs_insert,":line",line);
- bindIntParameter(xrefs_insert,":column",1);
+ bindIntParameter(xrefs_insert,":column",column);
step(db,xrefs_insert);
}
-static void insertMemberReference(sqlite3 *db, MemberDef *src, MemberDef *dst, const char*floc)
+static void insertMemberReference(sqlite3 *db, MemberDef *src, MemberDef *dst)
{
+ QCString qrefid_dst = dst->getOutputFileBase() + "_1" + dst->anchor();
+ QCString qrefid_src = src->getOutputFileBase() + "_1" + src->anchor();
if (dst->getStartBodyLine()!=-1 && dst->getBodyDef())
{
- static char file[4096];
- int line=0,column=0;
- if (floc)
- {
- int rv = sscanf(floc,"%[^:]:%d:%d",file,&line,&column);
- if (rv!=3)
- {
- msg("unable to read file:line:col location from string [%s]\n",floc);
- return;
- }
- }
- insertMemberReference(db,src->anchor().data(),dst->anchor().data(),file,line,column);
+ int refid_src = insertRefid(db,qrefid_src.data());
+ int refid_dst = insertRefid(db,qrefid_dst.data());
+ int id_file = insertFile(db,"no-file"); // TODO: replace no-file with proper file
+ insertMemberReference(db,refid_src,refid_dst,id_file,dst->getStartBodyLine(),-1);
}
}
@@ -462,7 +583,11 @@ static void insertMemberFunctionParams(sqlite3 *db,int id_memberdef,MemberDef *m
QCString *s;
while ((s=li.current()))
{
- insertMemberReference(db,md->anchor().data(),s->data(),def->getDefFileName().data(),md->getDefLine(),1);
+ QCString qrefid_src = md->getOutputFileBase() + "_1" + md->anchor();
+ int refid_src = insertRefid(db,qrefid_src.data());
+ int refid_dst = insertRefid(db,s->data());
+ int id_file = insertFile(db,stripFromPath(def->getDefFileName()));
+ insertMemberReference(db,refid_src,refid_dst,id_file,md->getDefLine(),-1);
++li;
}
bindTextParameter(params_select,":type",a->type.data());
@@ -475,8 +600,8 @@ static void insertMemberFunctionParams(sqlite3 *db,int id_memberdef,MemberDef *m
}
if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
{
- bindTextParameter(params_select,":defnname",defArg->name.data());
- bindTextParameter(params_insert,":defnname",defArg->name.data());
+ bindTextParameter(params_select,":defname",defArg->name.data());
+ bindTextParameter(params_insert,":defname",defArg->name.data());
}
if (!a->array.isEmpty())
{
@@ -517,7 +642,7 @@ static void insertMemberDefineParams(sqlite3 *db,int id_memberdef,MemberDef *md,
Argument *a;
for (ali.toFirst();(a=ali.current());++ali)
{
- bindTextParameter(params_insert,":defnname",a->type.data());
+ bindTextParameter(params_insert,":defname",a->type.data());
int id_param=step(db,params_insert,TRUE);
bindIntParameter(memberdef_params_insert,":id_memberdef",id_memberdef);
@@ -637,7 +762,8 @@ static void writeInnerClasses(sqlite3*db,const ClassSDict *cl)
{
if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes
{
- bindTextParameter(innerclass_insert,":refid",cd->getOutputFileBase(),FALSE);
+ int refid = insertRefid(db, cd->getOutputFileBase());
+ bindIntParameter(innerclass_insert,":refid", refid);
bindIntParameter(innerclass_insert,":prot",cd->protection());
bindTextParameter(innerclass_insert,":name",cd->name());
step(db,innerclass_insert);
@@ -656,7 +782,8 @@ static void writeInnerNamespaces(sqlite3 *db,const NamespaceSDict *nl)
{
if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes
{
- bindTextParameter(innernamespace_insert,":refid",nd->getOutputFileBase(),FALSE);
+ int refid = insertRefid(db, nd->getOutputFileBase());
+ bindIntParameter(innernamespace_insert,":refid",refid);
bindTextParameter(innernamespace_insert,":name",nd->name(),FALSE);
step(db,innernamespace_insert);
}
@@ -686,8 +813,8 @@ static void writeTemplateArgumentList(sqlite3* db,
{
bindTextParameter(params_select,":declname",a->name);
bindTextParameter(params_insert,":declname",a->name);
- bindTextParameter(params_select,":defnname",a->name);
- bindTextParameter(params_insert,":defnname",a->name);
+ bindTextParameter(params_select,":defname",a->name);
+ bindTextParameter(params_insert,":defname",a->name);
}
if (!a->defval.isEmpty())
{
@@ -740,8 +867,12 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
// group members are only visible in their group
//if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return;
QCString memType;
+
// memberdef
- bindTextParameter(memberdef_insert,":refid",md->anchor().data(),FALSE);
+ QCString qrefid = md->getOutputFileBase() + "_1" + md->anchor();
+ int refid = insertRefid(db, qrefid.data());
+
+ bindIntParameter(memberdef_insert,":refid", refid);
bindIntParameter(memberdef_insert,":kind",md->memberType());
bindIntParameter(memberdef_insert,":prot",md->protection());
@@ -767,6 +898,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
if (al!=0)
{
bindIntParameter(memberdef_insert,":const",al->constSpecifier);
+ bindIntParameter(memberdef_insert,":volatile",al->volatileSpecifier);
}
bindIntParameter(memberdef_insert,":explicit",md->isExplicit());
bindIntParameter(memberdef_insert,":inline",md->isInline());
@@ -778,26 +910,52 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
bindIntParameter(memberdef_insert,":virt",md->virtualness());
}
- // place in the arguments and linkify the arguments
if (md->memberType() == MemberType_Variable)
{
bindIntParameter(memberdef_insert,":mutable",md->isMutable());
bindIntParameter(memberdef_insert,":initonly",md->isInitonly());
+ bindIntParameter(memberdef_insert,":attribute",md->isAttribute());
+ bindIntParameter(memberdef_insert,":property",md->isProperty());
+ bindIntParameter(memberdef_insert,":readonly",md->isReadonly());
+ bindIntParameter(memberdef_insert,":bound",md->isBound());
+ bindIntParameter(memberdef_insert,":removable",md->isRemovable());
+ bindIntParameter(memberdef_insert,":constrained",md->isConstrained());
+ bindIntParameter(memberdef_insert,":transient",md->isTransient());
+ bindIntParameter(memberdef_insert,":maybevoid",md->isMaybeVoid());
+ bindIntParameter(memberdef_insert,":maybedefault",md->isMaybeDefault());
+ bindIntParameter(memberdef_insert,":maybeambiguous",md->isMaybeAmbiguous());
+ if (md->bitfieldString())
+ {
+ QCString bitfield = md->bitfieldString();
+ if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
+ bindTextParameter(memberdef_insert,":bitfield",bitfield.stripWhiteSpace());
+ }
}
else if (md->memberType() == MemberType_Property)
{
bindIntParameter(memberdef_insert,":readable",md->isReadable());
bindIntParameter(memberdef_insert,":writable",md->isWritable());
bindIntParameter(memberdef_insert,":gettable",md->isGettable());
+ bindIntParameter(memberdef_insert,":privategettable",md->isPrivateGettable());
+ bindIntParameter(memberdef_insert,":protectedgettable",md->isProtectedGettable());
bindIntParameter(memberdef_insert,":settable",md->isSettable());
- if (md->isAssign() || md->isCopy() || md->isRetain())
+ bindIntParameter(memberdef_insert,":privatesettable",md->isPrivateSettable());
+ bindIntParameter(memberdef_insert,":protectedsettable",md->isProtectedSettable());
+ if (md->isAssign() || md->isCopy() || md->isRetain()
+ || md->isStrong() || md->isWeak())
{
- int accessor = md->isAssign() ? md->isAssign() :
- (md->isCopy() ? md->isCopy() : md->isRetain()) ;
+ int accessor=0;
+ if (md->isAssign()) accessor = 1;
+ else if (md->isCopy()) accessor = 2;
+ else if (md->isRetain()) accessor = 3;
+ else if (md->isStrong()) accessor = 4;
+ else if (md->isWeak()) accessor = 5;
bindIntParameter(memberdef_insert,":accessor",accessor);
}
+ bindTextParameter(memberdef_insert,":read",md->getReadAccessor());
+ bindTextParameter(memberdef_insert,":write",md->getWriteAccessor());
}
else if (md->memberType() == MemberType_Event)
{
@@ -837,19 +995,6 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
bindTextParameter(memberdef_insert,":name",md->name());
- if (md->memberType() == MemberType_Property)
- {
- if (md->isReadable())
- {
- bindIntParameter(memberdef_insert,":readable",1);
- }
- if (md->isWritable())
- {
- bindIntParameter(memberdef_insert,":writable",1);
- }
- }
-
-
// Extract references from initializer
if (md->hasMultiLineInitializer() || md->hasOneLineInitializer())
{
@@ -868,7 +1013,11 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
s->data(),
md->getBodyDef()->getDefFileName().data(),
md->getStartBodyLine()));
- insertMemberReference(db,md->anchor().data(),s->data(),md->getBodyDef()->getDefFileName().data(),md->getStartBodyLine(),1);
+ QCString qrefid_src = md->getOutputFileBase() + "_1" + md->anchor();
+ int refid_src = insertRefid(db,qrefid_src.data());
+ int refid_dst = insertRefid(db,s->data());
+ int id_file = insertFile(db,stripFromPath(md->getBodyDef()->getDefFileName()));
+ insertMemberReference(db,refid_src,refid_dst,id_file,md->getStartBodyLine(),-1);
}
++li;
}
@@ -887,7 +1036,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
// File location
if (md->getDefLine() != -1)
{
- int id_file = insertFile(db,md->getDefFileName());
+ int id_file = insertFile(db,stripFromPath(md->getDefFileName()));
if (id_file!=-1)
{
bindIntParameter(memberdef_insert,":id_file",id_file);
@@ -896,7 +1045,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
if (md->getStartBodyLine()!=-1)
{
- int id_bodyfile = insertFile(db,md->getBodyDef()->absFilePath());
+ int id_bodyfile = insertFile(db,stripFromPath(md->getBodyDef()->absFilePath()));
if (id_bodyfile == -1)
{
sqlite3_clear_bindings(memberdef_insert.stmt);
@@ -933,7 +1082,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
MemberDef *rmd;
for (mdi.toFirst();(rmd=mdi.current());++mdi)
{
- insertMemberReference(db,md,rmd,mdi.currentKey());
+ insertMemberReference(db,md,rmd);//,mdi.currentKey());
}
}
// + source referenced by
@@ -944,7 +1093,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
MemberDef *rmd;
for (mdi.toFirst();(rmd=mdi.current());++mdi)
{
- insertMemberReference(db,rmd,md,mdi.currentKey());
+ insertMemberReference(db,rmd,md);//,mdi.currentKey());
}
}
}
@@ -1008,9 +1157,10 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindTextParameter(compounddef_insert,":name",cd->name());
bindTextParameter(compounddef_insert,":kind",cd->compoundTypeString(),FALSE);
bindIntParameter(compounddef_insert,":prot",cd->protection());
- bindTextParameter(compounddef_insert,":refid",cd->getOutputFileBase(),FALSE);
+ int refid = insertRefid(db, cd->getOutputFileBase());
+ bindIntParameter(compounddef_insert,":refid", refid);
- int id_file = insertFile(db,cd->getDefFileName().data());
+ int id_file = insertFile(db,stripFromPath(cd->getDefFileName()));
bindIntParameter(compounddef_insert,":id_file",id_file);
bindIntParameter(compounddef_insert,":line",cd->getDefLine());
bindIntParameter(compounddef_insert,":column",cd->getDefColumn());
@@ -1024,7 +1174,8 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
BaseClassDef *bcd;
for (bcli.toFirst();(bcd=bcli.current());++bcli)
{
- bindTextParameter(basecompoundref_insert,":refid",bcd->classDef->getOutputFileBase(),FALSE);
+ int refid = insertRefid(db, bcd->classDef->getOutputFileBase());
+ bindIntParameter(basecompoundref_insert,":refid", refid);
bindIntParameter(basecompoundref_insert,":prot",bcd->prot);
bindIntParameter(basecompoundref_insert,":virt",bcd->virt);
@@ -1057,7 +1208,8 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
{
bindTextParameter(derivedcompoundref_insert,":derived",bcd->classDef->displayName(),FALSE);
}
- bindTextParameter(derivedcompoundref_insert,":refid",bcd->classDef->getOutputFileBase(),FALSE);
+ int refid = insertRefid(db, bcd->classDef->getOutputFileBase());
+ bindIntParameter(derivedcompoundref_insert,":refid", refid);
bindIntParameter(derivedcompoundref_insert,":prot",bcd->prot);
bindIntParameter(derivedcompoundref_insert,":virt",bcd->virt);
step(db,derivedcompoundref_insert);
diff --git a/src/tagreader.cpp b/src/tagreader.cpp
index 290399a..dfa8511 100644
--- a/src/tagreader.cpp
+++ b/src/tagreader.cpp
@@ -493,14 +493,14 @@ class TagFileParser : public QXmlDefaultHandler
{
switch(m_state)
{
- case InClass: m_curClass->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString)); break;
- case InFile: m_curFile->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString)); break;
- case InNamespace: m_curNamespace->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString)); break;
- case InGroup: m_curGroup->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString)); break;
+ case InClass: m_curClass->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
+ case InFile: m_curFile->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
+ case InNamespace: m_curNamespace->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
+ case InGroup: m_curGroup->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
case InPage: m_curPage->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
- case InMember: m_curMember->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString)); break;
- case InPackage: m_curPackage->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString)); break;
- case InDir: m_curDir->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString)); break;
+ case InMember: m_curMember->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
+ case InPackage: m_curPackage->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
+ case InDir: m_curDir->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
default: warn("Unexpected tag `member' found\n"); break;
}
}
diff --git a/src/template.cpp b/src/template.cpp
index 527148c..10b3e43 100644
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -34,6 +34,7 @@
#include "message.h"
#include "util.h"
#include "resourcemgr.h"
+#include "portable.h"
#define ENABLE_TRACING 0
@@ -552,6 +553,10 @@ class TemplateContextImpl : public TemplateContext
if (m_activeEscapeIntf) m_activeEscapeIntf->enableTabbing(b);
}
bool tabbingEnabled() const { return m_tabbingEnabled; }
+ bool needsRecoding() const { return !m_encoding.isEmpty(); }
+ QCString encoding() const { return m_encoding; }
+ void setEncoding(const QCString &file,int line,const QCString &enc);
+ QCString recode(const QCString &s);
void warn(const char *fileName,int line,const char *fmt,...) const;
// index related functions
@@ -573,6 +578,8 @@ class TemplateContextImpl : public TemplateContext
bool m_tabbingEnabled;
TemplateAutoRef<TemplateStruct> m_indices;
QDict< QStack<TemplateVariant> > m_indexStacks;
+ QCString m_encoding;
+ void *m_fromUtf8;
};
//-----------------------------------------------------------------------------
@@ -1285,6 +1292,64 @@ class FilterDivisibleBy
}
};
+//--------------------------------------------------------------------
+
+/** @brief The implementation of the "isRelativeURL" filter */
+class FilterIsRelativeURL
+{
+ public:
+ static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &)
+ {
+ if (v.isValid() && v.type()==TemplateVariant::String)
+ {
+ QCString s = v.toString();
+ if (!s.isEmpty() && s.at(0)=='!') return TRUE;
+ }
+ return FALSE;
+ }
+};
+
+//--------------------------------------------------------------------
+
+/** @brief The implementation of the "isRelativeURL" filter */
+class FilterIsAbsoluteURL
+{
+ public:
+ static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &)
+ {
+ if (v.isValid() && v.type()==TemplateVariant::String)
+ {
+ QCString s = v.toString();
+ if (!s.isEmpty() && s.at(0)=='^') return TRUE;
+ }
+ return FALSE;
+ }
+};
+
+//--------------------------------------------------------------------
+
+/** @brief The implementation of the "decodeURL" filter
+ * The leading character is removed from the value in case it is a ^ or !.
+ * - ^ is used to encode a absolute URL
+ * - ! is used to encode a relative URL
+ */
+class FilterDecodeURL
+{
+ public:
+ static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &)
+ {
+ if (v.isValid() && v.type()==TemplateVariant::String)
+ {
+ QCString s = v.toString();
+ if (!s.isEmpty() && (s.at(0)=='^' || s.at(0)=='!'))
+ {
+ return s.mid(1);
+ }
+ }
+ return v;
+ }
+};
+
//--------------------------------------------------------------------
@@ -1336,25 +1401,28 @@ class TemplateFilterFactory
};
// register a handlers for each filter we support
-static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add");
-static TemplateFilterFactory::AutoRegister<FilterGet> fGet("get");
-static TemplateFilterFactory::AutoRegister<FilterRaw> fRaw("raw");
-static TemplateFilterFactory::AutoRegister<FilterList> fList("list");
-static TemplateFilterFactory::AutoRegister<FilterAppend> fAppend("append");
-static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length");
-static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap");
-static TemplateFilterFactory::AutoRegister<FilterFlatten> fFlatten("flatten");
-static TemplateFilterFactory::AutoRegister<FilterDefault> fDefault("default");
-static TemplateFilterFactory::AutoRegister<FilterPrepend> fPrepend("prepend");
-static TemplateFilterFactory::AutoRegister<FilterGroupBy> fGroupBy("groupBy");
-static TemplateFilterFactory::AutoRegister<FilterRelative> fRelative("relative");
-static TemplateFilterFactory::AutoRegister<FilterListSort> fListSort("listsort");
-static TemplateFilterFactory::AutoRegister<FilterTexLabel> fTexLabel("texLabel");
-static TemplateFilterFactory::AutoRegister<FilterTexIndex> fTexIndex("texIndex");
-static TemplateFilterFactory::AutoRegister<FilterPaginate> fPaginate("paginate");
-static TemplateFilterFactory::AutoRegister<FilterStripPath> fStripPath("stripPath");
-static TemplateFilterFactory::AutoRegister<FilterAlphaIndex> fAlphaIndex("alphaIndex");
-static TemplateFilterFactory::AutoRegister<FilterDivisibleBy> fDivisibleBy("divisibleby");
+static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add");
+static TemplateFilterFactory::AutoRegister<FilterGet> fGet("get");
+static TemplateFilterFactory::AutoRegister<FilterRaw> fRaw("raw");
+static TemplateFilterFactory::AutoRegister<FilterList> fList("list");
+static TemplateFilterFactory::AutoRegister<FilterAppend> fAppend("append");
+static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length");
+static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap");
+static TemplateFilterFactory::AutoRegister<FilterFlatten> fFlatten("flatten");
+static TemplateFilterFactory::AutoRegister<FilterDefault> fDefault("default");
+static TemplateFilterFactory::AutoRegister<FilterPrepend> fPrepend("prepend");
+static TemplateFilterFactory::AutoRegister<FilterGroupBy> fGroupBy("groupBy");
+static TemplateFilterFactory::AutoRegister<FilterRelative> fRelative("relative");
+static TemplateFilterFactory::AutoRegister<FilterListSort> fListSort("listsort");
+static TemplateFilterFactory::AutoRegister<FilterTexLabel> fTexLabel("texLabel");
+static TemplateFilterFactory::AutoRegister<FilterTexIndex> fTexIndex("texIndex");
+static TemplateFilterFactory::AutoRegister<FilterPaginate> fPaginate("paginate");
+static TemplateFilterFactory::AutoRegister<FilterStripPath> fStripPath("stripPath");
+static TemplateFilterFactory::AutoRegister<FilterDecodeURL> fDecodeURL("decodeURL");
+static TemplateFilterFactory::AutoRegister<FilterAlphaIndex> fAlphaIndex("alphaIndex");
+static TemplateFilterFactory::AutoRegister<FilterDivisibleBy> fDivisibleBy("divisibleby");
+static TemplateFilterFactory::AutoRegister<FilterIsRelativeURL> fIsRelativeURL("isRelativeURL");
+static TemplateFilterFactory::AutoRegister<FilterIsAbsoluteURL> fIsAbsoluteURL("isAbsoluteURL");
//--------------------------------------------------------------------
@@ -2303,6 +2371,7 @@ TemplateContextImpl::TemplateContextImpl(const TemplateEngine *e)
m_indexStacks.setAutoDelete(TRUE);
m_contextStack.setAutoDelete(TRUE);
m_escapeIntfDict.setAutoDelete(TRUE);
+ m_fromUtf8 = (void*)(-1);
push();
set("index",m_indices.get());
}
@@ -2312,6 +2381,49 @@ TemplateContextImpl::~TemplateContextImpl()
pop();
}
+void TemplateContextImpl::setEncoding(const QCString &templateName,int line,const QCString &enc)
+{
+ if (enc==m_encoding) return; // nothing changed
+ if (m_fromUtf8!=(void *)(-1))
+ {
+ portable_iconv_close(m_fromUtf8);
+ m_fromUtf8 = (void*)(-1);
+ }
+ m_encoding=enc;
+ if (!enc.isEmpty())
+ {
+ m_fromUtf8 = portable_iconv_open(enc,"UTF-8");
+ if (m_fromUtf8==(void*)(-1))
+ {
+ warn(templateName,line,"unsupported character conversion: '%s'->'UTF-8'\n", enc.data());
+ }
+ }
+ //printf("TemplateContextImpl::setEncoding(%s)\n",enc.data());
+}
+
+QCString TemplateContextImpl::recode(const QCString &s)
+{
+ //printf("TemplateContextImpl::recode(%s)\n",s.data());
+ int iSize = s.length();
+ int oSize = iSize*4+1;
+ QCString output(oSize);
+ size_t iLeft = iSize;
+ size_t oLeft = oSize;
+ char *iPtr = s.rawData();
+ char *oPtr = output.rawData();
+ if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
+ {
+ oSize -= (int)oLeft;
+ output.resize(oSize+1);
+ output.at(oSize)='\0';
+ return output;
+ }
+ else
+ {
+ return s;
+ }
+}
+
void TemplateContextImpl::set(const char *name,const TemplateVariant &v)
{
TemplateVariant *pv = m_contextStack.getFirst()->find(name);
@@ -2439,7 +2551,7 @@ void TemplateContextImpl::warn(const char *fileName,int line,const char *fmt,...
void TemplateContextImpl::openSubIndex(const QCString &indexName)
{
- printf("TemplateContextImpl::openSubIndex(%s)\n",indexName.data());
+ //printf("TemplateContextImpl::openSubIndex(%s)\n",indexName.data());
QStack<TemplateVariant> *stack = m_indexStacks.find(indexName);
if (!stack || stack->isEmpty() || stack->top()->type()==TemplateVariant::List) // error: no stack yet or no entry
{
@@ -2460,7 +2572,7 @@ void TemplateContextImpl::openSubIndex(const QCString &indexName)
void TemplateContextImpl::closeSubIndex(const QCString &indexName)
{
- printf("TemplateContextImpl::closeSubIndex(%s)\n",indexName.data());
+ //printf("TemplateContextImpl::closeSubIndex(%s)\n",indexName.data());
QStack<TemplateVariant> *stack = m_indexStacks.find(indexName);
if (!stack || stack->count()<3)
{
@@ -2586,16 +2698,30 @@ class TemplateNodeText : public TemplateNode
void render(FTextStream &ts, TemplateContext *c)
{
- //printf("TemplateNodeText::render(%s)\n",m_data.data());
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
+ //printf("TemplateNodeText::render(%s) needsRecoding=%d ci=%p\n",m_data.data(),ci->needsRecoding(),ci);
if (ci->spacelessEnabled())
{
- ts << ci->spacelessIntf()->remove(m_data);
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(ci->spacelessIntf()->remove(m_data));
+ }
+ else
+ {
+ ts << ci->spacelessIntf()->remove(m_data);
+ }
}
else
{
- ts << m_data;
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(m_data);
+ }
+ else
+ {
+ ts << m_data;
+ }
}
}
private:
@@ -2638,11 +2764,25 @@ class TemplateNodeVariable : public TemplateNode
}
if (ci->escapeIntf() && !v.raw())
{
- ts << ci->escapeIntf()->escape(v.toString());
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(ci->escapeIntf()->escape(v.toString()));
+ }
+ else
+ {
+ ts << ci->escapeIntf()->escape(v.toString());
+ }
}
else
{
- ts << v.toString();
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(v.toString());
+ }
+ else
+ {
+ ts << v.toString();
+ }
}
}
}
@@ -2791,7 +2931,7 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
if (guardValue.toBool()) // render nodes for the first guard that evaluated to 'true'
{
nodes->trueNodes.render(ts,c);
- processed=TRUE;
+ processed=TRUE;
}
}
else
@@ -3961,11 +4101,25 @@ class TemplateNodeCycle : public TemplateNodeCreator<TemplateNodeCycle>
}
if (ci->escapeIntf() && !v.raw())
{
- ts << ci->escapeIntf()->escape(v.toString());
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(ci->escapeIntf()->escape(v.toString()));
+ }
+ else
+ {
+ ts << ci->escapeIntf()->escape(v.toString());
+ }
}
else
{
- ts << v.toString();
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(v.toString());
+ }
+ else
+ {
+ ts << v.toString();
+ }
}
}
if (++m_index==m_args.count()) // wrap around
@@ -4109,7 +4263,14 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
int index=0,newIndex,matchLen;
while ((newIndex=marker.match(str,index,&matchLen))!=-1)
{
- ts << str.mid(index,newIndex-index); // write text before marker
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(str.mid(index,newIndex-index)); // write text before marker
+ }
+ else
+ {
+ ts << str.mid(index,newIndex-index); // write text before marker
+ }
bool ok;
uint entryIndex = str.mid(newIndex+1,matchLen-1).toUInt(&ok); // get marker id
TemplateVariant var;
@@ -4137,7 +4298,14 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
}
index=newIndex+matchLen; // set index just after marker
}
- ts << str.right(str.length()-index); // write text after last marker
+ if (ci->needsRecoding())
+ {
+ ts << ci->recode(str.right(str.length()-index)); // write text after last marker
+ }
+ else
+ {
+ ts << str.right(str.length()-index); // write text after last marker
+ }
c->pop();
delete it;
}
@@ -4244,8 +4412,7 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource>
QCString targetFile = m_asExpr->resolve(c).toString();
mkpath(ci,targetFile);
if (targetFile.isEmpty())
- {
- ci->warn(m_templateName,m_line,"invalid parameter at right side of 'as' for resource command\n");
+ { ci->warn(m_templateName,m_line,"invalid parameter at right side of 'as' for resource command\n");
}
else
{
@@ -4266,6 +4433,59 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource>
//----------------------------------------------------------
+/** @brief Class representing the 'encoding' tag in a template */
+class TemplateNodeEncoding : public TemplateNodeCreator<TemplateNodeEncoding>
+{
+ public:
+ TemplateNodeEncoding(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
+ : TemplateNodeCreator<TemplateNodeEncoding>(parser,parent,line)
+ {
+ TRACE(("{TemplateNodeEncoding(%s)\n",data.data()));
+ ExpressionParser ep(parser,line);
+ if (data.isEmpty())
+ {
+ parser->warn(m_templateName,line,"encoding tag is missing encoding argument");
+ m_encExpr = 0;
+ }
+ else
+ {
+ m_encExpr = ep.parse(data);
+ }
+ QStrList stopAt;
+ stopAt.append("endencoding");
+ parser->parse(this,line,stopAt,m_nodes);
+ parser->removeNextToken(); // skip over endencoding
+ TRACE(("}TemplateNodeEncoding(%s)\n",data.data()));
+ }
+ ~TemplateNodeEncoding()
+ {
+ delete m_encExpr;
+ }
+ void render(FTextStream &ts, TemplateContext *c)
+ {
+ TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
+ if (ci==0) return; // should not happen
+ ci->setLocation(m_templateName,m_line);
+ QCString encStr;
+ if (m_encExpr)
+ {
+ encStr = m_encExpr->resolve(c).toString();
+ }
+ QCString oldEncStr = ci->encoding();
+ if (!encStr.isEmpty())
+ {
+ ci->setEncoding(m_templateName,m_line,encStr);
+ }
+ m_nodes.render(ts,c);
+ ci->setEncoding(m_templateName,m_line,oldEncStr);
+ }
+ private:
+ ExprAst *m_encExpr;
+ TemplateNodeList m_nodes;
+};
+
+//----------------------------------------------------------
+
/** @brief Factory class for creating tag AST nodes found in a template */
class TemplateNodeFactory
{
@@ -4328,6 +4548,7 @@ static TemplateNodeFactory::AutoRegister<TemplateNodeInclude> autoRefInclu
static TemplateNodeFactory::AutoRegister<TemplateNodeMarkers> autoRefMarkers("markers");
static TemplateNodeFactory::AutoRegister<TemplateNodeTabbing> autoRefTabbing("tabbing");
static TemplateNodeFactory::AutoRegister<TemplateNodeResource> autoRefResource("resource");
+static TemplateNodeFactory::AutoRegister<TemplateNodeEncoding> autoRefEncoding("encoding");
static TemplateNodeFactory::AutoRegister<TemplateNodeSpaceless> autoRefSpaceless("spaceless");
static TemplateNodeFactory::AutoRegister<TemplateNodeIndexEntry> autoRefIndexEntry("indexentry");
static TemplateNodeFactory::AutoRegister<TemplateNodeOpenSubIndex> autoRefOpenSubIndex("opensubindex");
@@ -4715,7 +4936,8 @@ void TemplateParser::parse(
command=="endrecursetree" || command=="endspaceless" ||
command=="endmarkers" || command=="endmsg" ||
command=="endrepeat" || command=="elif" ||
- command=="endrange" || command=="endtabbing")
+ command=="endrange" || command=="endtabbing" ||
+ command=="endencoding")
{
warn(m_templateName,tok->line,"Found tag '%s' without matching start tag",command.data());
}
@@ -4866,8 +5088,23 @@ class TemplateEngine::Private
//printf("loadByName(%s,%d) {\n",fileName.data(),line);
m_includeStack.append(new IncludeEntry(IncludeEntry::Template,fileName,QCString(),line));
Template *templ = m_templateCache.find(fileName);
- if (templ==0)
+ if (templ==0) // first time template is referenced
{
+ QCString filePath = m_templateDirName+"/"+fileName;
+ QFile f(filePath);
+ if (f.open(IO_ReadOnly))
+ {
+ QFileInfo fi(filePath);
+ int size=fi.size();
+ QCString data(size+1);
+ if (f.readBlock(data.rawData(),size)==size)
+ {
+ templ = new TemplateImpl(m_engine,filePath,data,m_extension);
+ m_templateCache.insert(fileName,templ);
+ return templ;
+ }
+ }
+ // fallback to default built-in template
const QCString data = ResourceMgr::instance().getAsString(fileName);
if (!data.isEmpty())
{
@@ -4940,12 +5177,18 @@ class TemplateEngine::Private
return m_extension;
}
+ void setTemplateDir(const char *dirName)
+ {
+ m_templateDirName = dirName;
+ }
+
private:
QDict<Template> m_templateCache;
//mutable int m_indent;
TemplateEngine *m_engine;
QList<IncludeEntry> m_includeStack;
QCString m_extension;
+ QCString m_templateDirName;
};
TemplateEngine::TemplateEngine()
@@ -5003,5 +5246,9 @@ QCString TemplateEngine::outputExtension() const
return p->outputExtension();
}
+void TemplateEngine::setTemplateDir(const char *dirName)
+{
+ p->setTemplateDir(dirName);
+}
diff --git a/src/template.h b/src/template.h
index 7d6e2ff..98ae7ed 100644
--- a/src/template.h
+++ b/src/template.h
@@ -590,6 +590,9 @@ class TemplateEngine
/** Prints the current template file include stack */
void printIncludeContext(const char *fileName,int line) const;
+ /** Sets the search directory where to look for template files */
+ void setTemplateDir(const char *dirName);
+
private:
friend class TemplateNodeBlock;
friend class TemplateNodeCreate;
diff --git a/src/translator_de.h b/src/translator_de.h
index 5bab24d..8817ea8 100644
--- a/src/translator_de.h
+++ b/src/translator_de.h
@@ -127,6 +127,9 @@
// - Updated for "new since 1.8.0" version
// - Some small corrections
//
+// 2016/03/15 Carsten Schumann (carsten at familie-schumann dot info)
+// - Updated for "new since 1.8.4" version
+//
// Todo:
// - see FIXME
@@ -605,6 +608,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_4
/*! this text is used in the title page of a LaTeX document. */
virtual QCString trGeneratedBy()
{ return "Erzeugt von"; }
+
//////////////////////////////////////////////////////////////////////////
// new since 0.49-990307
@@ -2037,6 +2041,61 @@ class TranslatorGerman : public TranslatorAdapter_1_8_4
{
return "Übersicht";
}
+//////////////////////////////////////////////////////////////////////////
+// new since 1.8.4
+//////////////////////////////////////////////////////////////////////////
+ /** old style UNO IDL services: implemented interfaces */
+ virtual QCString trInterfaces()
+ { return "Exportierte Interfaces"; }
+
+ /** old style UNO IDL services: inherited services */
+ virtual QCString trServices()
+ { return "Eingebundene Dienste"; }
+
+ /** UNO IDL constant groups */
+ virtual QCString trConstantGroups()
+ { return "Konstante Gruppen"; }
+
+ /** UNO IDL constant groups */
+ virtual QCString trConstantGroupReference(const char *namespaceName)
+ {
+ QCString result=namespaceName;
+ result+=" Konstantengruppen-Referenz";
+ return result;
+ }
+
+ /** UNO IDL service page title */
+ virtual QCString trServiceReference(const char *sName)
+ {
+ QCString result=(QCString)sName;
+ result+=" Dienstreferenz";
+ return result;
+ }
+ /** UNO IDL singleton page title */
+ virtual QCString trSingletonReference(const char *sName)
+ {
+ QCString result=(QCString)sName;
+ result+=" Singleton-Referenz";
+ return result;
+ }
+ /** UNO IDL service page */
+ virtual QCString trServiceGeneratedFromFiles(bool single)
+ {
+ QCString result=(QCString)"Die Dokumentation für diesen Dienst "
+ "wurde generiert aus ";
+ if (single) result+="folgender Datei: "; else result+="folgenden Dateien: ";
+ return result;
+ }
+ /** UNO IDL singleton page */
+ virtual QCString trSingletonGeneratedFromFiles(bool single)
+ {
+ QCString result=(QCString)"Die Dokumentation für diesen Singleton wurde generiert aus ";
+
+ if (single) result+="folgender Datei:"; else result+="folgenden Dateien:";
+ return result;
+ }
+
+
//////////////////////////////////////////////////////////////////////////
diff --git a/src/translator_en.h b/src/translator_en.h
index 1fad97a..190ba79 100644
--- a/src/translator_en.h
+++ b/src/translator_en.h
@@ -35,7 +35,7 @@
files frees the maintainer from thinking about whether the
first, the second, or both files should be included or not, and
why. This holds namely for localized translators because their
- base class is changed occasionaly to adapter classes when the
+ base class is changed occasionally to adapter classes when the
Translator class changes the interface, or back to the
Translator class (by the local maintainer) when the localized
translator is made up-to-date again.
@@ -1036,10 +1036,10 @@ class TranslatorEnglish : public Translator
"<li>%A dark green arrow is used for protected inheritance.</li>\n"
"<li>%A dark red arrow is used for private inheritance.</li>\n"
"<li>%A purple dashed arrow is used if a class is contained or used "
- "by another class. The arrow is labeled with the variable(s) "
+ "by another class. The arrow is labelled with the variable(s) "
"through which the pointed class or struct is accessible.</li>\n"
"<li>%A yellow dashed arrow denotes a relation between a template instance and "
- "the template class it was instantiated from. The arrow is labeled with "
+ "the template class it was instantiated from. The arrow is labelled with "
"the template parameters of the instance.</li>\n"
"</ul>\n";
}
@@ -1494,7 +1494,7 @@ class TranslatorEnglish : public Translator
{ QCString result=dirName; result+=" Directory Reference"; return result; }
/*! This returns the word directory with or without starting capital
- * (\a first_capital) and in sigular or plural form (\a singular).
+ * (\a first_capital) and in singular or plural form (\a singular).
*/
virtual QCString trDir(bool first_capital, bool singular)
{
diff --git a/src/util.cpp b/src/util.cpp
index 2861064..efd3d3c 100755
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1648,198 +1648,275 @@ static bool findOperator2(const QCString &s,int i)
return TRUE;
}
-static const char constScope[] = { 'c', 'o', 'n', 's', 't', ':' };
-static const char virtualScope[] = { 'v', 'i', 'r', 't', 'u', 'a', 'l', ':' };
+static const char constScope[] = { 'c', 'o', 'n', 's', 't', ':' };
+static const char virtualScope[] = { 'v', 'i', 'r', 't', 'u', 'a', 'l', ':' };
+static const char operatorScope[] = { 'o', 'p', 'e', 'r', 'a', 't', 'o', 'r', '?', '?', '?' };
+
+struct CharAroundSpace
+{
+ CharAroundSpace()
+ {
+ charMap['('].before=FALSE;
+ charMap['='].before=FALSE;
+ charMap['&'].before=FALSE;
+ charMap['*'].before=FALSE;
+ charMap['['].before=FALSE;
+ charMap['|'].before=FALSE;
+ charMap['+'].before=FALSE;
+ charMap[';'].before=FALSE;
+ charMap[':'].before=FALSE;
+ charMap['/'].before=FALSE;
+
+ charMap['='].after=FALSE;
+ charMap[' '].after=FALSE;
+ charMap[']'].after=FALSE;
+ charMap['\t'].after=FALSE;
+ charMap['\n'].after=FALSE;
+ charMap[')'].after=FALSE;
+ charMap[','].after=FALSE;
+ charMap['<'].after=FALSE;
+ charMap['|'].after=FALSE;
+ charMap['+'].after=FALSE;
+ charMap['('].after=FALSE;
+ charMap['/'].after=FALSE;
+ }
+ struct CharElem
+ {
+ CharElem() : before(TRUE), after(TRUE) {}
+ bool before;
+ bool after;
+ };
+
+ CharElem charMap[256];
+};
+
+static CharAroundSpace g_charAroundSpace;
// Note: this function is not reentrant due to the use of static buffer!
QCString removeRedundantWhiteSpace(const QCString &s)
{
static bool cliSupport = Config_getBool(CPP_CLI_SUPPORT);
static bool vhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
-
+
if (s.isEmpty() || vhdl) return s;
- static GrowBuf growBuf;
- //int resultLen = 1024;
- //int resultPos = 0;
- //QCString result(resultLen);
- // we use growBuf.addChar(c) instead of result+=c to
+
+ // We use a static character array to
// improve the performance of this function
- growBuf.clear();
- uint i;
+ static char *growBuf = 0;
+ static int growBufLen = 0;
+ if (s.length()*3>growBufLen) // For input character we produce at most 3 output characters,
+ {
+ growBufLen = s.length()*3;
+ growBuf = (char *)realloc(growBuf,growBufLen+1); // add 1 for 0-terminator
+ }
+ if (growBuf==0) return s; // should not happen, only we run out of memory
+
+ char *src=s.rawData();
+ char *dst=growBuf;
+
+ uint i=0;
uint l=s.length();
uint csp=0;
uint vsp=0;
+ uint osp=0;
char c;
- for (i=0;i<l;i++)
+ char pc=0;
+ // skip leading whitespace
+ while (i<l && isspace((uchar)src[i]))
{
-nextChar:
- c=s.at(i);
+ i++;
+ }
+ for (;i<l;i++)
+ {
+ c=src[i];
+ char nc=i<l-1 ? src[i+1] : ' ';
// search for "const"
if (csp<6 && c==constScope[csp] && // character matches substring "const"
- (csp>0 || // if it is the first character
- i==0 || // the previous may not be a digit
- !isId(s.at(i-1))
+ (csp>0 || // inside search string
+ i==0 || // if it is the first character
+ !isId(pc) // the previous may not be a digit
)
)
- csp++;
+ csp++;
else // reset counter
csp=0;
// search for "virtual"
if (vsp<8 && c==virtualScope[vsp] && // character matches substring "virtual"
- (vsp>0 || // if it is the first character
- i==0 || // the previous may not be a digit
- !isId(s.at(i-1))
+ (vsp>0 || // inside search string
+ i==0 || // if it is the first character
+ !isId(pc) // the previous may not be a digit
)
)
vsp++;
else // reset counter
vsp=0;
- if (c=='"') // quoted string
- {
- i++;
- growBuf.addChar(c);
- while (i<l)
- {
- char cc=s.at(i);
- growBuf.addChar(cc);
- if (cc=='\\') // escaped character
- {
- growBuf.addChar(s.at(i+1));
- i+=2;
- }
- else if (cc=='"') // end of string
- { i++; goto nextChar; }
- else // any other character
- { i++; }
- }
- }
- else if (i<l-2 && c=='<' && // current char is a <
- (isId(s.at(i+1)) || isspace((uchar)s.at(i+1))) && // next char is an id char or space
- (i<8 || !findOperator(s,i)) // string in front is not "operator"
- )
- {
- growBuf.addChar('<');
- growBuf.addChar(' ');
- }
- else if (i>0 && c=='>' && // current char is a >
- (isId(s.at(i-1)) || isspace((uchar)s.at(i-1)) || s.at(i-1)=='*' || s.at(i-1)=='&' || s.at(i-1)=='.') && // prev char is an id char or space
- (i<8 || !findOperator(s,i)) // string in front is not "operator"
+ // search for "operator"
+ if (osp<11 && (osp>=8 || c==operatorScope[osp]) && // character matches substring "operator" followed by 3 arbitrary characters
+ (osp>0 || // inside search string
+ i==0 || // if it is the first character
+ !isId(pc) // the previous may not be a digit
)
+ )
+ osp++;
+ else // reset counter
+ osp=0;
+
+ switch(c)
{
- growBuf.addChar(' ');
- growBuf.addChar('>');
- }
- else if (i>0 && c==',' && !isspace((uchar)s.at(i-1))
- && ((i<l-1 && (isId(s.at(i+1)) || s.at(i+1)=='[')) // the [ is for attributes (see bug702170)
- || (i<l-2 && s.at(i+1)=='$' && isId(s.at(i+2))) // for PHP
- || (i<l-3 && s.at(i+1)=='&' && s.at(i+2)=='$' && isId(s.at(i+3))))) // for PHP
- {
- growBuf.addChar(',');
- growBuf.addChar(' ');
- }
- else if (i>0 &&
- (
- (s.at(i-1)==')' && isId(c)) // ")id" -> ") id"
- ||
- (c=='\'' && s.at(i-1)==' ') // "'id" -> "' id"
- ||
- (i>1 && s.at(i-2)==' ' && s.at(i-1)==' ') // " id" -> " id"
- )
- )
- {
- growBuf.addChar(' ');
- growBuf.addChar(c);
- }
- else if (c=='t' && csp==5 /*&& (i<5 || !isId(s.at(i-5)))*/ &&
- !(isId(s.at(i+1)) /*|| s.at(i+1)==' '*/ ||
- s.at(i+1)==')' ||
- s.at(i+1)==',' ||
- s.at(i+1)=='\0'
- )
- )
- // prevent const ::A from being converted to const::A
- {
- growBuf.addChar('t');
- growBuf.addChar(' ');
- if (s.at(i+1)==' ') i++;
- csp=0;
- }
- else if (c==':' && csp==6 /*&& (i<6 || !isId(s.at(i-6)))*/)
- // replace const::A by const ::A
- {
- growBuf.addChar(' ');
- growBuf.addChar(':');
- csp=0;
- }
- else if (c=='l' && vsp==7 /*&& (i<7 || !isId(s.at(i-7)))*/ &&
- !(isId(s.at(i+1)) /*|| s.at(i+1)==' '*/ ||
- s.at(i+1)==')' ||
- s.at(i+1)==',' ||
- s.at(i+1)=='\0'
- )
- )
- // prevent virtual ::A from being converted to virtual::A
- {
- growBuf.addChar('l');
- growBuf.addChar(' ');
- if (s.at(i+1)==' ') i++;
- vsp=0;
- }
- else if (c==':' && vsp==8 /*&& (i<8 || !isId(s.at(i-8)))*/)
- // replace virtual::A by virtual ::A
- {
- growBuf.addChar(' ');
- growBuf.addChar(':');
- vsp=0;
- }
- else if (!isspace((uchar)c) || // not a space
- ( i>0 && i<l-1 && // internal character
- (isId(s.at(i-1)) || s.at(i-1)==')' || s.at(i-1)==',' || s.at(i-1)=='>' || s.at(i-1)==']') &&
- (isId(s.at(i+1)) ||
- (i<l-2 && s.at(i+1)=='$' && isId(s.at(i+2))) ||
- (i<l-3 && s.at(i+1)=='&' && s.at(i+2)=='$' && isId(s.at(i+3)))
+ case '"': // quoted string
+ {
+ *dst++=c;
+ pc = c;
+ i++;
+ for (;i<l;i++) // find end of string
+ {
+ c = src[i];
+ *dst++=c;
+ if (c=='\\' && i+1<l)
+ {
+ pc = c;
+ i++;
+ c = src[i];
+ *dst+=c;
+ }
+ else if (c=='"')
+ {
+ break;
+ }
+ pc = c;
+ }
+ }
+ break;
+ case '<': // current char is a <
+ *dst++=c;
+ if (i<l-1 &&
+ (isId(nc)) && // next char is an id char
+ (osp<8) // string in front is not "operator"
+ )
+ {
+ *dst++=' '; // add extra space
+ }
+ break;
+ case '>': // current char is a >
+ if (i>0 && !isspace((uchar)pc) &&
+ (isId(pc) || pc=='*' || pc=='&' || pc=='.') && // prev char is an id char or space or *&.
+ (osp<8 || (osp==8 && pc!='-')) // string in front is not "operator>" or "operator->"
+ )
+ {
+ *dst++=' '; // add extra space in front
+ }
+ *dst++=c;
+ if (i<l-1 && (nc=='-' || nc=='&')) // '>-' -> '> -'
+ {
+ *dst++=' '; // add extra space after
+ }
+ break;
+ case ',': // current char is a ,
+ *dst++=c;
+ if (i>0 && !isspace((uchar)pc) &&
+ ((i<l-1 && (isId(nc) || nc=='[')) || // the [ is for attributes (see bug702170)
+ (i<l-2 && nc=='$' && isId(src[i+2])) || // for PHP: ',$name' -> ', $name'
+ (i<l-3 && nc=='&' && src[i+2]=='$' && isId(src[i+3])) // for PHP: ',&$name' -> ', &$name'
)
- )
- )
- {
- if (c=='\t') c=' ';
- if (c=='*' || c=='&' || c=='@' || c=='$')
- {
- //uint rl=result.length();
- uint rl=growBuf.getPos();
- if ((rl>0 && (isId(growBuf.at(rl-1)) || growBuf.at(rl-1)=='>')) &&
- ((c!='*' && c!='&') || !findOperator2(s,i)) // avoid splitting operator* and operator->* and operator&
- )
+ )
{
- growBuf.addChar(' ');
+ *dst++=' '; // add extra space after
}
- }
- else if (c=='-')
- {
- uint rl=growBuf.getPos();
- if (rl>0 && growBuf.at(rl-1)==')' && i<l-1 && s.at(i+1)=='>') // trailing return type ')->' => ') ->'
+ break;
+ case '^': // CLI 'Type^name' -> 'Type^ name'
+ case '%': // CLI 'Type%name' -> 'Type% name'
+ *dst++=c;
+ if (cliSupport && i<l-1 && (isId(nc) || nc=='-'))
{
- growBuf.addChar(' ');
+ *dst++=' '; // add extra space after
}
- }
- growBuf.addChar(c);
- if (cliSupport &&
- (c=='^' || c=='%') && i>1 && isId(s.at(i-1)) &&
- !findOperator(s,i)
- )
- {
- growBuf.addChar(' '); // C++/CLI: Type^ name and Type% name
- }
+ break;
+ case ')': // current char is a ) -> ')name' -> ') name'
+ *dst++=c;
+ if (i<l-1 && (isId(nc) || nc=='-'))
+ {
+ *dst++=' '; // add extra space after
+ }
+ break;
+ case '*':
+ if (i>0 && pc!=' ' && pc!='\t' && pc!=':' &&
+ pc!='*' && pc!='&' && pc!='(' && pc!='/' &&
+ pc!='.' && (osp<9 || (pc=='>' && osp==11)))
+ // avoid splitting &&, **, .*, operator*, operator->*
+ {
+ *dst++=' ';
+ }
+ *dst++=c;
+ break;
+ case '&':
+ if (i>0 && isId(pc))
+ {
+ *dst++=' ';
+ }
+ *dst++=c;
+ break;
+ case '@': // '@name' -> ' @name'
+ case '$': // '$name' -> ' $name'
+ case '\'': // ''name' -> '' name'
+ if (i>0 && i<l-1 && pc!='=' && pc!=':' && !isspace(pc) &&
+ isId(nc) && osp<8) // ")id" -> ") id"
+ {
+ *dst++=' ';
+ }
+ *dst++=c;
+ break;
+ case ':': // current char is a :
+ if (csp==6) // replace const::A by const ::A
+ {
+ *dst++=' ';
+ csp=0;
+ }
+ else if (vsp==8) // replace virtual::A by virtual ::A
+ {
+ *dst++=' ';
+ vsp=0;
+ }
+ *dst++=c;
+ break;
+ case ' ': // fallthrough
+ case '\n': // fallthrough
+ case '\t':
+ {
+ if (g_charAroundSpace.charMap[(uchar)pc].before &&
+ g_charAroundSpace.charMap[(uchar)nc].after &&
+ !(pc==',' && nc=='.'))
+ // remove spaces/tabs
+ {
+ *dst++=' ';
+ }
+ }
+ break;
+ default:
+ *dst++=c;
+ if (c=='t' && csp==5 && i<l-1 && // found 't' in 'const'
+ !(isId(nc) || nc==')' || nc==',' || isspace(nc))
+ ) // prevent const ::A from being converted to const::A
+ {
+ *dst++=' ';
+ csp=0;
+ }
+ else if (c=='l' && vsp==7 && i<l-1 && // found 'l' in 'virtual'
+ !(isId(nc) || nc==')' || nc==',' || isspace(nc))
+ ) // prevent virtual ::A from being converted to virtual::A
+ {
+ *dst++=' ';
+ vsp=0;
+ }
+ break;
}
+ pc=c;
}
- growBuf.addChar(0);
- //printf("removeRedundantWhiteSpace(`%s')=`%s'\n",s.data(),growBuf.get());
- //result.resize(resultPos);
- return growBuf.get();
-}
+ *dst++='\0';
+ return growBuf;
+}
/**
* Returns the position in the string where a function parameter list
@@ -2505,7 +2582,7 @@ QCString dateToString(bool includeTime)
}
else // all ok, replace current time with epoch value
{
- current.setTime_t((ulong)epoch); // TODO: add support for 64bit epoch value
+ current.setTimeUtc_t((ulong)epoch); // TODO: add support for 64bit epoch value
}
}
return theTranslator->trDateTime(current.date().year(),
@@ -2904,6 +2981,8 @@ static void stripIrrelevantString(QCString &target,const QCString &str)
So the following example, show what is stripped by this routine
for const. The same is done for volatile.
+ For Java code we also strip the "final" keyword, see bug 765070.
+
\code
const T param -> T param // not relevant
const T& param -> const T& param // const needed
@@ -2916,6 +2995,7 @@ void stripIrrelevantConstVolatile(QCString &s)
//printf("stripIrrelevantConstVolatile(%s)=",s.data());
stripIrrelevantString(s,"const");
stripIrrelevantString(s,"volatile");
+ stripIrrelevantString(s,"final");
//printf("%s\n",s.data());
}
@@ -3876,7 +3956,7 @@ static void findMembersWithSpecificName(MemberName *mn,
{
//printf(" Function with global scope name `%s' args=`%s'\n",
// mn->memberName(),args);
- MemberListIterator mli(*mn);
+ MemberNameIterator mli(*mn);
MemberDef *md;
for (mli.toFirst();(md=mli.current());++mli)
{
@@ -4023,7 +4103,7 @@ bool getDefs(const QCString &scName,
)
{
//printf(" Found fcd=%p\n",fcd);
- MemberListIterator mmli(*mn);
+ MemberNameIterator mmli(*mn);
MemberDef *mmd;
int mdist=maxInheritanceDepth;
ArgumentList *argList=0;
@@ -4147,7 +4227,7 @@ bool getDefs(const QCString &scName,
if (mn && scopeName.isEmpty() && mScope.isEmpty()) // Maybe a related function?
{
//printf("Global symbol\n");
- MemberListIterator mmli(*mn);
+ MemberNameIterator mmli(*mn);
MemberDef *mmd, *fuzzy_mmd = 0;
ArgumentList *argList = 0;
bool hasEmptyArgs = args && qstrcmp(args, "()") == 0;
@@ -4215,7 +4295,7 @@ bool getDefs(const QCString &scName,
//printf("Symbol inside existing namespace `%s' count=%d\n",
// namespaceName.data(),mn->count());
bool found=FALSE;
- MemberListIterator mmli(*mn);
+ MemberNameIterator mmli(*mn);
MemberDef *mmd;
for (mmli.toFirst();((mmd=mmli.current()) && !found);++mmli)
{
@@ -4299,7 +4379,7 @@ bool getDefs(const QCString &scName,
else
{
//printf("not a namespace\n");
- MemberListIterator mmli(*mn);
+ MemberNameIterator mmli(*mn);
MemberDef *mmd;
for (mmli.toFirst();(mmd=mmli.current());++mmli)
{
@@ -4350,7 +4430,7 @@ bool getDefs(const QCString &scName,
{
// no exact match found, but if args="()" an arbitrary
// member will do
- MemberListIterator mni(*mn);
+ MemberNameIterator mni(*mn);
for (mni.toLast();(md=mni.current());--mni)
{
//printf("Found member `%s'\n",md->name().data());
@@ -5358,6 +5438,7 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor
*/
QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
{
+ if (name==0 || name[0]=='\0') return "";
static bool shortNames = Config_getBool(SHORT_NAMES);
static bool createSubdirs = Config_getBool(CREATE_SUBDIRS);
QCString result;
@@ -6736,6 +6817,9 @@ QCString latexEscapePDFString(const char *s)
case '\\': t << "\\textbackslash{}"; break;
case '{': t << "\\{"; break;
case '}': t << "\\}"; break;
+ case '_': t << "\\_"; break;
+ case '%': t << "\\%"; break;
+ case '&': t << "\\&"; break;
default:
t << c;
break;
@@ -6936,8 +7020,6 @@ void stringToSearchIndex(const QCString &docBaseUrl,const QCString &title,
static QDict<int> g_extLookup;
-const QDict<int> &getExtensionLookup() { return g_extLookup; }
-
static struct Lang2ExtMap
{
const char *langName;
@@ -7008,7 +7090,7 @@ void initDefaultExtensionMapping()
g_extLookup.setAutoDelete(TRUE);
// extension parser id
updateLanguageMapping(".dox", "c");
- //updateLanguageMapping(".txt", "c"); // see bug 760836
+ updateLanguageMapping(".txt", "c"); // see bug 760836
updateLanguageMapping(".doc", "c");
updateLanguageMapping(".c", "c");
updateLanguageMapping(".C", "c");
@@ -7033,8 +7115,8 @@ void initDefaultExtensionMapping()
updateLanguageMapping(".ddl", "idl");
updateLanguageMapping(".odl", "idl");
updateLanguageMapping(".java", "java");
- updateLanguageMapping(".as", "javascript");
- updateLanguageMapping(".js", "javascript");
+ //updateLanguageMapping(".as", "javascript"); // not officially supported
+ //updateLanguageMapping(".js", "javascript"); // not officially supported
updateLanguageMapping(".cs", "csharp");
updateLanguageMapping(".d", "d");
updateLanguageMapping(".php", "php");
@@ -7050,6 +7132,9 @@ void initDefaultExtensionMapping()
updateLanguageMapping(".f", "fortran");
updateLanguageMapping(".for", "fortran");
updateLanguageMapping(".f90", "fortran");
+ updateLanguageMapping(".f95", "fortran");
+ updateLanguageMapping(".f03", "fortran");
+ updateLanguageMapping(".f08", "fortran");
updateLanguageMapping(".vhd", "vhdl");
updateLanguageMapping(".vhdl", "vhdl");
updateLanguageMapping(".tcl", "tcl");
@@ -8000,6 +8085,7 @@ bool copyFile(const QCString &src,const QCString &dest)
/** Returns the section of text, in between a pair of markers.
* Full lines are returned, excluding the lines on which the markers appear.
+ * \sa routine lineBlock
*/
QCString extractBlock(const QCString text,const QCString marker)
{
@@ -8043,6 +8129,29 @@ QCString extractBlock(const QCString text,const QCString marker)
return l2>l1 ? text.mid(l1,l2-l1) : QCString();
}
+/** Returns the line number of the line following the line with the marker.
+ * \sa routine extractBlock
+ */
+int lineBlock(const QCString text,const QCString marker)
+{
+ int result = 1;
+ int p=0,i;
+ bool found=FALSE;
+
+ // find the character positions of the first marker
+ int m1 = text.find(marker);
+ if (m1==-1) return result;
+
+ // find start line positions for the markers
+ while (!found && (i=text.find('\n',p))!=-1)
+ {
+ found = (p<=m1 && m1<i); // found the line with the start marker
+ p=i+1;
+ result++;
+ }
+ return result;
+}
+
/** Returns a string representation of \a lang. */
QCString langToString(SrcLangExt lang)
{
@@ -8597,3 +8706,23 @@ bool openOutputFile(const char *outFile,QFile &f)
return fileOpened;
}
+void writeExtraLatexPackages(FTextStream &t)
+{
+ // User-specified packages
+ QStrList &extraPackages = Config_getList(EXTRA_PACKAGES);
+ if (!extraPackages.isEmpty())
+ {
+ t << "% Packages requested by user\n";
+ const char *pkgName=extraPackages.first();
+ while (pkgName)
+ {
+ if ((pkgName[0] == '[') || (pkgName[0] == '{'))
+ t << "\\usepackage" << pkgName << "\n";
+ else
+ t << "\\usepackage{" << pkgName << "}\n";
+ pkgName=extraPackages.next();
+ }
+ t << "\n";
+ }
+}
+
diff --git a/src/util.h b/src/util.h
index 61d4e1d..af8a3b4 100755
--- a/src/util.h
+++ b/src/util.h
@@ -445,6 +445,7 @@ QCString replaceColorMarkers(const char *str);
bool copyFile(const QCString &src,const QCString &dest);
QCString extractBlock(const QCString text,const QCString marker);
+int lineBlock(const QCString text,const QCString marker);
QCString correctURL(const QCString &url,const QCString &relPath);
@@ -474,8 +475,8 @@ void convertProtectionLevel(
);
bool mainPageHasTitle();
-const QDict<int> &getExtensionLookup();
bool openOutputFile(const char *outFile,QFile &f);
+void writeExtraLatexPackages(FTextStream &t);
#endif
diff --git a/src/vhdlcode.l b/src/vhdlcode.l
index 6d2ebcb..ebebc10 100644
--- a/src/vhdlcode.l
+++ b/src/vhdlcode.l
@@ -85,6 +85,7 @@ static int g_yyLineNr; //!< current line number
static bool g_needsTermination;
static Definition *g_searchCtx;
+static bool g_exampleBlock;
static QCString g_exampleName;
static QCString g_exampleFile;
@@ -1504,7 +1505,7 @@ void resetVhdlCodeParserState()
}
void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString &s,
- bool /*exBlock*/, const char *exName,FileDef *fd,
+ bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool,Definition *searchCtx,
bool /* collectXRefs */)
@@ -1527,23 +1528,24 @@ void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString
g_needsTermination = FALSE;
g_searchCtx = searchCtx;
- if (endLine!=-1)
- g_inputLines = endLine+1;
- else
- g_inputLines = countLines();
-
if (startLine!=-1)
g_yyLineNr = startLine;
else
g_yyLineNr = 1;
+ if (endLine!=-1)
+ g_inputLines = endLine+1;
+ else
+ g_inputLines = g_yyLineNr + countLines() - 1;
+
// g_theCallContext.clear();
g_classScope = className;
+ g_exampleBlock = exBlock;
g_exampleName = exName;
g_sourceFileDef = fd;
bool cleanupSourceDef = FALSE;
- if (fd==0)
+ if (exBlock && fd==0)
{
// create a dummy filedef for the example
g_sourceFileDef = new FileDef("",exName);
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index 2f3e51c..d09de09 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -570,7 +570,7 @@ VhdlDocGen::~VhdlDocGen()
void VhdlDocGen::init()
{
- // vhdl keywords inlcuded VHDL 2008
+ // vhdl keywords included VHDL 2008
const char* g_vhdlKeyWordMap0[] =
{
"abs","access","after","alias","all","and","architecture","array","assert","assume","assume_guarantee","attribute",
@@ -840,7 +840,7 @@ MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberList
}
MemberListIterator fmni(*ml);
//int l=ml->count();
- // fprintf(stderr,"\n loading enity %s %s: %d",cd->symbolName().data(),keyType.data(),l);
+ // fprintf(stderr,"\n loading entity %s %s: %d",cd->symbolName().data(),keyType.data(),l);
for (fmni.toFirst();(md=fmni.current());++fmni)
{
@@ -1065,7 +1065,7 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
}// write
/*
- * finds all architectures which belongs to an entiy
+ * finds all architectures which belongs to an entity
*/
void VhdlDocGen::findAllArchitectures(QList<QCString>& qll,const ClassDef *cd)
{
diff --git a/src/xmlcode.l b/src/xmlcode.l
index fd36ebb..efcac0e 100644
--- a/src/xmlcode.l
+++ b/src/xmlcode.l
@@ -49,6 +49,7 @@ static int g_yyLineNr; //!< current line number
static bool g_needsTermination;
static Definition *g_searchCtx;
+static bool g_exampleBlock;
static QCString g_exampleName;
static QCString g_exampleFile;
@@ -323,12 +324,12 @@ void parseXmlCode(
CodeOutputInterface &od,
const char * /*className*/,
const QCString &s,
- bool /*exBlock*/,
+ bool exBlock,
const char *exName,
FileDef *fd,
int startLine,
int endLine,
- bool /*inlineFragment*/,
+ bool inlineFragment,
MemberDef *,
bool,Definition *searchCtx,
bool /*collectXRefs*/
@@ -345,22 +346,23 @@ void parseXmlCode(
g_needsTermination = FALSE;
g_searchCtx=searchCtx;
- if (endLine!=-1)
- g_inputLines = endLine+1;
- else
- g_inputLines = countLines();
-
if (startLine!=-1)
g_yyLineNr = startLine;
else
g_yyLineNr = 1;
+ if (endLine!=-1)
+ g_inputLines = endLine+1;
+ else
+ g_inputLines = g_yyLineNr + countLines() - 1;
+
+ g_exampleBlock = exBlock;
g_exampleName = exName;
g_sourceFileDef = fd;
bool cleanupSourceDef = FALSE;
- if (fd==0)
+ if (exBlock && fd==0)
{
// create a dummy filedef for the example
g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
@@ -372,6 +374,7 @@ void parseXmlCode(
setCurrentDoc("l00001");
}
+ g_includeCodeFragment = inlineFragment;
// Starts line 1 on the output
startCodeLine();
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 380a39b..815759e 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -272,7 +272,14 @@ void XmlDocVisitor::visit(DocInclude *inc)
inc->text(),
langExt,
inc->isExample(),
- inc->exampleFile(), &fd);
+ inc->exampleFile(),
+ &fd, // fileDef,
+ -1, // start line
+ -1, // end line
+ FALSE, // inline fragment
+ 0, // memberDef
+ TRUE // show line numbers
+ );
m_t << "</programlisting>";
}
break;
@@ -283,7 +290,14 @@ void XmlDocVisitor::visit(DocInclude *inc)
inc->text(),
langExt,
inc->isExample(),
- inc->exampleFile());
+ inc->exampleFile(),
+ 0, // fileDef
+ -1, // startLine
+ -1, // endLine
+ TRUE, // inlineFragment
+ 0, // memberDef
+ FALSE // show line numbers
+ );
m_t << "</programlisting>";
break;
case DocInclude::DontInclude:
@@ -315,6 +329,33 @@ void XmlDocVisitor::visit(DocInclude *inc)
);
m_t << "</programlisting>";
break;
+ case DocInclude::SnipWithLines:
+ {
+ m_t << "<programlisting>";
+ QFileInfo cfi( inc->file() );
+ FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ Doxygen::parserManager->getParser(inc->extension())
+ ->parseCode(m_ci,
+ inc->context(),
+ extractBlock(inc->text(),inc->blockId()),
+ langExt,
+ inc->isExample(),
+ inc->exampleFile(),
+ &fd,
+ lineBlock(inc->text(),inc->blockId()),
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
+ TRUE // show line number
+ );
+ m_t << "</programlisting>";
+ }
+ break;
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
+ err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
+ "Please create a bug report\n",__FILE__);
+ break;
}
}
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 8aae051..a00c17e 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -804,11 +804,12 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De
if (md->isWritable())
t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>" << endl;
}
+
if (md->memberType()==MemberType_Variable && md->bitfieldString())
{
QCString bitfield = md->bitfieldString();
if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
- t << " <bitfield>" << bitfield << "</bitfield>" << endl;
+ t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>" << endl;
}
MemberDef *rmd = md->reimplements();