diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 123 | ||||
-rw-r--r-- | src/classdef.h | 1 | ||||
-rw-r--r-- | src/code.l | 40 | ||||
-rw-r--r-- | src/config.h | 6 | ||||
-rw-r--r-- | src/config.l | 88 | ||||
-rw-r--r-- | src/dot.cpp | 66 | ||||
-rw-r--r-- | src/dot.h | 9 | ||||
-rw-r--r-- | src/doxygen.cpp | 88 | ||||
-rw-r--r-- | src/filedef.cpp | 38 | ||||
-rw-r--r-- | src/filedef.h | 6 | ||||
-rw-r--r-- | src/latexgen.cpp | 41 | ||||
-rw-r--r-- | src/memberdef.cpp | 18 | ||||
-rw-r--r-- | src/membergroup.cpp | 7 | ||||
-rw-r--r-- | src/memberlist.cpp | 4 | ||||
-rw-r--r-- | src/pre.l | 19 | ||||
-rw-r--r-- | src/scanner.l | 118 | ||||
-rw-r--r-- | src/translator.h | 13 | ||||
-rw-r--r-- | src/translator_cz.h | 3 | ||||
-rw-r--r-- | src/translator_de.h | 3 | ||||
-rw-r--r-- | src/translator_es.h | 3 | ||||
-rw-r--r-- | src/translator_fi.h | 3 | ||||
-rw-r--r-- | src/translator_fr.h | 3 | ||||
-rw-r--r-- | src/translator_hr.h | 3 | ||||
-rw-r--r-- | src/translator_it.h | 3 | ||||
-rw-r--r-- | src/translator_jp.h | 3 | ||||
-rw-r--r-- | src/translator_nl.h | 4 | ||||
-rw-r--r-- | src/translator_ru.h | 4 | ||||
-rw-r--r-- | src/translator_se.h | 3 | ||||
-rw-r--r-- | src/util.cpp | 2 |
29 files changed, 508 insertions, 214 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 1ccf663..daacfba 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -566,23 +566,44 @@ void ClassDef::setIncludeFile(FileDef *fd,const char *incName,bool local) } } +ArgumentList *ClassDef::outerTemplateArguments() const +{ + int ti; + ClassDef *pcd=0; + int pi=0; + // find the outer most class scope + while ((ti=name().find("::",pi))!=-1 && + (pcd=getClass(name().left(ti)))==0 + ) pi=ti+2; + if (pcd) + { + return pcd->templateArguments(); + } + else + { + return tempArgs; + } +} + // write all documentation for this class void ClassDef::writeDocumentation(OutputList &ol) { // write title QCString pageTitle=name().copy(); QCString pageType; + ArgumentList *outerTempArgList = outerTemplateArguments(); + if (outerTempArgList) pageType+=" Template"; switch(compType) { - case Class: pageType=" Class"; break; - case Struct: pageType=" Struct"; break; - case Union: pageType=" Union"; break; - default: pageType=" Interface"; break; + case Class: pageType+=" Class"; break; + case Struct: pageType+=" Struct"; break; + case Union: pageType+=" Union"; break; + default: pageType+=" Interface"; break; } pageTitle+=pageType+" Reference"; startFile(ol,fileName,pageTitle); startTitle(ol,getOutputFileBase()); - parseText(ol,theTranslator->trCompoundReference(name(),compType)); + parseText(ol,theTranslator->trCompoundReference(name(),compType,outerTempArgList!=0)); endTitle(ol,getOutputFileBase(),name()); ol.startTextBlock(); @@ -868,24 +889,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.endGroupHeader(); ol.startTextBlock(); - ArgumentList *al=0; - int ti; - ClassDef *pcd=0; - int pi=0; - // find the outer most class scope - while ((ti=name().find("::",pi))!=-1 && - (pcd=getClass(name().left(ti)))==0 - ) pi=ti+2; - - if (pcd) - { - al=pcd->templateArguments(); - } - else - { - al=tempArgs; - } - + ArgumentList *al=outerTempArgList; if (al) // class is a template { ol.startSubsubsection(); @@ -894,7 +898,11 @@ void ClassDef::writeDocumentation(OutputList &ol) while (a) { ol.docify(a->type); - ol.docify(a->name); + if (!a->name.isEmpty()) + { + ol.docify(" "); + ol.docify(a->name); + } if (a->defval.length()!=0) { ol.docify(" = "); @@ -1583,45 +1591,48 @@ void ClassDef::determineImplUsageRelation() // name().data(),type.data(),md->name().data()); int p=0,i,l; bool found=FALSE; - while ((i=re.match(type,p,&l))!=-1 && !found) // for each class name in the type + if (typeLen>0) { - int ts=i+l; - int te=ts; - while (type.at(ts)==' ' && ts<typeLen) ts++; // skip any whitespace - if (type.at(ts)=='<') // assume template instance + while ((i=re.match(type,p,&l))!=-1 && !found) // for each class name in the type { - // locate end of template - te=ts+1; - int brCount=1; - while (te<typeLen && brCount!=0) + int ts=i+l; + int te=ts; + while (type.at(ts)==' ' && ts<typeLen) ts++; // skip any whitespace + if (type.at(ts)=='<') // assume template instance { - if (type.at(te)=='<') brCount++; - if (type.at(te)=='>') brCount--; - te++; + // locate end of template + te=ts+1; + int brCount=1; + while (te<typeLen && brCount!=0) + { + if (type.at(te)=='<') brCount++; + if (type.at(te)=='>') brCount--; + te++; + } } - } - QCString templSpec; - if (te>ts) templSpec = type.mid(ts,te-ts); - ClassDef *cd=getResolvedClass(name()+"::"+type.mid(i,l)); - if (cd==0) cd=getResolvedClass(type.mid(i,l)); // TODO: also try inbetween scopes! - if (cd) // class exists - { - found=TRUE; - if (usesImplClassDict==0) usesImplClassDict = new UsesClassDict(257); - UsesClassDef *ucd=usesImplClassDict->find(cd->name()); - if (ucd==0 || ucd->templSpecifiers!=templSpec) + QCString templSpec; + if (te>ts) templSpec = type.mid(ts,te-ts); + ClassDef *cd=getResolvedClass(name()+"::"+type.mid(i,l)); + if (cd==0) cd=getResolvedClass(type.mid(i,l)); // TODO: also try inbetween scopes! + if (cd) // class exists { - ucd = new UsesClassDef(cd); - usesImplClassDict->insert(cd->name(),ucd); - ucd->templSpecifiers = templSpec; - //printf("Adding used class %s to class %s\n", - // cd->name().data(),name().data()); + found=TRUE; + if (usesImplClassDict==0) usesImplClassDict = new UsesClassDict(257); + UsesClassDef *ucd=usesImplClassDict->find(cd->name()); + if (ucd==0 || ucd->templSpecifiers!=templSpec) + { + ucd = new UsesClassDef(cd); + usesImplClassDict->insert(cd->name(),ucd); + ucd->templSpecifiers = templSpec; + //printf("Adding used class %s to class %s\n", + // cd->name().data(),name().data()); + } + ucd->addAccessor(md->name()); + //printf("Adding accessor %s to class %s\n", + // md->name().data(),ucd->classDef->name().data()); } - ucd->addAccessor(md->name()); - //printf("Adding accessor %s to class %s\n", - // md->name().data(),ucd->classDef->name().data()); + p=i+l; } - p=i+l; } } } diff --git a/src/classdef.h b/src/classdef.h index 86f735d..9fde96d 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -99,6 +99,7 @@ class ClassDef : public Definition // template argument functions ArgumentList *templateArguments() const { return tempArgs; } + ArgumentList *outerTemplateArguments() const; void setTemplateArguments(ArgumentList *al); //QCString getTemplateNameString(); void setNamespace(NamespaceDef *nd) { nspace = nd; } @@ -396,6 +396,7 @@ static bool getLink(const char *className, static ClassDef *stripClassName(const char *s) { QCString tmp=s; + if (tmp.isEmpty()) return 0; static const QRegExp re("[a-z_A-Z][a-z_A-Z0-9:]*"); int p=0,i,l; while ((i=re.match(tmp,p,&l))!=-1) @@ -1131,10 +1132,10 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" endFontClass(); } } -<*>\n({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n) { // remove one-line group marker +<*>\n{B}*"//@"[{}].*\n { // remove one-line group marker if (Config::stripCommentsFlag) { - g_yyLineNr+=((QCString)yytext).contains('\n'); + g_yyLineNr+=2; g_code->endCodeLine(); if (g_yyLineNr<g_inputLines) { @@ -1148,7 +1149,26 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" endFontClass(); } } -<*>^{B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n { // remove one-line group marker +<*>\n{B}*"/*@"[{}] { // remove one-line group marker + if (Config::stripCommentsFlag) + { + g_lastSpecialCContext = YY_START; + g_yyLineNr++; + BEGIN(RemoveSpecialCComment); + } + else + { + // check is to prevent getting stuck in skipping C++ comments + if (YY_START != SkipCxxComment) + { + g_lastCContext = YY_START ; + } + startFontClass("comment"); + codifyLines(yytext); + BEGIN(SkipComment); + } + } +<*>^{B}*"//@"[{}].*\n { // remove one-line group marker if (Config::stripCommentsFlag) { g_yyLineNr++; @@ -1165,6 +1185,20 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" endFontClass(); } } +<*>^{B}*"/*@"[{}] { // remove multi-line group marker + if (Config::stripCommentsFlag) + { + g_lastSpecialCContext = YY_START; + BEGIN(RemoveSpecialCComment); + } + else + { + g_lastCContext = YY_START ; + startFontClass("comment"); + g_code->codify(yytext); + BEGIN(SkipComment); + } + } <*>^{B}*"//"[!/][^\n]*\n { // remove special one-line comment if (Config::stripCommentsFlag) { diff --git a/src/config.h b/src/config.h index a417b5f..9330012 100644 --- a/src/config.h +++ b/src/config.h @@ -36,8 +36,9 @@ struct Config static QCString outputDir; // the global output directory static QCString outputLanguage; // the output language static bool noIndexFlag; // generate condensed index flag - static bool extractAllFlag; // gererate docs for all classes flag + static bool extractAllFlag; // generate docs for all classes flag static bool extractPrivateFlag; // generate docs for private members flag + static bool extractStaticFlag; // generate docs for static members flag static bool hideMemberFlag; // hide undocumented members. static bool hideClassFlag; // hide undocumented members. static bool briefMemDescFlag; // enable `inline' brief member descr. @@ -112,8 +113,11 @@ struct Config static bool classGraphFlag; // class graph static bool collGraphFlag; // collaboration graph static bool includeGraphFlag; // include graph + static bool includedByGraphFlag; // depends on include graph static bool gfxHierarchyFlag; // flag to enable graphical hierarchy static QCString dotPath; // path to the dot tool + static int maxDotGraphWidth; // max dot graph width + static int maxDotGraphHeight; // max dot graph height static bool searchEngineFlag; // generate search engine flag static QCString cgiName; // the name of the CGI binary static QCString cgiURL; // the absolute URL to the CGI binary diff --git a/src/config.l b/src/config.l index e088707..780e9ce 100644 --- a/src/config.l +++ b/src/config.l @@ -73,6 +73,7 @@ QCString Config::outputLanguage = "English"; bool Config::noIndexFlag = FALSE; bool Config::extractAllFlag = FALSE; bool Config::extractPrivateFlag = FALSE; +bool Config::extractStaticFlag = FALSE; bool Config::hideMemberFlag = FALSE; bool Config::hideClassFlag = FALSE; bool Config::briefMemDescFlag = TRUE; @@ -126,7 +127,7 @@ QStrList Config::extraPackageList; QCString Config::latexHeaderFile; bool Config::pdfHyperFlag = FALSE; bool Config::latexBatchModeFlag = FALSE; -bool Config::generateRTF = FALSE; +bool Config::generateRTF = TRUE; QCString Config::rtfOutputDir = "rtf"; bool Config::compactRTFFlag = FALSE; bool Config::rtfHyperFlag = FALSE; @@ -147,8 +148,11 @@ bool Config::haveDotFlag = FALSE; bool Config::classGraphFlag = TRUE; bool Config::collGraphFlag = TRUE; bool Config::includeGraphFlag = TRUE; +bool Config::includedByGraphFlag = TRUE; bool Config::gfxHierarchyFlag = TRUE; QCString Config::dotPath; +int Config::maxDotGraphWidth = 1024; +int Config::maxDotGraphHeight = 1024; bool Config::searchEngineFlag = FALSE; QCString Config::cgiName = "search.cgi"; QCString Config::cgiURL; @@ -175,6 +179,8 @@ static QCString elemStr; //static QCString colsInAlphaIndexString; static QCString tabSizeString; static QCString colsInAlphaIndexString; +static QCString maxDotGraphWidthString; +static QCString maxDotGraphHeightString; /* ----------------------------------------------------------------- */ @@ -215,6 +221,7 @@ static int yyread(char *buf,int max_size) <Start>"DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::noIndexFlag; } <Start>"EXTRACT_ALL"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractAllFlag; } <Start>"EXTRACT_PRIVATE"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractPrivateFlag; } +<Start>"EXTRACT_STATIC"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractStaticFlag; } <Start>"HIDE_UNDOC_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideMemberFlag; } <Start>"HIDE_UNDOC_CLASSES"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideClassFlag; } <Start>"BRIEF_MEMBER_DESC"[ \t]*"=" { BEGIN(GetBool); b=&Config::briefMemDescFlag; } @@ -289,8 +296,11 @@ static int yyread(char *buf,int max_size) <Start>"CLASS_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::classGraphFlag; } <Start>"COLLABORATION_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::collGraphFlag; } <Start>"INCLUDE_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::includeGraphFlag; } +<Start>"INCLUDED_BY_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::includedByGraphFlag; } <Start>"GRAPHICAL_HIERARCHY"[ \t]*"=" { BEGIN(GetBool); b=&Config::gfxHierarchyFlag; } <Start>"DOT_PATH"[ \t]*"=" { BEGIN(GetString); s=&Config::dotPath; s->resize(0); } +<Start>"MAX_DOT_GRAPH_WIDTH"[ \t]*"=" { BEGIN(GetString); s=&maxDotGraphWidthString; s->resize(0); } +<Start>"MAX_DOT_GRAPH_HEIGHT"[ \t]*"=" { BEGIN(GetString); s=&maxDotGraphHeightString; s->resize(0); } <Start>"SEARCHENGINE"[ \t]*"=" { BEGIN(GetBool); b=&Config::searchEngineFlag; } <Start>"CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiName; s->resize(0); } <Start>"CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiURL; s->resize(0); } @@ -395,6 +405,7 @@ void dumpConfig() printf("noIndexFlag=`%d'\n",Config::noIndexFlag); printf("extractAllFlag=`%d'\n",Config::extractAllFlag); printf("extractPrivateFlag=`%d'\n",Config::extractPrivateFlag); + printf("extractStaticFlag=`%d'\n",Config::extractStaticFlag); printf("hideMemberFlag=`%d'\n",Config::hideMemberFlag); printf("hideClassFlag=`%d'\n",Config::hideClassFlag); printf("briefMemDescFlag=`%d'\n",Config::briefMemDescFlag); @@ -577,8 +588,11 @@ void dumpConfig() printf("classGraphFlag=`%d'\n",Config::classGraphFlag); printf("collGraphFlag=`%d'\n",Config::collGraphFlag); printf("includeGraphFlag=`%d'\n",Config::includeGraphFlag); + printf("includedByGraphFlag=`%d'\n",Config::includedByGraphFlag); printf("gfxHierarchyFlag=`%d'\n",Config::gfxHierarchyFlag); printf("dotPath=`%s'\n",Config::dotPath.data()); + printf("maxDotGraphWidth=`%d'\n",Config::maxDotGraphWidth); + printf("maxDotGraphHeight=`%d'\n",Config::maxDotGraphHeight); printf("# Configuration::addtions related to the search engine \n"); printf("searchEngineFlag=`%d'\n",Config::searchEngineFlag); printf("cgiName=`%s'\n",Config::cgiName.data()); @@ -605,6 +619,7 @@ void Config::init() Config::noIndexFlag = FALSE; Config::extractAllFlag = FALSE; Config::extractPrivateFlag = FALSE; + Config::extractStaticFlag = FALSE; Config::hideMemberFlag = FALSE; Config::hideClassFlag = FALSE; Config::briefMemDescFlag = TRUE; @@ -658,7 +673,7 @@ void Config::init() Config::latexHeaderFile.resize(0); Config::pdfHyperFlag = FALSE; Config::latexBatchModeFlag = FALSE; - Config::generateRTF = FALSE; + Config::generateRTF = TRUE; Config::rtfOutputDir = "rtf"; Config::compactRTFFlag = FALSE; Config::rtfHyperFlag = FALSE; @@ -679,8 +694,11 @@ void Config::init() Config::classGraphFlag = TRUE; Config::collGraphFlag = TRUE; Config::includeGraphFlag = TRUE; + Config::includedByGraphFlag = TRUE; Config::gfxHierarchyFlag = TRUE; Config::dotPath.resize(0); + Config::maxDotGraphWidth = 1024; + Config::maxDotGraphHeight = 1024; Config::searchEngineFlag = FALSE; Config::cgiName = "search.cgi"; Config::cgiURL.resize(0); @@ -818,8 +836,10 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; - t << "# If the EXTRACT_ALL tag is set to YES all classes and functions will be \n"; - t << "# included in the documentation, even if no documentation was available. \n"; + t << "# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n"; + t << "# documentation are documented, even if no documentation was available. \n"; + t << "# Private class members and static file members will be hidden unless \n"; + t << "# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES \n"; t << "\n"; } t << "EXTRACT_ALL = "; @@ -838,8 +858,21 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# If the EXTRACT_STATIC tag is set to YES all static members of a file \n"; + t << "# will be included in the documentation. \n"; + t << "\n"; + } + t << "EXTRACT_STATIC = "; + writeBoolValue(t,Config::extractStaticFlag); + t << "\n"; + if (!sl) + { + t << "\n"; t << "# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n"; - t << "# undocumented members inside documented classes or files. \n"; + t << "# undocumented members of documented classes, files or namespaces. \n"; + t << "# If set to NO (the default) these members will be included in the \n"; + t << "# various overviews, but no documentation section is generated. \n"; + t << "# This option has no effect if EXTRACT_ALL is enabled. \n"; t << "\n"; } t << "HIDE_UNDOC_MEMBERS = "; @@ -849,7 +882,9 @@ void writeTemplateConfig(QFile *f,bool sl) { t << "\n"; t << "# If the HIDE_UNDOC_CLASSESS tag is set to YES, Doxygen will hide all \n"; - t << "# undocumented classes. \n"; + t << "# undocumented classes that are normally visible in the class hierarchy. \n"; + t << "# If set to NO (the default) these class will be included in the various \n"; + t << "# overviews. This option has no effect if EXTRACT_ALL is enabled. \n"; t << "\n"; } t << "HIDE_UNDOC_CLASSES = "; @@ -1735,6 +1770,17 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to \n"; + t << "# YES then doxygen will generate a graph for each documented header file showing \n"; + t << "# the documented files that directly or indirectly include this file \n"; + t << "\n"; + } + t << "INCLUDED_BY_GRAPH = "; + writeBoolValue(t,Config::includedByGraphFlag); + t << "\n"; + if (!sl) + { + t << "\n"; t << "# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n"; t << "# will graphical hierarchy of all classes instead of a textual one. \n"; t << "\n"; @@ -1745,8 +1791,8 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; - t << "# This tag can be used to specify the path where the dot tool can be found. \n"; - t << "# If left blank, it is assumed the dot tool can be found on the path. \n"; + t << "# The tag DOT_PATH can be used to specify the path where the dot tool can be \n"; + t << "# found. If left blank, it is assumed the dot tool can be found on the path. \n"; t << "\n"; } t << "DOT_PATH = "; @@ -1755,6 +1801,32 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width \n"; + t << "# (in pixels) of the graphs generated by dot. If a graph becomes larger than \n"; + t << "# this value, doxygen will try to truncate the graph, so that it fits within \n"; + t << "# the specified constraint. Beware that most browsers cannot cope with very \n"; + t << "# large images. \n"; + t << "\n"; + } + t << "MAX_DOT_GRAPH_WIDTH = "; + writeIntValue(t,Config::maxDotGraphWidth); + t << "\n"; + if (!sl) + { + t << "\n"; + t << "# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height \n"; + t << "# (in pixels) of the graphs generated by dot. If a graph becomes larger than \n"; + t << "# this value, doxygen will try to truncate the graph, so that it fits within \n"; + t << "# the specified constraint. Beware that most browsers cannot cope with very \n"; + t << "# large images. \n"; + t << "\n"; + } + t << "MAX_DOT_GRAPH_HEIGHT = "; + writeIntValue(t,Config::maxDotGraphHeight); + t << "\n"; + if (!sl) + { + t << "\n"; } t << "#---------------------------------------------------------------------------\n"; t << "# Configuration::addtions related to the search engine \n"; diff --git a/src/dot.cpp b/src/dot.cpp index 2eaa7d5..a85e9bd 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -30,11 +30,8 @@ //-------------------------------------------------------------------- -const int maxImageWidth=1024; -const int maxImageHeight=1024; - /*! mapping from protection levels to color names */ -static char *edgeColorMap[] = +static const char *edgeColorMap[] = { "midnightblue", // Public "darkgreen", // Protected @@ -43,7 +40,7 @@ static char *edgeColorMap[] = "grey" // Undocumented }; -static char *edgeStyleMap[] = +static const char *edgeStyleMap[] = { "solid", // inheritance "dashed" // usage @@ -364,7 +361,8 @@ void DotNode::write(QTextStream &t, GraphOutputFormat format, bool topDown, bool toChildren, - int distance + int distance, + bool backArrows ) { //printf("DotNode::write(%d) name=%s\n",distance,m_label.data()); @@ -394,9 +392,9 @@ void DotNode::write(QTextStream &t, { if (cn->m_distance<=distance) { - writeArrow(t,format,cn,dnli2.current(),topDown); + writeArrow(t,format,cn,dnli2.current(),topDown,backArrows); } - cn->write(t,format,topDown,toChildren,distance); + cn->write(t,format,topDown,toChildren,distance,backArrows); } } else // render parents @@ -411,10 +409,11 @@ void DotNode::write(QTextStream &t, format, pn, pn->m_edgeInfo->at(pn->m_children->findRef(this)), - FALSE + FALSE, + backArrows ); } - pn->write(t,format,TRUE,FALSE,distance); + pn->write(t,format,TRUE,FALSE,distance,backArrows); } } } @@ -915,11 +914,12 @@ void writeDotGraph(DotNode *root, const QCString &baseName, bool lrRank, bool renderParents, - int distance + int distance, + bool backArrows ) { // generate the graph description for dot - //printf("writeDotGraph(%s,%d)\n",baseName.data(),renderParents); + //printf("writeDotGraph(%s,%d)\n",baseName.data(),backArrows); QFile f; f.setName(baseName+".dot"); if (f.open(IO_WriteOnly)) @@ -932,7 +932,7 @@ void writeDotGraph(DotNode *root, t << " rankdir=LR;" << endl; } root->clearWriteFlag(); - root->write(t,format,TRUE,TRUE,distance); + root->write(t,format,TRUE,TRUE,distance,backArrows); if (renderParents && root->m_parents) { //printf("rendering parents!\n"); @@ -946,10 +946,11 @@ void writeDotGraph(DotNode *root, format, pn, pn->m_edgeInfo->at(pn->m_children->findRef(root)), - FALSE + FALSE, + backArrows ); } - pn->write(t,format,TRUE,FALSE,distance); + pn->write(t,format,TRUE,FALSE,distance,backArrows); } } t << "}" << endl; @@ -963,7 +964,8 @@ static void findMaximalDotGraph(DotNode *root, QDir &thisDir, GraphOutputFormat format, bool lrRank=FALSE, - bool renderParents=FALSE + bool renderParents=FALSE, + bool backArrows=TRUE ) { bool lastFit; @@ -974,10 +976,11 @@ static void findMaximalDotGraph(DotNode *root, int height=0; // binary search for the maximal inheritance depth that fits in a reasonable - // sized image (dimensions: maxImageWidth, maxImageHeight) + // sized image (dimensions: Config::maxDotGraphWidth, Config::maxDotGraphHeight) do { - writeDotGraph(root,format,baseName,lrRank,renderParents,curDistance); + writeDotGraph(root,format,baseName,lrRank,renderParents, + curDistance,backArrows); QCString dotCmd(4096); // create annotated dot file @@ -995,7 +998,7 @@ static void findMaximalDotGraph(DotNode *root, height = height*96/72; // 96 pixels/inch, 72 points/inch //printf("Found bounding box (%d,%d)\n",width,height); - lastFit=(width<maxImageWidth && height<maxImageHeight); + lastFit=(width<Config::maxDotGraphWidth && height<Config::maxDotGraphHeight); if (lastFit) // image is small enough { minDistance=curDistance; @@ -1020,9 +1023,10 @@ static void findMaximalDotGraph(DotNode *root, writeDotGraph(root, format, baseName, - lrRank || (curDistance==1 && width>maxImageWidth), + lrRank || (curDistance==1 && width>Config::maxDotGraphWidth), renderParents, - minDistance + minDistance, + backArrows ); } } @@ -1131,7 +1135,8 @@ int DotInclDepGraph::m_curNodeNumber; void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) { - QList<IncludeInfo> *includeFiles = fd->includeFileList(); + QList<IncludeInfo> *includeFiles = + m_inverse ? fd->includedByFileList() : fd->includeFileList(); QListIterator<IncludeInfo> ili(*includeFiles); IncludeInfo *ii; for (;(ii=ili.current());++ili) @@ -1178,9 +1183,10 @@ void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) } } -DotInclDepGraph::DotInclDepGraph(FileDef *fd) +DotInclDepGraph::DotInclDepGraph(FileDef *fd,bool inverse) { m_maxDistance = 0; + m_inverse = inverse; ASSERT(fd!=0); m_diskName = fd->getOutputFileBase().copy(); m_startNode = new DotNode(m_curNodeNumber++, @@ -1221,9 +1227,14 @@ void DotInclDepGraph::writeGraph(QTextStream &out, QDir::setCurrent(d.absPath()); QDir thisDir; - QCString baseName=m_diskName+"_incldep"; + QCString baseName=m_diskName; + if (m_inverse) baseName+="_dep"; + baseName+="_incl"; + QCString mapName=m_startNode->m_label.copy(); + if (m_inverse) mapName+="dep"; - findMaximalDotGraph(m_startNode,m_maxDistance,baseName,thisDir,format); + findMaximalDotGraph(m_startNode,m_maxDistance,baseName,thisDir,format, + FALSE,FALSE,!m_inverse); if (format==GIF) { @@ -1247,8 +1258,8 @@ void DotInclDepGraph::writeGraph(QTextStream &out, } out << "<p><center><img src=\"" << baseName << ".gif\" border=\"0\" usemap=\"#" - << m_startNode->m_label << "_map\"></center>" << endl; - out << "<map name=\"" << m_startNode->m_label << "_map\">" << endl; + << mapName << "_map\"></center>" << endl; + out << "<map name=\"" << mapName << "_map\">" << endl; convertMapFile(out,baseName+".map"); out << "</map><p>" << endl; thisDir.remove(baseName+".map"); @@ -1257,7 +1268,6 @@ void DotInclDepGraph::writeGraph(QTextStream &out, { // run dot to create a .eps image QCString dotCmd; - dotCmd.sprintf("%sdot -Tps \"%s.dot\" -o \"%s.eps\"", Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) @@ -52,7 +52,9 @@ class DotNode const QCString &baseName, bool lrRank, bool renderParents, - int distance); + int distance, + bool backArrow + ); public: DotNode(int n,const char *lab,const char *url,int distance = 0,bool rootNode=FALSE); ~DotNode(); @@ -70,7 +72,7 @@ class DotNode void removeParent(DotNode *n); int number() const { return m_number; } void write(QTextStream &t,GraphOutputFormat f,bool topDown,bool toChildren, - int maxDistance=1000); + int maxDistance=1000,bool backArrows=TRUE); int m_subgraphId; void clearWriteFlag(); @@ -137,7 +139,7 @@ class DotClassGraph class DotInclDepGraph { public: - DotInclDepGraph(FileDef *fd); + DotInclDepGraph(FileDef *fd,bool inverse=FALSE); ~DotInclDepGraph(); void writeGraph(QTextStream &t, GraphOutputFormat f,const char *path); bool isTrivial() const; @@ -150,4 +152,5 @@ class DotInclDepGraph static int m_curNodeNumber; QCString m_diskName; int m_maxDistance; + bool m_inverse; }; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 3240633..39e5f8a 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1165,10 +1165,9 @@ void buildVarList(Entry *root) root->type=root->name; QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*"); int l; - i=re.match(root->args,0,&l); + i=root->args.isEmpty() ? -1 : re.match(root->args,0,&l); root->name=root->args.mid(i,l); - root->args=root->args.mid(i+l, - root->args.find(')',i+l)-i-l); + root->args=root->args.mid(i+l,root->args.find(')',i+l)-i-l); //printf("new: type=`%s' name=`%s' args=`%s'\n", // root->type.data(),root->name.data(),root->args.data()); } @@ -1350,7 +1349,7 @@ static void buildMemberList(Entry *root) ) { int l; - if ((i=re.match(root->type,0,&l))!=-1) // function variable + if (!root->type.isEmpty() && (i=re.match(root->type,0,&l))!=-1) // function variable { root->args+=root->type.right(root->type.length()-i-l); root->type=root->type.left(i+l); @@ -1882,8 +1881,14 @@ static bool findBaseClassRelation(Entry *root,ClassDef *cd, int typeLen = baseClassName.length(); while (e<typeLen && brCount!=0) { - if (baseClassName.at(e)=='<') brCount++; - if (baseClassName.at(e)=='>') brCount--; + if (baseClassName.at(e)=='<') + { + if (e<typeLen-1 && baseClassName.at(e+1)=='<') e++; else brCount++; + } + if (baseClassName.at(e)=='>') + { + if (e<typeLen-1 && baseClassName.at(e+1)=='>') e++; else brCount--; + } e++; } if (brCount==0) // end of template was found at e @@ -2185,6 +2190,8 @@ static void addMemberDocs(Entry *root, FileDef *fd=findFileDef(inputNameDict,root->fileName,ambig); md->setBodyDef(fd); } + + } //md->setDefFile(root->fileName); //md->setDefLine(root->startLine); @@ -2192,6 +2199,7 @@ static void addMemberDocs(Entry *root, md->addSectionsToDefinition(root->anchors); addMemberToGroups(root,md); if (cd) cd->insertUsedFile(root->fileName); + //printf("root->mGrpId=%d\n",root->mGrpId); if (root->mGrpId!=-1) { if (md->getMemberGroupId()!=-1) @@ -2208,23 +2216,9 @@ static void addMemberDocs(Entry *root, } else // set group id { + //printf("setMemberGroupId=%d md=%s\n",root->mGrpId,md->name().data()); md->setMemberGroupId(root->mGrpId); } - //md->setMemberGroup(memberGroupDict[root->mGrpId]); - // if (cd) - // cd->addMemberToGroup(md,root->mGrpId); - // else if (nd) - // nd->addMemberToGroup(md,root->mGrpId); - // else - // { - // bool ambig; - // FileDef *fd=findFileDef(inputNameDict,root->fileName,ambig); - // if (fd) - // { - // //fd->addMemberToGroup(md,root->mGrpId); - // } - // } - //} } } @@ -2419,24 +2413,26 @@ static void substituteTemplateArgNames(ArgumentList *src, bool isReplaced=FALSE; QRegExp re(idMask); int i,p=0,l,c=0; - while ((i=re.match(s,p,&l))!=-1) // for each template name found at the - // member definition + while (!s.isEmpty() && (i=re.match(s,p,&l))!=-1) // for each template name found at the + // member definition { Argument *ta = c<(int)tempArgs->count() ? tempArgs->at(c) : 0; if (ta) // get matching template argument of the class { QCString dstName=s.mid(i,l); - QCString srcName=ta->type.copy(); + QCString srcName=ta->name.copy(); + if (srcName.isEmpty()) srcName=ta->type.copy(); + //printf("1.Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); int bi; if ((bi=srcName.findRev(' '))!=-1) // search for separator { - // strip the type specifier (usuall class or typename) + // strip the type specifier (usually class or typename) srcName=srcName.right(srcName.length()-bi-1); } //if (srcName.left(6)=="class ") srcName=srcName.right(srcName.length()-6); //if (srcName.left(9)=="typename ") srcName=srcName.right(srcName.length()-9); - //printf("Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); + //printf("2.Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); if (srcName!=dstName) /* we need to substitute */ { int ti,tp=0; @@ -2478,7 +2474,7 @@ static void substituteTemplateArgNames(ArgumentList *src, } dst->append(na); } - //printf("substituteTemplateArgNames(src=`%s',tempNameStr=`%s',tempArgs=`%s',dest=`%s')\n", + //printf("substituteTemplateArgNames(\nsrc=`%s',\ntempNameStr=`%s',\ntempArgs=`%s',\ndest=`%s'\n)\n", // argListToString(src).data(), // s.data(), // argListToString(tempArgs).data(), @@ -3210,14 +3206,14 @@ static void findMember(Entry *root,QCString funcDecl,QCString related,bool overl static void findMemberDocumentation(Entry *root) { - int i,l; + int i=-1,l; QRegExp re("([a-zA-Z0-9: ]*\\*+[ \\*]*"); Debug::print(Debug::FindMembers,0, - "root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d\n", - root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec + "root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d root->mGrpId=%d\n", + root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec,root->mGrpId ); bool isFunc=TRUE; - if ((i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr + if (!root->type.isEmpty() && (i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr { root->args+=root->type.right(root->type.length()-i-l); root->type=root->type.left(i+l); @@ -3249,14 +3245,13 @@ static void findMemberDocumentation(Entry *root) else if ((root->section==Entry::FUNCTION_SEC // function || - (root->section==Entry::VARIABLE_SEC && + (root->section==Entry::VARIABLE_SEC && // variable !root->type.isEmpty() && root->type.left(8)!="typedef " && compoundKeywordDict.find(root->type)==0 ) ) && - (!root->doc.isEmpty() || !root->brief.isEmpty() || - root->bodyLine!=-1 - || (root->memSpec&Entry::Inline) + (!root->doc.isEmpty() || !root->brief.isEmpty() || root->bodyLine!=-1 || + (root->memSpec&Entry::Inline) || root->mGrpId!=-1 ) ) { @@ -3386,7 +3381,14 @@ static void findEnums(Entry *root) //} if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - md->setDefinition(nd->name()+"::"+name); + if (Config::hideScopeNames) + { + md->setDefinition(name); + } + else + { + md->setDefinition(nd->name()+"::"+name); + } nd->insertMember(md); md->setNamespace(nd); } @@ -3397,7 +3399,14 @@ static void findEnums(Entry *root) } else if (cd) { - md->setDefinition(cd->name()+"::"+name); + if (Config::hideScopeNames) + { + md->setDefinition(name); + } + else + { + md->setDefinition(cd->name()+"::"+name); + } cd->insertMember(md); cd->insertUsedFile(root->fileName); } @@ -3538,7 +3547,6 @@ static void findEnumDocumentation(Entry *root) if (root->mGrpId!=-1 && md->getMemberGroupId()==-1) { - //cd->addMemberToGroup(md,root->mGrpId); md->setMemberGroupId(root->mGrpId); } @@ -3562,6 +3570,7 @@ static void findEnumDocumentation(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->addSectionsToDefinition(root->anchors); + md->setMemberGroupId(root->mGrpId); found=TRUE; } } @@ -3853,7 +3862,8 @@ static void addSourceReferences() { //printf("Found member `%s' in file `%s' at line `%d'\n", // md->name().data(),fd->name().data(),md->getStartBodyLine()); - Definition *d=gd ? gd : (nd ? nd : fd); + Definition *d=gd!=0 ? (Definition *)gd : + (nd!=0 ? (Definition *)nd : (Definition *)fd); fd->addSourceRef(md->getStartBodyLine(),d,md); } } diff --git a/src/filedef.cpp b/src/filedef.cpp index 182793f..08b16b2 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -46,6 +46,9 @@ FileDef::FileDef(const char *p,const char *nm,const char *ref) includeList = new QList<IncludeInfo>; includeList->setAutoDelete(TRUE); includeDict = new QDict<IncludeInfo>(61); + includedByList = new QList<IncludeInfo>; + includedByList->setAutoDelete(TRUE); + includedByDict = new QDict<IncludeInfo>(61); namespaceList = new NamespaceList; namespaceDict = new NamespaceDict(7); srcDefDict = 0; @@ -188,7 +191,7 @@ void FileDef::writeDocumentation(OutputList &ol) if (Config::haveDotFlag && Config::includeGraphFlag) { //printf("Graph for file %s\n",name().data()); - DotInclDepGraph incDepGraph(this); + DotInclDepGraph incDepGraph(this,FALSE); if (!incDepGraph.isTrivial()) { ol.disable(OutputGenerator::Man); @@ -201,6 +204,22 @@ void FileDef::writeDocumentation(OutputList &ol) //incDepGraph.writeGraph(Config::htmlOutputDir,fd->getOutputFileBase()); } + if (Config::haveDotFlag && Config::includedByGraphFlag) + { + //printf("Graph for file %s\n",name().data()); + DotInclDepGraph incDepGraph(this,TRUE); + if (!incDepGraph.isTrivial()) + { + ol.disable(OutputGenerator::Man); + ol.newParagraph(); + ol.startInclDepGraph(); + parseText(ol,theTranslator->trInclByDepGraph()); + ol.endInclDepGraph(incDepGraph); + ol.enableAll(); + } + //incDepGraph.writeGraph(Config::htmlOutputDir,fd->getOutputFileBase()); + } + if (generateSource() || (!isReference() && Config::sourceBrowseFlag)) { ol.disableAllBut(OutputGenerator::Html); @@ -454,6 +473,7 @@ void FileDef::addMemberListToGroup(MemberList *ml, { QCString *pGrpHeader = memberHeaderDict[groupId]; QCString *pDocs = memberDocDict[groupId]; + //printf("Member `%s' pGrpHeader=%p\n",md->name().data(),pGrpHeader); if (pGrpHeader) { MemberGroup *mg = memberGroupDict->find(groupId); @@ -463,6 +483,7 @@ void FileDef::addMemberListToGroup(MemberList *ml, memberGroupDict->insert(groupId,mg); memberGroupList->append(mg); } + //printf("insert member %s in group %s\n",md->name().data(),pGrpHeader->data()); mg->insertMember(md); md->setMemberGroup(mg); } @@ -595,6 +616,21 @@ void FileDef::addIncludeDependency(FileDef *fd,const char *incName,bool local) } } +void FileDef::addIncludedByDependency(FileDef *fd,const char *incName,bool local) +{ + //printf("FileDef::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local); + QCString iName = fd ? fd->absFilePath().data() : incName; + if (!iName.isEmpty() && includedByDict->find(iName)==0) + { + IncludeInfo *ii = new IncludeInfo; + ii->fileDef = fd; + ii->includeName = incName; + ii->local = local; + includedByList->append(ii); + includedByDict->insert(iName,ii); + } +} + //----------------------------------------------------------------------------- /*! Creates a file list. */ diff --git a/src/filedef.h b/src/filedef.h index 0bc19d6..0dd8d05 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -122,9 +122,11 @@ class FileDef : public Definition void setGenerateSource(bool b) { isSource=b; } bool generateSource() const { return isSource; } + void addIncludeDependency(FileDef *fd,const char *incName,bool local); + void addIncludedByDependency(FileDef *fd,const char *incName,bool local); QList<IncludeInfo> *includeFileList() const { return includeList; } - QDict<IncludeInfo> *includeFileDict() const { return includeDict; } + QList<IncludeInfo> *includedByFileList() const { return includedByList; } void addMembersToMemberGroup(); void distributeMemberGroupDocumentation(); @@ -145,6 +147,8 @@ class FileDef : public Definition ClassList *classList; QDict<IncludeInfo> *includeDict; QList<IncludeInfo> *includeList; + QDict<IncludeInfo> *includedByDict; + QList<IncludeInfo> *includedByList; NamespaceDict *namespaceDict; NamespaceList *namespaceList; NamespaceList *usingDirList; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 036abe4..192e6d4 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -48,22 +48,47 @@ static QCString filterTitle(const char *s) return result; } -static QCString escapeLabelName(const QCString &s) +static QCString escapeLabelName(const char *s) { QCString result; - uint i; - for (i=0;i<s.length();i++) + const char *p=s; + char c; + while ((c=*p++)) { - char c=s.at(i); switch (c) { case '%': result+="\\%"; break; + case '|': result+="\\texttt{\"|}"; break; + case '!': result+="\"!"; break; default: result+=c; } } return result; } +static QCString escapeMakeIndexChars(LatexGenerator *g,QTextStream &t,const char *s) +{ + QCString result; + const char *p=s; + char str[2]; + str[1]=0; + char c; + while ((c=*p++)) + { + switch (c) + { + case '!': t << "\"!"; break; + case '"': t << "\"\""; break; + case '@': t << "\"@"; break; + case '|': t << "\\texttt{\"|}"; break; + case '[': t << "["; break; + case ']': t << "]"; break; + default: str[0]=c; g->docify(str); break; + } + } + return result; +} + LatexGenerator::LatexGenerator() : OutputGenerator() { @@ -178,7 +203,7 @@ void LatexGenerator::startIndexSection(IndexSections is) t << "}\n"; if (Config::paperType=="a4wide") t << "\\usepackage{a4wide}\n"; t << "\\usepackage{makeidx}\n" - "\\usepackage{fancyheadings}\n" + "\\usepackage{fancyhdr}\n" "\\usepackage{epsfig}\n" "\\usepackage{float}\n" "\\usepackage{doxygen}\n"; @@ -865,11 +890,11 @@ void LatexGenerator::startMemberDoc(const char *clname, t << "}!"; } t << escapeLabelName(memname) << "@{"; - docify(memname); + escapeMakeIndexChars(this,t,memname); t << "}}" << endl; t << "\\index{" << escapeLabelName(memname) << "@{"; - docify(memname); + escapeMakeIndexChars(this,t,memname); t << "}"; if (clname) { @@ -934,7 +959,7 @@ void LatexGenerator::addToIndex(const char *s1,const char *s2) if (s1) { t << "\\index{" << escapeLabelName(s1) << "@{"; - docify(s1); + escapeMakeIndexChars(this,t,s1); t << "}"; if (s2) { diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 3613f78..f08a858 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -475,8 +475,8 @@ void MemberDef::writeDeclaration(OutputList &ol, if (Config::hideMemberFlag && documentation().isEmpty() && !Config::briefMemDescFlag && !Config::repeatBriefFlag ) return; - // hide static file & namespace members unless extract private is on - if (cd==0 && isStatic() && !Config::extractPrivateFlag) return; + // hide static file & namespace members unless extract static is on + if (cd==0 && isStatic() && !Config::extractStaticFlag) return; // hide private member that are put into a member group. Non-grouped // members are not rendered anyway. @@ -489,7 +489,8 @@ void MemberDef::writeDeclaration(OutputList &ol, // strip `friend' keyword from type if (type.left(7)=="friend ") type=type.right(type.length()-7); static QRegExp r("@[0-9]+"); - if ((i=r.match(type,0,&l))==-1 || !enumUsed()) + i=-1; + if ((type.isEmpty() || (i=r.match(type,0,&l))==-1) || !enumUsed()) { if (!Config::genTagFile.isEmpty()) @@ -792,7 +793,7 @@ void MemberDef::writeDeclaration(OutputList &ol, void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, const char *scopeName) { - if (memberClass()==0 && isStatic() && !Config::extractPrivateFlag) return; + if (memberClass()==0 && isStatic() && !Config::extractStaticFlag) return; bool hasDocs = detailsAreVisible(); //printf("MemberDef::writeDocumentation(): type=`%s' def=`%s'\n",type.data(),definition()); if ( @@ -834,14 +835,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, int i=0,l; static QRegExp r("@[0-9]+"); - //ENUM if (isEnumValue()) return; - //if (isEnumValue() && def[0]=='@') def = def.right(def.length()-2); - //int dummy; - //if (isEnumerate() && r.match(def,0,&l)!=-1) return; - //MemberDef *smd; - //if (isEnumValue() && (smd = getEnumScope()) - // && r.match(smd->name(),0,&dummy)==-1) return; ol.pushGeneratorState(); @@ -1342,7 +1336,7 @@ bool MemberDef::isLinkableInProject() ((hasDocumentation() && !isReference()) ) && (prot!=Private || Config::extractPrivateFlag || isFriend()) && // not a private class member - (classDef!=0 || Config::extractPrivateFlag || !isStatic()); // not a private file/namespace member + (classDef!=0 || Config::extractStaticFlag || !isStatic()); // not a static file/namespace member } bool MemberDef::isLinkable() diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 7590079..516a284 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -111,14 +111,17 @@ int MemberGroup::countDecMembers(bool sectionPerType) void MemberGroup::distributeMemberGroupDocumentation() { + //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",grpHeader.data()); MemberDef *md=memberList->first(); - if (md && md->hasDocumentation()) + if (md && !(md->documentation().isEmpty() && md->briefDescription().isEmpty())) { + //printf("First member %s has documentation!\n",md->name().data()); MemberDef *omd=memberList->next(); while (omd) { - if (!omd->hasDocumentation()) + if (omd->documentation().isEmpty() && omd->briefDescription().isEmpty()) { + //printf("Copying documentation to member %s\n",omd->name().data()); omd->setBriefDescription(md->briefDescription()); omd->setDocumentation(md->documentation()); } diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 7a862a8..e49b0ef 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -54,7 +54,7 @@ void MemberList::countDecMembers(bool inGroup,bool countSubGroups,bool sectionPe { //printf("md=%p md->name()=`%s' inGroup=%d getMemberGroup()=%p\n", // md,md->name().data(),inGroup,md->getMemberGroup()); - if (!(md->memberClass()==0 && md->isStatic() && !Config::extractPrivateFlag) && + if (!(md->memberClass()==0 && md->isStatic() && !Config::extractStaticFlag) && (!Config::hideMemberFlag || md->hasDocumentation()) && ( (!Config::hideMemberFlag || !md->documentation().isEmpty() || @@ -119,7 +119,7 @@ void MemberList::countDocMembers() //printf("%s MemberList::countDocMembers() details=%d\n", // md->name().data(),md->detailsAreVisible()); bool visibleIfStatic = - !(md->memberClass()==0 && md->isStatic() && !Config::extractPrivateFlag); + !(md->memberClass()==0 && md->isStatic() && !Config::extractStaticFlag); if (visibleIfStatic && (Config::extractAllFlag || md->detailsAreVisible()) @@ -120,7 +120,8 @@ static void decrLevel() } else { - err("Error: More #endif's than #if's found.\n"); + err("%s:%d: Error: More #endif's than #if's found.\n", + g_yyFileName.data(),g_yyLineNr); } } @@ -128,7 +129,8 @@ static bool otherCaseDone() { if (g_level==0) { - err("Error: Found an #else without a preceding #if.\n"); + err("%s:%d: Error: Found an #else without a preceding #if.\n", + g_yyFileName.data(),g_yyLineNr); return TRUE; } else @@ -165,7 +167,7 @@ static FILE *findFile(const char *fileName) { QCString absName=(QCString)s+"/"+fileName; QFileInfo fi(absName); - if (fi.exists()) + if (fi.exists() && fi.isFile()) { FILE *f; if (!Config::inputFilter.isEmpty()) @@ -279,6 +281,7 @@ static void processConcatOperators(QCString &expr) { QRegExp r("[ \\t\\n]*##[ \\t\\n]*"); int l,n,i=0; + if (expr.isEmpty()) return; while ((n=r.match(expr,i,&l))!=-1) { if (n+l+1<(int)expr.length() && expr.at(n+l)=='@' && expr.at(n+l+1)=='-') @@ -840,6 +843,11 @@ static void readIncludeFile(const QCString &inc) { // add include dependency to the file in which the #include was found oldFileDef->addIncludeDependency(g_yyFileDef,incFileName,localInclude); + // add included by dependency + if (g_yyFileDef) + { + g_yyFileDef->addIncludedByDependency(oldFileDef,oldFileDef->name(),localInclude); + } } // store the state of the old file FileState *fs=new FileState; @@ -861,6 +869,11 @@ static void readIncludeFile(const QCString &inc) FileDef *fd = findFileDef(inputNameDict,incFileName,ambig); // add include dependency to the file in which the #include was found oldFileDef->addIncludeDependency(fd,incFileName,localInclude); + // add included by dependency + if (fd) + { + fd->addIncludedByDependency(oldFileDef,oldFileDef->name(),localInclude); + } } #if SHOW_INCLUDES msg("#include %s: not found! skipping...\n",incFileName.data()); diff --git a/src/scanner.l b/src/scanner.l index 1c2bc01..7b098f8 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -83,6 +83,7 @@ static int lastFormulaContext; static int lastAnchorContext; static int lastInitializerContext; static int lastClassTemplSpecContext; +static int lastSkipHtmlCommentContext; static int nextDefContext; static int overloadContext; static Protection protection; @@ -130,6 +131,7 @@ static bool inReturnBlock; static bool inAuthorBlock; static bool inDeprecatedBlock; static bool inVersionBlock; +static bool inSinceBlock; static bool inDateBlock; static bool inBugBlock; static bool inNoteBlock; @@ -218,6 +220,7 @@ static void initParser() inAuthorBlock = FALSE; inDeprecatedBlock = FALSE; inVersionBlock = FALSE; + inSinceBlock = FALSE; inDateBlock = FALSE; inBugBlock = FALSE; inNoteBlock = FALSE; @@ -669,7 +672,7 @@ static void tryEndItemList() static bool inBlock() { return inParamBlock || inRetValBlock || inSeeBlock || inReturnBlock || inAuthorBlock || - inVersionBlock || inDateBlock || inWarningBlock || inRemarkBlock || + inVersionBlock || inSinceBlock || inDateBlock || inWarningBlock || inRemarkBlock || inAttentionBlock || inBugBlock || inNoteBlock || inParBlock || inExceptionBlock || inDeprecatedBlock || inPreBlock || inPostBlock || inInvarBlock; @@ -684,7 +687,7 @@ static void endBlock() } outDoc->endDescList(); inParamBlock=inRetValBlock=inSeeBlock=inReturnBlock=inAuthorBlock= - inVersionBlock=inDateBlock=inBugBlock=inNoteBlock=inWarningBlock= + inVersionBlock=inSinceBlock=inDateBlock=inBugBlock=inNoteBlock=inWarningBlock= inParBlock=inExceptionBlock=inDeprecatedBlock=inPreBlock=inPostBlock= inInvarBlock=inRemarkBlock=inAttentionBlock=FALSE; } @@ -965,7 +968,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") %x FuncQual %x Operator %x Array -%x Curly +%x ReadBody %x Using %x UsingDirective %x NameSpaceDocArg1 @@ -1089,7 +1092,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") %x ReadFuncArgType %x ReadTempArgs %x Specialization -%x DocSkipHtmlComment +%x SkipHtmlComment %x ReadFormulaShort %x ReadFormulaLong %x AnchorLabel @@ -1149,9 +1152,6 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") <DocScan>\n{B}*(("//"{B}*)?)"*"*{B}*"-"{B}+ { addListItemMarker(yytext+1); } -<DocScan>"<!--" { BEGIN(DocSkipHtmlComment); } -<DocSkipHtmlComment>"--"[!]?">" { BEGIN(DocScan); } -<DocSkipHtmlComment>. <DocScan,Text>"©" { outDoc->writeCopyright(); } <DocScan,Text>""" { outDoc->writeQuote(); } <DocScan,Text>"&"[AEIOUYaeiouy]"uml;" { outDoc->writeUmlaut(yytext[1]); } @@ -1477,6 +1477,24 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") outDoc->writeDescItem(); } } +<DocScan>{CMD}"since"/{BN} { + endArgumentList(); + if (!inSinceBlock) + { + if (inBlock()) endBlock(); + inSinceBlock=TRUE; + outDoc->startDescList(); + outDoc->startBold(); + scanString(theTranslator->trSince()+": "); + outDoc->endBold(); + outDoc->endDescTitle(); + outDoc->writeDescItem(); + } + else + { + outDoc->writeDescItem(); + } + } <DocScan>{CMD}"date"/{BN} { endArgumentList(); if (!inDateBlock) @@ -2641,6 +2659,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") *currentTemplateSpec+=*yytext; } <FindMembers,FindMemberName>{SCOPENAME} { + lineCount(); if (insideIDL && yyleng==9 && strcmp(yytext,"cpp_quote")==0) { BEGIN(CppQuote); @@ -2651,7 +2670,6 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") } else { - lineCount(); if (YY_START==FindMembers) { addType( current ) ; @@ -2668,6 +2686,9 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") BEGIN(FindMembers); } } +<FindMembers>"::" { + current->name+=yytext; + } <CppQuote>"("{B}*"\"" { insideCppQuote=TRUE; BEGIN(FindMembers); @@ -2812,7 +2833,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") BEGIN(AfterDoc); } } -<FindMembers>"//@{"|"/*@{*/" { +<FindMembers,FindFields>"//@{"|"/*@{" { if (memberGroupId!=NOGROUP) { warn(yyFileName,yyLineNr,"Warning: ignoring nested member group. " @@ -2833,8 +2854,24 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") current->mGrpId = memberGroupId; lastMemberGroupLine = yyLineNr; } + tmpDocType=-1; + if (current_root->section & Entry::SCOPE_MASK) + current->inside = current_root->name+"::"; + if (yytext[1]=='/') // C++ style comment + { + current->brief.resize(0); + lastDocContext = YY_START; + BEGIN( LineDoc ); + } + else // C style comment + { + current->doc.resize(0); + lastDocContext = YY_START; + removeSlashes=FALSE; + BEGIN( Doc ); + } } -<FindMembers>"//@}"|"/*@}*/" { +<FindMembers,FindFields,ReadInitializer>"//@}"|"/*@}*/" { if (memberGroupId==NOGROUP) { warn(yyFileName,yyLineNr, @@ -2849,7 +2886,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") new QCString(memberGroupDocs) ); memberGroupId=NOGROUP; - current->mGrpId=NOGROUP; + if (YY_START!=ReadInitializer) current->mGrpId=NOGROUP; memberGroupHeader.resize(0); memberGroupDocs.resize(0); } @@ -3111,25 +3148,25 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") /* <FindFieldArg>"," { unput(*yytext); BEGIN(FindFields); } */ -<Curly>[^\r\n{}"'/]* { current->program += yytext ; } -<Curly>"//".* { current->program += yytext ; } -<Curly>\"[^\r\n"]*\" { current->program += yytext ; } -<Curly>"/*"{B}* { current->program += yytext ; - lastContext = Curly ; +<ReadBody>[^\r\n{}"'/]* { current->program += yytext ; } +<ReadBody>"//".* { current->program += yytext ; } +<ReadBody>\"[^\r\n"]*\" { current->program += yytext ; } +<ReadBody>"/*"{B}* { current->program += yytext ; + lastContext = ReadBody ; BEGIN( Comment ) ; } -<Curly>"/*"{BL} { current->program += yytext ; +<ReadBody>"/*"{BL} { current->program += yytext ; ++yyLineNr ; - lastContext = Curly ; + lastContext = ReadBody ; BEGIN( Comment ) ; } -<Curly>"'"\\[0-7]{1,3}"'" { current->program += yytext; } -<Curly>"'"\\."'" { current->program += yytext; } -<Curly>"'"."'" { current->program += yytext; } -<Curly>"{" { current->program += yytext ; +<ReadBody>"'"\\[0-7]{1,3}"'" { current->program += yytext; } +<ReadBody>"'"\\."'" { current->program += yytext; } +<ReadBody>"'"."'" { current->program += yytext; } +<ReadBody>"{" { current->program += yytext ; ++curlyCount ; } -<Curly>"}" { //err("Curly count=%d\n",curlyCount); +<ReadBody>"}" { //err("ReadBody count=%d\n",curlyCount); if ( curlyCount>0 ) { current->program += yytext ; @@ -3305,10 +3342,10 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") */ <MemberSpecSkip>"," { BEGIN(MemberSpec); } <MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); } -<Curly>{BN}+ { current->program += yytext ; +<ReadBody>{BN}+ { current->program += yytext ; lineCount() ; } -<Curly>. { current->program += yytext ; } +<ReadBody>. { current->program += yytext ; } <FindMembers>"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { current->bodyLine = yyLineNr; @@ -3596,12 +3633,14 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") <FuncQual,FuncRound,FuncFunc>. { current->args += *yytext; } <FuncQual>{BN}*"throw"{BN}*"(" { current->exception = " throw (" ; + roundCount=0; lineCount() ; BEGIN( ExcpRound ) ; } <FuncQual>{BN}*"raises"{BN}*"(" { current->exception = " raises (" ; lineCount() ; + roundCount=0; BEGIN( ExcpRound ) ; } <ExcpRound>"(" { current->exception += *yytext ; @@ -3619,6 +3658,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") <Function>"(" { current->type += current->name ; current->name = current->args ; current->args = yytext ; + roundCount=0; BEGIN( FuncRound ) ; } <Function>"#" { lastCPPContext = YY_START; @@ -3931,7 +3971,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") if (current->name.isEmpty() && !isTypedef) // anonymous compound current->name.sprintf("@%d",anonCount++); curlyCount=0; - BEGIN( Curly ) ; + BEGIN( ReadBody ) ; } <BasesProt>"virtual" { baseVirt = Virtual; } <BasesProt>"public" { baseProt = Public; } @@ -3975,6 +4015,8 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") BEGIN(lastSkipSharpContext); } <Specialization>{BN}+ { lineCount(); *specName +=' '; } +<Specialization>"<<" { *specName += yytext; } +<Specialization>">>" { *specName += yytext; } <Specialization>. { *specName += *yytext; } @@ -4008,7 +4050,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") new BaseInfo(baseName,baseProt,baseVirt) ); curlyCount=0; - BEGIN( Curly ) ; + BEGIN( ReadBody ) ; } <SkipUnionSwitch>"(" { roundCount++; @@ -4032,11 +4074,11 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") } <Comment>. { current->program += *yytext ; } -<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator>("//"{B}*)?"/*!" { +<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar>("//"{B}*)?"/*!" { //printf("Start doc block at %d\n",yyLineNr); removeSlashes=(yytext[1]=='/'); tmpDocType=-1; - if (YY_START==Curly) + if (YY_START==ReadBody) current->doc+="\n\n"; else current->doc.resize(0); @@ -4045,7 +4087,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") current->inside = current_root->name+"::"; BEGIN( Doc ); } -<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator>("//"{B}*)?"/**"/[^/*] { +<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar>("//"{B}*)?"/**"/[^/*] { removeSlashes=(yytext[1]=='/'); lastDocContext = YY_START; if (current_root->section & Entry::SCOPE_MASK) @@ -4053,7 +4095,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") if (!Config::autoBriefFlag) // use the Qt style { tmpDocType=-1; - if (YY_START==Curly) + if (YY_START==ReadBody) current->doc+="\n\n"; else current->doc.resize(0); @@ -4061,11 +4103,11 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") } else // Use the javadoc style { - if (YY_START==Curly) + if (YY_START==ReadBody) { tmpDocType=-1; current->doc+="\n\n"; - lastDocContext = Curly; + lastDocContext = ReadBody; BEGIN( Doc ); } else @@ -4077,7 +4119,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") } } } -<FindMembers,FindFields,MemberSpec,FuncQual,Operator>"//!" { +<FindMembers,FindFields,MemberSpec,FuncQual,Operator,ClassVar>"//!" { current->brief.resize(0); tmpDocType=-1; lastDocContext = YY_START; @@ -4085,7 +4127,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") current->inside = current_root->name+"::"; BEGIN( LineDoc ); } -<FindMembers,FindFields,MemberSpec,FuncQual,Operator>"///"/[^/] { +<FindMembers,FindFields,MemberSpec,FuncQual,Operator,ClassVar>"///"/[^/] { current->brief.resize(0); tmpDocType=-1; lastDocContext = YY_START; @@ -4286,6 +4328,12 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") memberGroupDocs.resize(0); BEGIN(GroupHeader); } +<LineDoc,Doc,JavaDoc,ClassDoc,PageDoc>"<!--" { + lastSkipHtmlCommentContext = YY_START; + BEGIN(SkipHtmlComment); + } +<SkipHtmlComment>"--"[!]?">" { BEGIN(lastSkipHtmlCommentContext); } +<SkipHtmlComment>. <LineDoc,Doc,JavaDoc,ClassDoc,PageDoc>{CMD}"todo"{B}+ { todoStartContext = YY_START; todoString.resize(0); diff --git a/src/translator.h b/src/translator.h index 80adc32..313b05e 100644 --- a/src/translator.h +++ b/src/translator.h @@ -519,9 +519,11 @@ class Translator /*! used as the title of the HTML page of a class/struct/union */ virtual QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool isTemplate) { QCString result=(QCString)clName+" "; + if (isTemplate) result+=" Template"; switch(compType) { case ClassDef::Class: result+=" Class"; break; @@ -893,6 +895,15 @@ class Translator { return "Attention"; } + virtual QCString trInclByDepGraph() + { + return "This graph shows which files directly or " + "indirectly include this file:"; + } + virtual QCString trSince() + { + return "Since"; + } }; #endif diff --git a/src/translator_cz.h b/src/translator_cz.h index fbf45d4..ffbcdc3 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -287,7 +287,8 @@ class TranslatorCzech : public Translator /*! used as the title of the HTML page of a class/struct/union */ QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) { QCString result=(QCString)clName+" "; result+=" Reference"; diff --git a/src/translator_de.h b/src/translator_de.h index 5736023..faaf665 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -429,7 +429,8 @@ class TranslatorGerman : public Translator ////////////////////////////////////////////////////////////////////////// QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) // used as the title of the HTML page of a class/struct/union { QCString result=(QCString)clName+" "; diff --git a/src/translator_es.h b/src/translator_es.h index 99b3327..a60a5ab 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -524,7 +524,8 @@ class TranslatorSpanish : public Translator /*! used as the title of the HTML page of a class/struct/union */ virtual QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) { QCString result=(QCString)clName+" "; switch(compType) diff --git a/src/translator_fi.h b/src/translator_fi.h index 9d5934c..d85d0c0 100644 --- a/src/translator_fi.h +++ b/src/translator_fi.h @@ -464,7 +464,8 @@ class TranslatorFinnish : public Translator ////////////////////////////////////////////////////////////////////////// virtual QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) // used as the title of the HTML page of a class/struct/union { QCString result=(QCString)clName+" "; diff --git a/src/translator_fr.h b/src/translator_fr.h index 89f1dc1..c7c5636 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -491,7 +491,8 @@ class TranslatorFrench : public Translator /*! used as the title of the HTML page of a class/struct/union */ virtual QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) { QCString result="RИfИrence de "; switch(compType) diff --git a/src/translator_hr.h b/src/translator_hr.h index 4dd9736..66ce398 100644 --- a/src/translator_hr.h +++ b/src/translator_hr.h @@ -261,7 +261,8 @@ class TranslatorCroatian : public Translator ////////////////////////////////////////////////////////////////////////// QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) // used as the title of the HTML page of a class/struct/union { QCString result="Opis "; diff --git a/src/translator_it.h b/src/translator_it.h index e80a4d6..f032b52 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -531,7 +531,8 @@ class TranslatorItalian : public Translator /*! used as the title of the HTML page of a class/struct/union */ QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /* isTemplate */) { QCString result="Riferimenti per "; switch(compType) diff --git a/src/translator_jp.h b/src/translator_jp.h index 05f29e7..38c8670 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -511,7 +511,8 @@ class TranslatorJapanese : public Translator /*! used as the title of the HTML page of a class/struct/union */ QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) { QCString result=""; switch(compType) diff --git a/src/translator_nl.h b/src/translator_nl.h index 5aae01f..e2de0fc 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -261,10 +261,12 @@ class TranslatorDutch : public Translator ////////////////////////////////////////////////////////////////////////// QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool isTemplate) // used as the title of the HTML page of a class/struct/union { QCString result=(QCString)clName+" "; + if (isTemplate) result+=" Template"; switch(compType) { case ClassDef::Class: result+=" Class"; break; diff --git a/src/translator_ru.h b/src/translator_ru.h index 1e58553..7f509be 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -402,7 +402,9 @@ class TranslatorRussian : public Translator // need translation return "Документация по друзьям класса и связанным с ними функциям"; } - QCString trCompoundReference(const char* clName,ClassDef::CompoundType compType) + QCString trCompoundReference(const char* clName, + ClassDef::CompoundType compType, + bool /*isTemplate*/) { QCString result=(QCString)clName+" "; switch(compType) diff --git a/src/translator_se.h b/src/translator_se.h index 1c283a4..afeea50 100644 --- a/src/translator_se.h +++ b/src/translator_se.h @@ -380,7 +380,8 @@ class TranslatorSwedish : public Translator ////////////////////////////////////////////////////////////////////////// virtual QCString trCompoundReference(const char *clName, - ClassDef::CompoundType compType) + ClassDef::CompoundType compType, + bool /*isTemplate*/) { QCString result=(QCString)clName+" "; switch(compType) diff --git a/src/util.cpp b/src/util.cpp index 83aafe2..9643a7d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -287,6 +287,7 @@ void linkifyText(OutputList &ol,const char *scName,const char *name,const char * int newIndex; int skipIndex=0; int floatingIndex=0; + if (strLen==0) return; // read a word from the text string while ((newIndex=regExp.match(txtStr,index,&matchLen))!=-1) { @@ -1987,6 +1988,7 @@ QCString substituteClassNames(const QCString &s) { int i=0,l,p; QCString result; + if (s.isEmpty()) return result; QRegExp r("[a-z_A-Z][a-z_A-Z0-9]*"); while ((p=r.match(s,i,&l))!=-1) { |