summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/definition.cpp18
-rw-r--r--src/definition.h12
-rw-r--r--src/definitionimpl.h7
-rw-r--r--src/doxygen.cpp60
-rw-r--r--src/memberdef.cpp6
-rw-r--r--src/vhdldocgen.cpp2
6 files changed, 59 insertions, 46 deletions
diff --git a/src/definition.cpp b/src/definition.cpp
index 9d64b02..e4b75a1 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -999,11 +999,11 @@ QCString DefinitionImpl::getSourceAnchor() const
{
if (Htags::useHtags)
{
- qsnprintf(anchorStr,maxAnchorStrLen,"L%d",m_impl->body->startLine);
+ qsnprintf(anchorStr,maxAnchorStrLen,"L%d",m_impl->body->defLine);
}
else
{
- qsnprintf(anchorStr,maxAnchorStrLen,"l%05d",m_impl->body->startLine);
+ qsnprintf(anchorStr,maxAnchorStrLen,"l%05d",m_impl->body->defLine);
}
}
return anchorStr;
@@ -1026,7 +1026,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
{
QCString lineStr;
- lineStr.sprintf("%d",m_impl->body->startLine);
+ lineStr.sprintf("%d",m_impl->body->defLine);
QCString anchorStr = getSourceAnchor();
ol.startParagraph("definition");
if (lineMarkerPos<fileMarkerPos) // line marker before file marker
@@ -1198,12 +1198,13 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
ol.popGeneratorState();
}
-void DefinitionImpl::setBodySegment(int bls,int ble)
+void DefinitionImpl::setBodySegment(int defLine, int bls,int ble)
{
//printf("setBodySegment(%d,%d) for %s\n",bls,ble,name().data());
if (m_impl->body==0) m_impl->body = new BodyInfo;
- m_impl->body->startLine=bls;
- m_impl->body->endLine=ble;
+ m_impl->body->defLine = defLine;
+ m_impl->body->startLine = bls;
+ m_impl->body->endLine = ble;
}
void DefinitionImpl::setBodyDef(FileDef *fd)
@@ -2057,6 +2058,11 @@ bool DefinitionImpl::isReference() const
return !m_impl->ref.isEmpty();
}
+int DefinitionImpl::getStartDefLine() const
+{
+ return m_impl->body ? m_impl->body->defLine : -1;
+}
+
int DefinitionImpl::getStartBodyLine() const
{
return m_impl->body ? m_impl->body->startLine : -1;
diff --git a/src/definition.h b/src/definition.h
index f28b47f..318a35b 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -62,8 +62,9 @@ struct BriefInfo
/** Data associated with description found in the body. */
struct BodyInfo
{
- int startLine; //!< line number of the start of the definition
- int endLine; //!< line number of the end of the definition
+ int defLine; //!< line number of the start of the definition
+ int startLine; //!< line number of the start of the definition's body
+ int endLine; //!< line number of the end of the definition's body
FileDef *fileDef; //!< file definition containing the function body
};
@@ -188,7 +189,7 @@ class Definition : public DefinitionIntf
/*! returns the extension of the file in which this definition was found */
virtual QCString getDefFileExtension() const = 0;
- /*! returns the line number at which the definition was found */
+ /*! returns the line number at which the definition was found (can be the declaration) */
virtual int getDefLine() const = 0;
/*! returns the column number at which the definition was found */
@@ -242,6 +243,9 @@ class Definition : public DefinitionIntf
/*! Convenience method to return a resolved external link */
virtual QCString externalReference(const QCString &relPath) const = 0;
+ /*! Returns the first line of the implementation of this item. See also getDefLine() */
+ virtual int getStartDefLine() const = 0;
+
/*! Returns the first line of the body of this item (applicable to classes and
* functions).
*/
@@ -316,7 +320,7 @@ class Definition : public DefinitionIntf
virtual void setReference(const char *r) = 0;
// source references
- virtual void setBodySegment(int bls,int ble) = 0;
+ virtual void setBodySegment(int defLine, int bls,int ble) = 0;
virtual void setBodyDef(FileDef *fd) = 0;
virtual void setRefItems(const std::vector<RefItem*> &sli) = 0;
diff --git a/src/definitionimpl.h b/src/definitionimpl.h
index d9c222d..28d60b6 100644
--- a/src/definitionimpl.h
+++ b/src/definitionimpl.h
@@ -61,6 +61,7 @@ class DefinitionImpl : virtual public Definition
virtual QCString getReference() const;
virtual bool isReference() const;
virtual QCString externalReference(const QCString &relPath) const;
+ virtual int getStartDefLine() const;
virtual int getStartBodyLine() const;
virtual int getEndBodyLine() const;
virtual FileDef *getBodyDef() const;
@@ -85,7 +86,7 @@ class DefinitionImpl : virtual public Definition
virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine);
virtual void setReference(const char *r);
virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList);
- virtual void setBodySegment(int bls,int ble);
+ virtual void setBodySegment(int defLine,int bls,int ble);
virtual void setBodyDef(FileDef *fd);
virtual void addSourceReferencedBy(const MemberDef *d);
virtual void addSourceReferences(const MemberDef *d);
@@ -201,6 +202,8 @@ class DefinitionAliasImpl : virtual public Definition
{ return m_def->isReference(); }
virtual QCString externalReference(const QCString &relPath) const
{ return m_def->externalReference(relPath); }
+ virtual int getStartDefLine() const
+ { return m_def->getStartDefLine(); }
virtual int getStartBodyLine() const
{ return m_def->getStartBodyLine(); }
virtual int getEndBodyLine() const
@@ -245,7 +248,7 @@ class DefinitionAliasImpl : virtual public Definition
virtual void setInbodyDocumentation(const char *,const char *,int) {}
virtual void setReference(const char *) {}
virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &) {}
- virtual void setBodySegment(int,int) {}
+ virtual void setBodySegment(int,int,int) {}
virtual void setBodyDef(FileDef *) {}
virtual void addSourceReferencedBy(const MemberDef *) {}
virtual void addSourceReferences(const MemberDef *) {}
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index cc6b898..56fac35 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -997,7 +997,7 @@ static void addClassToContext(const Entry *root)
if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1)
{
- cd->setBodySegment(root->bodyLine,root->endBodyLine);
+ cd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
cd->setBodyDef(fd);
}
//cd->setName(fullName); // change name to match docs
@@ -1074,7 +1074,7 @@ static void addClassToContext(const Entry *root)
cd->setIsStatic(root->stat);
// file definition containing the class cd
- cd->setBodySegment(root->bodyLine,root->endBodyLine);
+ cd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
cd->setBodyDef(fd);
cd->setMetaData(root->metaData);
@@ -1280,7 +1280,7 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC
cd->setDocumentation(templ->documentation(),templ->docFile(),templ->docLine()); // copy docs to definition
cd->setBriefDescription(templ->briefDescription(),templ->briefFile(),templ->briefLine());
cd->setLanguage(templ->getLanguage());
- cd->setBodySegment(templ->getStartBodyLine(),templ->getEndBodyLine());
+ cd->setBodySegment(templ->getDefLine(),templ->getStartBodyLine(),templ->getEndBodyLine());
cd->setBodyDef(templ->getBodyDef());
cd->setOuterScope(rootCd->getOuterScope());
@@ -1535,7 +1535,7 @@ static void buildNamespaceList(const Entry *root)
// the empty string test is needed for extract all case
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->insertUsedFile(fd);
- nd->setBodySegment(root->bodyLine,root->endBodyLine);
+ nd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
nd->setBodyDef(fd);
// add class to the list
Doxygen::namespaceSDict->inSort(fullName,nd);
@@ -1927,7 +1927,7 @@ static void findUsingDeclImports(const Entry *root)
newMd->enableReferencesRelation(root->referencesRelation);
newMd->setBitfields(md->bitfieldString());
newMd->addSectionsToDefinition(root->anchors);
- newMd->setBodySegment(md->getStartBodyLine(),md->getEndBodyLine());
+ newMd->setBodySegment(md->getDefLine(),md->getStartBodyLine(),md->getEndBodyLine());
newMd->setBodyDef(md->getBodyDef());
newMd->setInitializer(md->initializer());
newMd->setMaxInitLines(md->initializerLines());
@@ -2112,7 +2112,7 @@ static MemberDef *addVariableToClass(
md->setFromAnonymousScope(fromAnnScope);
md->setFromAnonymousMember(fromAnnMemb);
//md->setIndentDepth(indentDepth);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setInitializer(root->initializer);
md->setMaxInitLines(root->initLines);
md->setMemberGroupId(root->mGrpId);
@@ -2381,7 +2381,7 @@ static MemberDef *addVariableToFile(
//md->setOuterScope(fd);
if (!root->explicitExternal)
{
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(fd);
}
addMemberToGroups(root,md);
@@ -2898,7 +2898,7 @@ static void addInterfaceOrServiceToServiceOrSingleton(
md->setDocsForDefinition(false);
md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setMemberSpecifiers(root->spec);
md->setMemberGroupId(root->mGrpId);
md->setTypeConstraints(root->typeConstr);
@@ -3087,7 +3087,7 @@ static void addMethodToClass(const Entry *root,ClassDef *cd,
md->setDocsForDefinition(!root->proto);
md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setMemberSpecifiers(spec);
md->setMemberGroupId(root->mGrpId);
md->setTypeConstraints(root->typeConstr);
@@ -3393,7 +3393,7 @@ static void buildFunctionList(const Entry *root)
md->setDocsForDefinition(!root->proto);
if (md->getStartBodyLine()==-1 && root->bodyLine!=-1)
{
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(rfd);
}
@@ -3469,7 +3469,7 @@ static void buildFunctionList(const Entry *root)
md->setDocsForDefinition(!root->proto);
md->setTypeConstraints(root->typeConstr);
//md->setBody(root->body);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->addSectionsToDefinition(root->anchors);
@@ -3659,13 +3659,13 @@ static void findFriends()
//printf("body mmd %d fmd %d\n",mmd->getStartBodyLine(),fmd->getStartBodyLine());
if (mmd->getStartBodyLine()==-1 && fmd->getStartBodyLine()!=-1)
{
- mmd->setBodySegment(fmd->getStartBodyLine(),fmd->getEndBodyLine());
+ mmd->setBodySegment(fmd->getDefLine(),fmd->getStartBodyLine(),fmd->getEndBodyLine());
mmd->setBodyDef(fmd->getBodyDef());
//mmd->setBodyMember(fmd);
}
else if (mmd->getStartBodyLine()!=-1 && fmd->getStartBodyLine()==-1)
{
- fmd->setBodySegment(mmd->getStartBodyLine(),mmd->getEndBodyLine());
+ fmd->setBodySegment(mmd->getDefLine(),mmd->getStartBodyLine(),mmd->getEndBodyLine());
fmd->setBodyDef(mmd->getBodyDef());
//fmd->setBodyMember(mmd);
}
@@ -5093,7 +5093,7 @@ static void addMemberDocs(const Entry *root,
)
{
//printf("Setting new body segment [%d,%d]\n",root->bodyLine,root->endBodyLine);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(rfd);
}
@@ -6131,7 +6131,7 @@ static void findMember(const Entry *root,
md->setDocsForDefinition(!root->proto);
md->setPrototype(root->proto,root->fileName,root->startLine,root->startColumn);
md->addSectionsToDefinition(root->anchors);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->setMemberSpecifiers(spec);
@@ -6200,7 +6200,7 @@ static void findMember(const Entry *root,
md->setDocsForDefinition(!root->proto);
md->setPrototype(root->proto,root->fileName,root->startLine,root->startColumn);
md->addSectionsToDefinition(root->anchors);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->setMemberSpecifiers(spec);
@@ -6373,7 +6373,7 @@ static void findMember(const Entry *root,
}
if (rmd) // member found -> copy line number info
{
- md->setBodySegment(rmd->getStartBodyLine(),rmd->getEndBodyLine());
+ md->setBodySegment(rmd->getDefLine(),rmd->getStartBodyLine(),rmd->getEndBodyLine());
md->setBodyDef(rmd->getBodyDef());
//md->setBodyMember(rmd);
}
@@ -6382,7 +6382,7 @@ static void findMember(const Entry *root,
if (!found) // line number could not be found or is available in this
// entry
{
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(fd);
}
@@ -6476,7 +6476,7 @@ localObjCMethod:
md->setDocsForDefinition(!root->proto);
md->setPrototype(root->proto,root->fileName,root->startLine,root->startColumn);
md->addSectionsToDefinition(root->anchors);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->setMemberSpecifiers(spec);
@@ -6819,7 +6819,7 @@ static void findEnums(const Entry *root)
md->setLanguage(root->lang);
md->setId(root->id);
if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(root->fileDef());
md->setMemberSpecifiers(root->spec);
md->setEnumBaseType(root->args);
@@ -7722,9 +7722,9 @@ static void addSourceReferences()
for (cli.toFirst();(cd=cli.current());++cli)
{
FileDef *fd=cd->getBodyDef();
- if (fd && cd->isLinkableInProject() && cd->getDefLine()!=-1)
+ if (fd && cd->isLinkableInProject() && cd->getStartDefLine()!=-1)
{
- fd->addSourceRef(cd->getDefLine(),cd,0);
+ fd->addSourceRef(cd->getStartDefLine(),cd,0);
}
}
// add source references for namespace definitions
@@ -7733,9 +7733,9 @@ static void addSourceReferences()
for (nli.toFirst();(nd=nli.current());++nli)
{
FileDef *fd=nd->getBodyDef();
- if (fd && nd->isLinkableInProject() && nd->getDefLine()!=-1)
+ if (fd && nd->isLinkableInProject() && nd->getStartDefLine()!=-1)
{
- fd->addSourceRef(nd->getDefLine(),nd,0);
+ fd->addSourceRef(nd->getStartDefLine(),nd,0);
}
}
@@ -7754,14 +7754,14 @@ static void addSourceReferences()
// md->getStartBodyLine(),md->isLinkableInProject());
FileDef *fd=md->getBodyDef();
if (fd &&
- md->getDefLine()!=-1 &&
+ md->getStartDefLine()!=-1 &&
md->isLinkableInProject() &&
(fd->generateSourceFile() || Doxygen::parseSourcesNeeded)
)
{
//printf("Found member '%s' in file '%s' at line '%d' def=%s\n",
// md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data());
- fd->addSourceRef(md->getDefLine(),md->getOuterScope(),md);
+ fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md);
}
}
}
@@ -7779,14 +7779,14 @@ static void addSourceReferences()
// md->isLinkableInProject(),
// Doxygen::parseSourcesNeeded);
if (fd &&
- md->getDefLine()!=-1 &&
+ md->getStartDefLine()!=-1 &&
md->isLinkableInProject() &&
(fd->generateSourceFile() || Doxygen::parseSourcesNeeded)
)
{
//printf("Found member '%s' in file '%s' at line '%d' def=%s\n",
// md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data());
- fd->addSourceRef(md->getDefLine(),md->getOuterScope(),md);
+ fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md);
}
}
}
@@ -8306,7 +8306,7 @@ static void findDefineDocumentation(Entry *root)
{
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
}
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(root->fileDef());
md->addSectionsToDefinition(root->anchors);
md->setMaxInitLines(root->initLines);
@@ -8350,7 +8350,7 @@ static void findDefineDocumentation(Entry *root)
{
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
}
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(root->fileDef());
md->addSectionsToDefinition(root->anchors);
md->setRefItems(root->sli);
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 4050144..9c1be1c 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -4387,7 +4387,7 @@ MemberDef *MemberDefImpl::createTemplateInstanceMember(
imd->setArgumentList(actualArgList);
imd->setDefinition(substituteTemplateArgumentsInString(m_impl->def,formalArgs,actualArgs));
imd->setBodyDef(getBodyDef());
- imd->setBodySegment(getStartBodyLine(),getEndBodyLine());
+ imd->setBodySegment(getDefLine(),getStartBodyLine(),getEndBodyLine());
//imd->setBodyMember(this);
// TODO: init other member variables (if needed).
@@ -6050,14 +6050,14 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef)
if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
{
//printf("body mdec->mdef %d-%d\n",mdec->getStartBodyLine(),mdef->getEndBodyLine());
- mdef->setBodySegment(mdec->getStartBodyLine(),mdec->getEndBodyLine());
+ mdef->setBodySegment(mdec->getDefLine(),mdec->getStartBodyLine(),mdec->getEndBodyLine());
mdef->setBodyDef(mdec->getBodyDef());
//mdef->setBodyMember(mdec);
}
else if (mdef->getStartBodyLine()!=-1 && mdec->getStartBodyLine()==-1)
{
//printf("body mdef->mdec %d-%d\n",mdef->getStartBodyLine(),mdec->getEndBodyLine());
- mdec->setBodySegment(mdef->getStartBodyLine(),mdef->getEndBodyLine());
+ mdec->setBodySegment(mdef->getDefLine(),mdef->getStartBodyLine(),mdef->getEndBodyLine());
mdec->setBodyDef(mdef->getBodyDef());
//mdec->setBodyMember(mdef);
}
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index db4f658..8e11601 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -2795,7 +2795,7 @@ ferr:
md->setLanguage(SrcLangExt_VHDL);
md->setMemberSpecifiers(VhdlDocGen::INSTANTIATION);
md->setBriefDescription(cur->brief,cur->briefFile,cur->briefLine);
- md->setBodySegment(cur->startLine,-1) ;
+ md->setBodySegment(cur->startLine,cur->startLine,-1) ;
md->setDocumentation(cur->doc.data(),cur->docFile.data(),cur->docLine);
FileDef *fd=ar->getFileDef();
md->setBodyDef(fd);