summaryrefslogtreecommitdiffstats
path: root/src/definition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/definition.cpp')
-rw-r--r--src/definition.cpp95
1 files changed, 48 insertions, 47 deletions
diff --git a/src/definition.cpp b/src/definition.cpp
index 5b2136c..e18932e 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -51,22 +51,21 @@
class DefinitionImpl::IMPL
{
public:
- IMPL();
~IMPL();
void init(const char *df, const char *n);
void setDefFileName(const QCString &df);
- SectionDict *sectionDict; // dictionary of all sections, not accessible
+ SectionDict *sectionDict = 0; // dictionary of all sections, not accessible
- MemberSDict *sourceRefByDict;
- MemberSDict *sourceRefsDict;
+ MemberSDict *sourceRefByDict = 0;
+ MemberSDict *sourceRefsDict = 0;
std::vector<ListItemInfo> xrefListItems;
- GroupList *partOfGroups;
+ GroupList *partOfGroups = 0;
- DocInfo *details; // not exported
- DocInfo *inbodyDocs; // not exported
- BriefInfo *brief; // not exported
- BodyInfo *body; // not exported
+ DocInfo *details = 0; // not exported
+ DocInfo *inbodyDocs = 0; // not exported
+ BriefInfo *brief = 0; // not exported
+ BodyInfo *body = 0; // not exported
QCString briefSignatures;
QCString docSignatures;
@@ -75,16 +74,17 @@ class DefinitionImpl::IMPL
QCString qualifiedName;
QCString ref; // reference to external documentation
- bool hidden;
- bool isArtificial;
+ bool hidden = FALSE;
+ bool isArtificial = FALSE;
+ bool isAnonymous = FALSE;
- Definition *outerScope; // not owner
+ Definition *outerScope = 0; // not owner
// where the item was defined
QCString defFileName;
QCString defFileExt;
- SrcLangExt lang;
+ SrcLangExt lang = SrcLangExt_Unknown;
QCString id; // clang unique id
@@ -96,13 +96,6 @@ class DefinitionImpl::IMPL
Cookie *cookie;
};
-DefinitionImpl::IMPL::IMPL()
- : sectionDict(0), sourceRefByDict(0), sourceRefsDict(0),
- partOfGroups(0),
- details(0), inbodyDocs(0), brief(0), body(0), hidden(FALSE), isArtificial(FALSE),
- outerScope(0), lang(SrcLangExt_Unknown)
-{
-}
DefinitionImpl::IMPL::~IMPL()
{
@@ -304,7 +297,7 @@ DefinitionImpl::DefinitionImpl(const char *df,int dl,int dc,
const char *d,bool isSymbol)
{
m_impl = new DefinitionImpl::IMPL;
- m_impl->name = name;
+ setName(name);
m_impl->defLine = dl;
m_impl->defColumn = dc;
m_impl->init(df,name);
@@ -406,6 +399,9 @@ void DefinitionImpl::setName(const char *name)
{
if (name==0) return;
m_impl->name = name;
+ m_impl->isAnonymous = m_impl->name.isEmpty() ||
+ m_impl->name.at(0)=='@' ||
+ m_impl->name.find("::@")!=-1;
}
void DefinitionImpl::setId(const char *id)
@@ -532,7 +528,7 @@ void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) const
SectionInfo *si;
for (;(si=sdi.current());++sdi)
{
- if (!si->generated && si->ref.isEmpty())
+ if (!si->generated && si->ref.isEmpty() && !si->label.startsWith("autotoc_md"))
{
//printf("write an entry!\n");
if (definitionType()==TypeMember) tagFile << " ";
@@ -748,12 +744,12 @@ class FilterCache
// file already processed, get the results after filtering from the tmp file
Debug::print(Debug::FilterOutput,0,"Reusing filter result for %s from %s at offset=%d size=%d\n",
qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item->filePos,(int)item->fileSize);
- f = portable_fopen(Doxygen::filterDBFileName,"rb");
+ f = Portable::fopen(Doxygen::filterDBFileName,"rb");
if (f)
{
bool success=TRUE;
str.resize(item->fileSize+1);
- if (portable_fseek(f,item->filePos,SEEK_SET)==-1)
+ if (Portable::fseek(f,item->filePos,SEEK_SET)==-1)
{
err("Failed to seek to position %d in filter database file %s\n",(int)item->filePos,qPrint(Doxygen::filterDBFileName));
success=FALSE;
@@ -784,8 +780,8 @@ class FilterCache
// filter file
QCString cmd=filter+" \""+fileName+"\"";
Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
- f = portable_popen(cmd,"r");
- FILE *bf = portable_fopen(Doxygen::filterDBFileName,"a+b");
+ f = Portable::popen(cmd,"r");
+ FILE *bf = Portable::fopen(Doxygen::filterDBFileName,"a+b");
FilterCacheItem *item = new FilterCacheItem;
item->filePos = m_endPos;
if (bf==0)
@@ -794,7 +790,7 @@ class FilterCache
err("Error opening filter database file %s\n",qPrint(Doxygen::filterDBFileName));
str.addChar('\0');
delete item;
- portable_pclose(f);
+ Portable::pclose(f);
return FALSE;
}
// append the filtered output to the database file
@@ -810,7 +806,7 @@ class FilterCache
qPrint(Doxygen::filterDBFileName),bytesWritten,bytesRead);
str.addChar('\0');
delete item;
- portable_pclose(f);
+ Portable::pclose(f);
fclose(bf);
return FALSE;
}
@@ -825,14 +821,14 @@ class FilterCache
qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item->filePos,(int)item->fileSize);
// update end of file position
m_endPos += size;
- portable_pclose(f);
+ Portable::pclose(f);
fclose(bf);
}
else // no filtering
{
// normal file
//printf("getFileContents(%s): no filter\n",qPrint(fileName));
- f = portable_fopen(fileName,"r");
+ f = Portable::fopen(fileName,"r");
while (!feof(f))
{
int bytesRead = fread(buf,1,blockSize,f);
@@ -1001,7 +997,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());
+ //printf("readCodeFragment(%d-%d)=%s\n",startLine,endLine,result.data());
return found;
}
@@ -1266,26 +1262,26 @@ void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) const
{
//printf("Adding code fragment '%s' ext='%s'\n",
// codeFragment.data(),m_impl->defFileExt.data());
- ParserInterface *pIntf = Doxygen::parserManager->getParser(m_impl->defFileExt);
- pIntf->resetCodeParserState();
+ CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(m_impl->defFileExt);
+ intf.resetCodeParserState();
//printf("Read:\n'%s'\n\n",codeFragment.data());
const MemberDef *thisMd = 0;
if (definitionType()==TypeMember) thisMd = dynamic_cast <const MemberDef*>(this);
ol.startCodeFragment();
- pIntf->parseCode(ol, // codeOutIntf
- scopeName, // scope
- codeFragment, // input
- m_impl->lang, // lang
- FALSE, // isExample
- 0, // exampleName
- m_impl->body->fileDef, // fileDef
- actualStart, // startLine
- actualEnd, // endLine
- TRUE, // inlineFragment
- thisMd, // memberDef
- TRUE // show line numbers
- );
+ intf.parseCode(ol, // codeOutIntf
+ scopeName, // scope
+ codeFragment, // input
+ m_impl->lang, // lang
+ FALSE, // isExample
+ 0, // exampleName
+ m_impl->body->fileDef, // fileDef
+ actualStart, // startLine
+ actualEnd, // endLine
+ TRUE, // inlineFragment
+ thisMd, // memberDef
+ TRUE // show line numbers
+ );
ol.endCodeFragment();
}
}
@@ -1610,7 +1606,7 @@ void DefinitionImpl::makePartOfGroup(GroupDef *gd)
void DefinitionImpl::setRefItems(const std::vector<ListItemInfo> &sli)
{
- m_impl->xrefListItems = sli;
+ m_impl->xrefListItems.insert(m_impl->xrefListItems.end(), sli.cbegin(), sli.cend());
}
void DefinitionImpl::mergeRefItems(Definition *d)
@@ -2203,6 +2199,11 @@ QCString DefinitionImpl::name() const
return m_impl->name;
}
+bool DefinitionImpl::isAnonymous() const
+{
+ return m_impl->isAnonymous;
+}
+
int DefinitionImpl::getDefLine() const
{
return m_impl->defLine;