summaryrefslogtreecommitdiffstats
path: root/src/doxygen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r--src/doxygen.cpp349
1 files changed, 204 insertions, 145 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 15e56dc..68d7055 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * $Id$
+ *
*
*
* Copyright (C) 1997-2006 by Dimitri van Heesch.
@@ -1897,7 +1897,7 @@ static MemberDef *addVariableToClass(
}
Debug::print(Debug::Variables,0,
" class variable:\n"
- " `%s' `%s'::`%s' `%s' prot=`%d ann=%d init=%s\n",
+ " `%s' `%s'::`%s' `%s' prot=`%d ann=%d init=`%s'\n",
root->type.data(),
qualScope.data(),
name.data(),
@@ -2476,7 +2476,6 @@ static void buildVarList(EntryNav *rootNav)
else
mtype=MemberDef::Variable;
-
if (!root->relates.isEmpty()) // related variable
{
isRelated=TRUE;
@@ -2563,7 +2562,10 @@ nextMember:
EntryNav *e;
for (;(e=eli.current());++eli)
{
- if (e->section()!=Entry::ENUM_SEC) buildVarList(e);
+ if (e->section()!=Entry::ENUM_SEC)
+ {
+ buildVarList(e);
+ }
}
}
}
@@ -4669,8 +4671,13 @@ static void addMemberDocs(EntryNav *rootNav,
}
}
+ //printf("initializer: '%s'(isEmpty=%d) '%s'(isEmpty=%d)\n",
+ // md->initializer().data(),md->initializer().isEmpty(),
+ // root->initializer.data(),root->initializer.isEmpty()
+ // );
if (md->initializer().isEmpty() && !root->initializer.isEmpty())
{
+ //printf("setInitializer\n");
md->setInitializer(root->initializer);
md->setMaxInitLines(root->initLines);
}
@@ -6369,60 +6376,80 @@ static void addEnumValuesToEnums(EntryNav *rootNav)
EntryNav *e;
for (;(e=eli.current());++eli)
{
- //printf("e->name=%s isRelated=%d\n",e->name().data(),isRelated);
- MemberName *fmn=0;
- MemberNameSDict *emnsd = isRelated ? Doxygen::functionNameSDict : mnsd;
- if (!e->name().isEmpty() && (fmn=(*emnsd)[e->name()]))
- // get list of members with the same name as the field
+ SrcLangExt sle;
+ if (rootNav->fileDef() &&
+ ( (sle=getLanguageFromFileName(rootNav->fileDef()->name()))==SrcLangExt_CSharp
+ || sle==SrcLangExt_Java
+ )
+ )
+ {
+ // For C# enum value are only inside the enum scope, so we
+ // must create them here
+ e->loadEntry(g_storage);
+ MemberDef *fmd = addVariableToFile(e,MemberDef::EnumValue,
+ md->getOuterScope() ? md->getOuterScope()->name() : "",
+ e->name(),TRUE,0);
+ md->insertEnumField(fmd);
+ fmd->setEnumScope(md);
+ e->releaseEntry();
+ }
+ else
{
- MemberNameIterator fmni(*fmn);
- MemberDef *fmd;
- for (fmni.toFirst(); (fmd=fmni.current()) ; ++fmni)
+ //printf("e->name=%s isRelated=%d\n",e->name().data(),isRelated);
+ MemberName *fmn=0;
+ MemberNameSDict *emnsd = isRelated ? Doxygen::functionNameSDict : mnsd;
+ if (!e->name().isEmpty() && (fmn=(*emnsd)[e->name()]))
+ // get list of members with the same name as the field
{
- if (fmd->isEnumValue() && fmd->getOuterScope()==md->getOuterScope()) // in same scope
+ MemberNameIterator fmni(*fmn);
+ MemberDef *fmd;
+ for (fmni.toFirst(); (fmd=fmni.current()) ; ++fmni)
{
- //printf("found enum value with same name %s in scope %s\n",
- // fmd->name().data(),fmd->getOuterScope()->name().data());
- if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@')
+ if (fmd->isEnumValue() && fmd->getOuterScope()==md->getOuterScope()) // in same scope
{
- NamespaceDef *fnd=fmd->getNamespaceDef();
- if (fnd==nd) // enum value is inside a namespace
+ //printf("found enum value with same name %s in scope %s\n",
+ // fmd->name().data(),fmd->getOuterScope()->name().data());
+ if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@')
{
- md->insertEnumField(fmd);
- fmd->setEnumScope(md);
+ NamespaceDef *fnd=fmd->getNamespaceDef();
+ if (fnd==nd) // enum value is inside a namespace
+ {
+ md->insertEnumField(fmd);
+ fmd->setEnumScope(md);
+ }
}
- }
- else if (isGlobal)
- {
- FileDef *ffd=fmd->getFileDef();
- if (ffd==fd) // enum value has file scope
+ else if (isGlobal)
{
- md->insertEnumField(fmd);
- fmd->setEnumScope(md);
+ FileDef *ffd=fmd->getFileDef();
+ if (ffd==fd) // enum value has file scope
+ {
+ md->insertEnumField(fmd);
+ fmd->setEnumScope(md);
+ }
}
- }
- else if (isRelated && cd) // reparent enum value to
- // match the enum's scope
- {
- md->insertEnumField(fmd); // add field def to list
- fmd->setEnumScope(md); // cross ref with enum name
- fmd->setEnumClassScope(cd); // cross ref with enum name
- fmd->setOuterScope(cd);
- fmd->makeRelated();
- cd->insertMember(fmd);
- }
- else
- {
- ClassDef *fcd=fmd->getClassDef();
- if (fcd==cd) // enum value is inside a class
+ else if (isRelated && cd) // reparent enum value to
+ // match the enum's scope
+ {
+ md->insertEnumField(fmd); // add field def to list
+ fmd->setEnumScope(md); // cross ref with enum name
+ fmd->setEnumClassScope(cd); // cross ref with enum name
+ fmd->setOuterScope(cd);
+ fmd->makeRelated();
+ cd->insertMember(fmd);
+ }
+ else
{
- //printf("Inserting enum field %s in enum scope %s\n",
- // fmd->name().data(),md->name().data());
- md->insertEnumField(fmd); // add field def to list
- fmd->setEnumScope(md); // cross ref with enum name
+ ClassDef *fcd=fmd->getClassDef();
+ if (fcd==cd) // enum value is inside a class
+ {
+ //printf("Inserting enum field %s in enum scope %s\n",
+ // fmd->name().data(),md->name().data());
+ md->insertEnumField(fmd); // add field def to list
+ fmd->setEnumScope(md); // cross ref with enum name
+ }
}
- }
- }
+ }
+ }
}
}
}
@@ -6994,6 +7021,7 @@ static void inheritDocumentation()
md->setDocumentation(bmd->documentation(),bmd->docFile(),bmd->docLine());
md->setDocsForDefinition(bmd->isDocsForDefinition());
md->setBriefDescription(bmd->briefDescription(),bmd->briefFile(),bmd->briefLine());
+ md->copyArgumentNames(bmd);
md->setInbodyDocumentation(bmd->inbodyDocumentation(),bmd->inbodyFile(),bmd->inbodyLine());
}
}
@@ -7697,6 +7725,25 @@ static void buildExampleList(EntryNav *rootNav)
}
//----------------------------------------------------------------------------
+// prints the Entry tree (for debugging)
+
+void printNavTree(EntryNav *rootNav,int indent)
+{
+ QCString indentStr;
+ indentStr.fill(' ',indent);
+ msg("%s%s (sec=0x%x)\n",
+ indentStr.isEmpty()?"":indentStr.data(),
+ rootNav->name().isEmpty()?"<empty>":rootNav->name().data(),
+ rootNav->section());
+ if (rootNav->children())
+ {
+ EntryNavListIterator eli(*rootNav->children());
+ for (;eli.current();++eli) printNavTree(eli.current(),indent+2);
+ }
+}
+
+
+//----------------------------------------------------------------------------
// generate the example documentation
static void generateExampleDocs()
@@ -8065,7 +8112,6 @@ static bool patternMatch(QFileInfo *fi,QStrList *patList)
int i=pattern.find('=');
if (i!=-1) pattern=pattern.left(i); // strip of the extension specific filter name
- //printf("Matching `%s' against pattern `%s'\n",fi->fileName().data(),pattern);
#if defined(_WIN32) // windows
QRegExp re(pattern,FALSE,TRUE); // case insensitive match
#else // unix
@@ -8074,6 +8120,8 @@ static bool patternMatch(QFileInfo *fi,QStrList *patList)
found = found || re.match(fi->fileName())!=-1 ||
re.match(fi->filePath())!=-1 ||
re.match(fi->absFilePath())!=-1;
+ //printf("Matching `%s' against pattern `%s' found=%d\n",
+ // fi->fileName().data(),pattern.data(),found);
pattern=patList->next();
}
}
@@ -8255,7 +8303,7 @@ static int readDir(QFileInfo *fi,
QDir dir((const char *)fi->absFilePath());
dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden );
int totalSize=0;
- msg("Search for files in directory %s\n", fi->absFilePath().data());
+ msg("Searching for files in directory %s\n", fi->absFilePath().data());
//printf("killDict=%p count=%d\n",killDict,killDict->count());
const QFileInfoList *list = dir.entryInfoList();
@@ -8312,6 +8360,7 @@ static int readDir(QFileInfo *fi,
else if (recursive &&
(!Config_getBool("EXCLUDE_SYMLINKS") || !cfi->isSymLink()) &&
cfi->isDir() && cfi->fileName()!="." &&
+ !patternMatch(cfi,exclPatList) &&
cfi->fileName()!="..")
{
cfi->setFile(cfi->absFilePath());
@@ -9137,8 +9186,109 @@ void parseInput()
bool alwaysRecursive = Config_getBool("RECURSIVE");
/**************************************************************************
+ * Check/create output directorties *
+ **************************************************************************/
+
+ QCString &htmlOutput = Config_getString("HTML_OUTPUT");
+ bool &generateHtml = Config_getBool("GENERATE_HTML");
+ if (htmlOutput.isEmpty() && generateHtml)
+ {
+ htmlOutput=outputDirectory+"/html";
+ }
+ else if (htmlOutput && htmlOutput[0]!='/' && htmlOutput[1]!=':')
+ {
+ htmlOutput.prepend(outputDirectory+'/');
+ }
+ QDir htmlDir(htmlOutput);
+ if (generateHtml && !htmlDir.exists() && !htmlDir.mkdir(htmlOutput))
+ {
+ err("Could not create output directory %s\n",htmlOutput.data());
+ cleanUpDoxygen();
+ exit(1);
+ }
+
+ QCString &xmlOutput = Config_getString("XML_OUTPUT");
+ bool &generateXml = Config_getBool("GENERATE_XML");
+ if (xmlOutput.isEmpty() && generateXml)
+ {
+ xmlOutput=outputDirectory+"/xml";
+ }
+ else if (xmlOutput && xmlOutput[0]!='/' && xmlOutput[1]!=':')
+ {
+ xmlOutput.prepend(outputDirectory+'/');
+ }
+ QDir xmlDir(xmlOutput);
+ if (generateXml && !xmlDir.exists() && !xmlDir.mkdir(xmlOutput))
+ {
+ err("Could not create output directory %s\n",xmlOutput.data());
+ cleanUpDoxygen();
+ exit(1);
+ }
+
+ QCString &latexOutput = Config_getString("LATEX_OUTPUT");
+ bool &generateLatex = Config_getBool("GENERATE_LATEX");
+ if (latexOutput.isEmpty() && generateLatex)
+ {
+ latexOutput=outputDirectory+"/latex";
+ }
+ else if (latexOutput && latexOutput[0]!='/' && latexOutput[1]!=':')
+ {
+ latexOutput.prepend(outputDirectory+'/');
+ }
+ QDir latexDir(latexOutput);
+ if (generateLatex && !latexDir.exists() && !latexDir.mkdir(latexOutput))
+ {
+ err("Could not create output directory %s\n",latexOutput.data());
+ cleanUpDoxygen();
+ exit(1);
+ }
+
+ QCString &rtfOutput = Config_getString("RTF_OUTPUT");
+ bool &generateRtf = Config_getBool("GENERATE_RTF");
+ if (rtfOutput.isEmpty() && generateRtf)
+ {
+ rtfOutput=outputDirectory+"/rtf";
+ }
+ else if (rtfOutput && rtfOutput[0]!='/' && rtfOutput[1]!=':')
+ {
+ rtfOutput.prepend(outputDirectory+'/');
+ }
+ QDir rtfDir(rtfOutput);
+ if (generateRtf && !rtfDir.exists() && !rtfDir.mkdir(rtfOutput))
+ {
+ err("Could not create output directory %s\n",rtfOutput.data());
+ cleanUpDoxygen();
+ exit(1);
+ }
+
+ QCString &manOutput = Config_getString("MAN_OUTPUT");
+ bool &generateMan = Config_getBool("GENERATE_MAN");
+ if (manOutput.isEmpty() && generateMan)
+ {
+ manOutput=outputDirectory+"/man";
+ }
+ else if (manOutput && manOutput[0]!='/' && manOutput[1]!=':')
+ {
+ manOutput.prepend(outputDirectory+'/');
+ }
+ QDir manDir(manOutput);
+ if (generateMan && !manDir.exists() && !manDir.mkdir(manOutput))
+ {
+ err("Could not create output directory %s\n",manOutput.data());
+ cleanUpDoxygen();
+ exit(1);
+ }
+ /**************************************************************************
* Read and preprocess input *
**************************************************************************/
+
+ QStrList &exclPatterns = Config_getList("EXCLUDE_PATTERNS");
+ // prevent search in the output directories
+ if (generateHtml) exclPatterns.append(htmlOutput);
+ if (generateXml) exclPatterns.append(xmlOutput);
+ if (generateLatex) exclPatterns.append(latexOutput);
+ if (generateRtf) exclPatterns.append(rtfOutput);
+ if (generateMan) exclPatterns.append(manOutput);
// gather names of all files in the include path
msg("Searching for include files...\n");
@@ -9152,7 +9302,7 @@ void parseInput()
pl = Config_getList("FILE_PATTERNS");
}
readFileOrDirectory(s,0,Doxygen::includeNameDict,0,&pl,
- &Config_getList("EXCLUDE_PATTERNS"),0,0,
+ &exclPatterns,0,0,
alwaysRecursive);
s=includePathList.next();
}
@@ -9226,7 +9376,7 @@ void parseInput()
Doxygen::inputNameDict,
&excludeNameDict,
&Config_getList("FILE_PATTERNS"),
- &Config_getList("EXCLUDE_PATTERNS"),
+ &exclPatterns,
&inputFiles,0,
alwaysRecursive,
TRUE,
@@ -9250,99 +9400,6 @@ void parseInput()
// read aliases and store them in a dictionary
readAliases();
- /**************************************************************************
- * Check/create output directorties *
- **************************************************************************/
-
- QCString &htmlOutput = Config_getString("HTML_OUTPUT");
- bool &generateHtml = Config_getBool("GENERATE_HTML");
- if (htmlOutput.isEmpty() && generateHtml)
- {
- htmlOutput=outputDirectory+"/html";
- }
- else if (htmlOutput && htmlOutput[0]!='/' && htmlOutput[1]!=':')
- {
- htmlOutput.prepend(outputDirectory+'/');
- }
- QDir htmlDir(htmlOutput);
- if (generateHtml && !htmlDir.exists() && !htmlDir.mkdir(htmlOutput))
- {
- err("Could not create output directory %s\n",htmlOutput.data());
- cleanUpDoxygen();
- exit(1);
- }
-
- QCString &xmlOutput = Config_getString("XML_OUTPUT");
- bool &generateXml = Config_getBool("GENERATE_XML");
- if (xmlOutput.isEmpty() && generateXml)
- {
- xmlOutput=outputDirectory+"/xml";
- }
- else if (xmlOutput && xmlOutput[0]!='/' && xmlOutput[1]!=':')
- {
- xmlOutput.prepend(outputDirectory+'/');
- }
- QDir xmlDir(xmlOutput);
- if (generateXml && !xmlDir.exists() && !xmlDir.mkdir(xmlOutput))
- {
- err("Could not create output directory %s\n",xmlOutput.data());
- cleanUpDoxygen();
- exit(1);
- }
-
- QCString &latexOutput = Config_getString("LATEX_OUTPUT");
- bool &generateLatex = Config_getBool("GENERATE_LATEX");
- if (latexOutput.isEmpty() && generateLatex)
- {
- latexOutput=outputDirectory+"/latex";
- }
- else if (latexOutput && latexOutput[0]!='/' && latexOutput[1]!=':')
- {
- latexOutput.prepend(outputDirectory+'/');
- }
- QDir latexDir(latexOutput);
- if (generateLatex && !latexDir.exists() && !latexDir.mkdir(latexOutput))
- {
- err("Could not create output directory %s\n",latexOutput.data());
- cleanUpDoxygen();
- exit(1);
- }
-
- QCString &rtfOutput = Config_getString("RTF_OUTPUT");
- bool &generateRtf = Config_getBool("GENERATE_RTF");
- if (rtfOutput.isEmpty() && generateRtf)
- {
- rtfOutput=outputDirectory+"/rtf";
- }
- else if (rtfOutput && rtfOutput[0]!='/' && rtfOutput[1]!=':')
- {
- rtfOutput.prepend(outputDirectory+'/');
- }
- QDir rtfDir(rtfOutput);
- if (generateRtf && !rtfDir.exists() && !rtfDir.mkdir(rtfOutput))
- {
- err("Could not create output directory %s\n",rtfOutput.data());
- cleanUpDoxygen();
- exit(1);
- }
-
- QCString &manOutput = Config_getString("MAN_OUTPUT");
- bool &generateMan = Config_getBool("GENERATE_MAN");
- if (manOutput.isEmpty() && generateMan)
- {
- manOutput=outputDirectory+"/man";
- }
- else if (manOutput && manOutput[0]!='/' && manOutput[1]!=':')
- {
- manOutput.prepend(outputDirectory+'/');
- }
- QDir manDir(manOutput);
- if (generateMan && !manDir.exists() && !manDir.mkdir(manOutput))
- {
- err("Could not create output directory %s\n",manOutput.data());
- cleanUpDoxygen();
- exit(1);
- }
// Notice: the order of the function calls below is very important!
@@ -9390,6 +9447,8 @@ void parseInput()
exit(1);
}
+ //printNavTree(rootNav,0);
+
// we are done with input scanning now, so free up the buffers used by flex
// (can be around 4MB)
preFreeScanner();