Doxygen
Loading...
Searching...
No Matches
DefinitionImpl Class Reference

#include <src/definitionimpl.h>

Classes

class  Private
 Private data associated with a Symbol DefinitionImpl object. More...
 

Public Member Functions

 DefinitionImpl (Definition *def, const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
 
 ~DefinitionImpl ()
 
 DefinitionImpl (const DefinitionImpl &d)
 
DefinitionImploperator= (const DefinitionImpl &d)
 
 DefinitionImpl (DefinitionImpl &&d)=delete
 
DefinitionImploperator= (DefinitionImpl &&d)=delete
 
const QCStringname () const
 
bool isAnonymous () const
 
const QCStringlocalName () const
 
QCString qualifiedName () const
 
QCString symbolName () const
 
QCString getSourceFileBase () const
 
QCString getSourceAnchor () const
 
QCString documentation () const
 
int docLine () const
 
QCString docFile () const
 
QCString briefDescription (bool abbreviate=FALSE) const
 
QCString briefDescriptionAsTooltip () const
 
int briefLine () const
 
QCString inbodyDocumentation () const
 
QCString inbodyFile () const
 
int inbodyLine () const
 
QCString briefFile () const
 
QCString getDefFileName () const
 
QCString getDefFileExtension () const
 
int getDefLine () const
 
int getDefColumn () const
 
bool hasDocumentation () const
 
bool hasUserDocumentation () const
 
bool isVisibleInProject () const
 
bool isVisible () const
 
bool isHidden () const
 
bool isArtificial () const
 
bool isExported () const
 
QCString getReference () const
 
bool isReference () const
 
QCString externalReference (const QCString &relPath) const
 
int getStartDefLine () const
 
int getStartBodyLine () const
 
int getEndBodyLine () const
 
const FileDefgetBodyDef () const
 
SrcLangExt getLanguage () const
 
const GroupListpartOfGroups () const
 
bool isLinkableViaGroup () const
 
const RefItemVectorxrefListItems () const
 
const DefinitionfindInnerCompound (const QCString &name) const
 
DefinitiongetOuterScope () const
 
const MemberVectorgetReferencesMembers () const
 
const MemberVectorgetReferencedByMembers () const
 
bool hasSections () const
 
bool hasSources () const
 
bool hasBriefDescription () const
 
QCString id () const
 
const SectionRefsgetSectionRefs () const
 
void setName (const QCString &name)
 
void setId (const QCString &name)
 
void setDefFile (const QCString &df, int defLine, int defColumn)
 
void setDocumentation (const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)
 
void setBriefDescription (const QCString &b, const QCString &briefFile, int briefLine)
 
void setInbodyDocumentation (const QCString &d, const QCString &docFile, int docLine)
 
void setReference (const QCString &r)
 
void addSectionsToDefinition (const std::vector< const SectionInfo * > &anchorList)
 
void setBodySegment (int defLine, int bls, int ble)
 
void setBodyDef (const FileDef *fd)
 
void addSourceReferencedBy (MemberDef *d, const QCString &sourceRefName)
 
void addSourceReferences (MemberDef *d, const QCString &sourceRefName)
 
void setRefItems (const RefItemVector &sli)
 
void mergeRefItems (Definition *d)
 
void mergeReferences (const Definition *other)
 
void mergeReferencedBy (const Definition *other)
 
void addInnerCompound (Definition *d)
 
void setOuterScope (Definition *d)
 
void setHidden (bool b)
 
void setArtificial (bool b)
 
void setExported (bool b)
 
void setLanguage (SrcLangExt lang)
 
void writeSourceDef (OutputList &ol) const
 
void writeInlineCode (OutputList &ol, const QCString &scopeName) const
 
bool hasSourceRefs () const
 
bool hasSourceReffedBy () const
 
void writeSourceRefs (OutputList &ol, const QCString &scopeName) const
 
void writeSourceReffedBy (OutputList &ol, const QCString &scopeName) const
 
void makePartOfGroup (GroupDef *gd)
 
void writeNavigationPath (OutputList &ol) const
 
QCString navigationPathAsString () const
 
void writeQuickMemberLinks (OutputList &, const MemberDef *) const
 
void writeSummaryLinks (OutputList &) const
 
QCString pathFragment () const
 
void writeDocAnchorsToTagFile (TextStream &) const
 
void setLocalName (const QCString &name)
 
void writeToc (OutputList &ol, const LocalToc &lt) const
 
void computeTooltip ()
 
void _setSymbolName (const QCString &name)
 
QCString _symbolName () const
 

Private Member Functions

int _getXRefListId (const QCString &listName) const
 
void _writeSourceRefList (OutputList &ol, const QCString &scopeName, const QCString &text, const std::unordered_map< std::string, MemberDef * > &members, bool) const
 
void _setBriefDescription (const QCString &b, const QCString &briefFile, int briefLine)
 
void _setDocumentation (const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace, bool atTop)
 
void _setInbodyDocumentation (const QCString &d, const QCString &docFile, int docLine)
 
bool _docsAlreadyAdded (const QCString &doc, QCString &sigList)
 

Private Attributes

std::unique_ptr< Privatep
 

Detailed Description

Definition at line 27 of file definitionimpl.h.

Constructor & Destructor Documentation

◆ DefinitionImpl() [1/3]

DefinitionImpl::DefinitionImpl ( Definition * def,
const QCString & defFileName,
int defLine,
int defColumn,
const QCString & name,
const char * b = nullptr,
const char * d = nullptr,
bool isSymbol = TRUE )

Definition at line 234 of file definition.cpp.

238 : p(std::make_unique<Private>())
239{
240 setName(name);
241 p->def = def;
242 p->defLine = dl;
243 p->defColumn = dc;
244 p->init(df,name);
245 p->isSymbol = isSymbol;
246 if (isSymbol) addToMap(name,def);
247 _setBriefDescription(b,df,dl);
250 {
251 p->hidden = TRUE;
252 }
253}
void setName(const QCString &name)
void _setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)
const QCString & name() const
void _setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace, bool atTop)
std::unique_ptr< Private > p
static void addToMap(const QCString &name, Definition *d)
static bool matchExcludedSymbols(const QCString &name)
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34

References _setBriefDescription(), _setDocumentation(), addToMap(), FALSE, matchExcludedSymbols(), name(), p, setName(), and TRUE.

Referenced by DefinitionImpl(), DefinitionImpl(), mergeReferencedBy(), mergeReferences(), operator=(), and operator=().

◆ ~DefinitionImpl()

DefinitionImpl::~DefinitionImpl ( )

Definition at line 270 of file definition.cpp.

271{
272 if (p->isSymbol)
273 {
274 removeFromMap(p->symbolName,p->def);
275 }
276}
static void removeFromMap(const QCString &name, Definition *d)

References p, and removeFromMap().

◆ DefinitionImpl() [2/3]

DefinitionImpl::DefinitionImpl ( const DefinitionImpl & d)

Definition at line 255 of file definition.cpp.

256 : p(std::make_unique<Private>(*d.p))
257{
258 if (p->isSymbol) addToMap(p->name,p->def);
259}

References addToMap(), DefinitionImpl(), and p.

◆ DefinitionImpl() [3/3]

DefinitionImpl::DefinitionImpl ( DefinitionImpl && d)
delete

References DefinitionImpl().

Member Function Documentation

◆ _docsAlreadyAdded()

bool DefinitionImpl::_docsAlreadyAdded ( const QCString & doc,
QCString & sigList )
private

Definition at line 364 of file definition.cpp.

365{
366 uint8_t md5_sig[16];
367 char sigStr[33];
368 // to avoid mismatches due to differences in indenting, we first remove
369 // double whitespaces...
370 QCString docStr = doc.simplifyWhiteSpace();
371 MD5Buffer(docStr.data(),static_cast<unsigned int>(docStr.length()),md5_sig);
372 MD5SigToString(md5_sig,sigStr);
373 //printf("%s:_docsAlreadyAdded doc='%s' sig='%s' docSigs='%s'\n",
374 // qPrint(name()),qPrint(doc),qPrint(sigStr),qPrint(sigList));
375 if (sigList.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
376 {
377 sigList+=QCString(":")+sigStr;
378 return FALSE;
379 }
380 else
381 {
382 return TRUE;
383 }
384}
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition qcstring.cpp:185
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159

References QCString::data(), FALSE, QCString::find(), QCString::length(), QCString::simplifyWhiteSpace(), and TRUE.

Referenced by _setBriefDescription(), _setInbodyDocumentation(), and toDefinition().

◆ _getXRefListId()

int DefinitionImpl::_getXRefListId ( const QCString & listName) const
private

Definition at line 1320 of file definition.cpp.

1321{
1322 for (const RefItem *item : p->xrefListItems)
1323 {
1324 if (item->list()->listName()==listName)
1325 {
1326 return item->id();
1327 }
1328 }
1329 return -1;
1330}
int id() const
Definition reflist.h:52
RefList * list() const
Definition reflist.h:53
QCString listName() const
Definition reflist.h:101

References RefItem::id(), RefItem::list(), RefList::listName(), and p.

◆ _setBriefDescription()

void DefinitionImpl::_setBriefDescription ( const QCString & b,
const QCString & briefFile,
int briefLine )
private

Definition at line 439 of file definition.cpp.

440{
441 QCString brief = b;
442 brief = brief.stripWhiteSpace();
444 brief = brief.stripWhiteSpace();
445 if (brief.isEmpty()) return;
446 size_t bl = brief.length();
447 if (bl>0)
448 {
449 if (!theTranslator || theTranslator->needsPunctuation()) // add punctuation if needed
450 {
451 int c = brief.at(bl-1);
452 switch(c)
453 {
454 case '.': case '!': case '?': case '>': case ':': case ')': break;
455 default:
456 if (isUTF8CharUpperCase(brief.str(),0) && !lastUTF8CharIsMultibyte(brief.str())) brief+='.';
457 break;
458 }
459 }
460 }
461
462 if (!_docsAlreadyAdded(brief,p->briefSignatures))
463 {
464 if (p->brief && !p->brief->doc.isEmpty())
465 {
466 //printf("adding to details\n");
468 }
469 else
470 {
471 //fprintf(stderr,"DefinitionImpl::setBriefDescription(%s,%s,%d)\n",b,briefFile,briefLine);
472 if (!p->brief.has_value())
473 {
474 p->brief = std::make_optional<BriefInfo>();
475 }
476 BriefInfo &briefInfo = p->brief.value();
477 briefInfo.doc=brief;
478 if (briefLine!=-1)
479 {
480 briefInfo.file = briefFile;
481 briefInfo.line = briefLine;
482 }
483 else
484 {
485 briefInfo.file = briefFile;
486 briefInfo.line = 1;
487 }
488 }
489 }
490 else
491 {
492 //printf("do nothing!\n");
493 }
494}
int briefLine() const
bool _docsAlreadyAdded(const QCString &doc, QCString &sigList)
QCString briefFile() const
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const std::string & str() const
Definition qcstring.h:537
virtual bool needsPunctuation()
add punctuation at the end of a brief description when needed and supported by the language
Definition translator.h:154
Translator * theTranslator
Definition language.cpp:71
QCString file
Definition definition.h:58
QCString doc
Definition definition.h:55
bool isUTF8CharUpperCase(const std::string &input, size_t pos)
Returns true iff the input string at byte position pos holds an upper case character.
Definition utf8.cpp:218
bool lastUTF8CharIsMultibyte(const std::string &input)
Returns true iff the last character in input is a multibyte character.
Definition utf8.cpp:212
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
Definition util.cpp:5464

References _docsAlreadyAdded(), _setDocumentation(), QCString::at(), briefFile(), briefLine(), BriefInfo::doc, FALSE, BriefInfo::file, QCString::isEmpty(), isUTF8CharUpperCase(), lastUTF8CharIsMultibyte(), QCString::length(), BriefInfo::line, p, QCString::str(), stripLeadingAndTrailingEmptyLines(), QCString::stripWhiteSpace(), theTranslator, and TRUE.

Referenced by DefinitionImpl(), and setBriefDescription().

◆ _setDocumentation()

void DefinitionImpl::_setDocumentation ( const QCString & d,
const QCString & docFile,
int docLine,
bool stripWhiteSpace,
bool atTop )
private

Definition at line 386 of file definition.cpp.

388{
389 //printf("%s::setDocumentation(%s,%s,%d,%d)\n",qPrint(name()),d,docFile,docLine,stripWhiteSpace);
390 if (d.isEmpty()) return;
391 QCString doc = d;
392 if (stripWhiteSpace)
393 {
395 }
396 else // don't strip whitespace
397 {
398 doc=d;
399 }
400 if (!_docsAlreadyAdded(doc,p->docSignatures))
401 {
402 //printf("setting docs for %s: '%s'\n",qPrint(name()),qPrint(m_doc));
403 if (!p->details.has_value())
404 {
405 p->details = std::make_optional<DocInfo>();
406 }
407 DocInfo &details = p->details.value();
408 if (details.doc.isEmpty()) // fresh detailed description
409 {
410 details.doc = doc;
411 }
412 else if (atTop) // another detailed description, append it to the start
413 {
414 details.doc = doc+"\n\n"+details.doc;
415 }
416 else // another detailed description, append it to the end
417 {
418 details.doc += "\n\n"+doc;
419 }
420 if (docLine!=-1) // store location if valid
421 {
422 details.file = docFile;
423 details.line = docLine;
424 }
425 else
426 {
427 details.file = docFile;
428 details.line = 1;
429 }
430 }
431}
int docLine() const
QCString docFile() const
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
Definition stringutil.h:72
QCString doc
Definition definition.h:47
int line
Definition definition.h:48
QCString file
Definition definition.h:49

References docFile(), docLine(), and stripWhiteSpace().

Referenced by _setBriefDescription(), DefinitionImpl(), and setDocumentation().

◆ _setInbodyDocumentation()

void DefinitionImpl::_setInbodyDocumentation ( const QCString & d,
const QCString & docFile,
int docLine )
private

Definition at line 502 of file definition.cpp.

503{
504 if (!_docsAlreadyAdded(doc,p->docSignatures))
505 {
506 if (!p->inbodyDocs.has_value())
507 {
508 p->inbodyDocs = std::make_optional<DocInfo>();
509 }
510 DocInfo &inbodyDocs = p->inbodyDocs.value();
511 if (inbodyDocs.doc.isEmpty()) // fresh inbody docs
512 {
513 inbodyDocs.doc = doc;
514 inbodyDocs.file = inbodyFile;
515 inbodyDocs.line = inbodyLine;
516 }
517 else // another inbody documentation fragment, append this to the end
518 {
519 inbodyDocs.doc += QCString("\n\n")+doc;
520 }
521 }
522}
int inbodyLine() const
QCString inbodyFile() const

References _docsAlreadyAdded(), DocInfo::doc, DocInfo::file, inbodyFile(), inbodyLine(), QCString::isEmpty(), DocInfo::line, and p.

Referenced by setInbodyDocumentation().

◆ _setSymbolName()

void DefinitionImpl::_setSymbolName ( const QCString & name)

Definition at line 1762 of file definition.cpp.

1763{
1764 p->symbolName=name;
1765}

References name(), and p.

◆ _symbolName()

QCString DefinitionImpl::_symbolName ( ) const

Definition at line 1767 of file definition.cpp.

1768{
1769 return p->symbolName;
1770}

References p.

◆ _writeSourceRefList()

void DefinitionImpl::_writeSourceRefList ( OutputList & ol,
const QCString & scopeName,
const QCString & text,
const std::unordered_map< std::string, MemberDef * > & membersMap,
bool  ) const
private

Write a reference to the source code fragments in which this definition is used.

Definition at line 1082 of file definition.cpp.

1085{
1086 if (!membersMap.empty())
1087 {
1088 auto members = refMapToVector(membersMap);
1089
1090 auto replaceFunc = [this,&members,scopeName,&ol](size_t entryIndex)
1091 {
1092 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1093 bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE);
1094 const MemberDef *md=members[entryIndex];
1095 if (md)
1096 {
1097 QCString scope=md->getScopeString();
1098 QCString name=md->name();
1099 //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),qPrint(scope),scopeName);
1100 if (!scope.isEmpty() && scope!=scopeName)
1101 {
1102 name.prepend(scope+getLanguageSpecificSeparator(p->lang));
1103 }
1104 if (!md->isObjCMethod() &&
1105 (md->isFunction() || md->isSlot() ||
1106 md->isPrototype() || md->isSignal()
1107 )
1108 )
1109 {
1110 name+="()";
1111 }
1112 if (sourceBrowser &&
1113 !(md->isLinkable() && !refLinkSource) &&
1114 md->getStartBodyLine()!=-1 &&
1115 md->getBodyDef()
1116 )
1117 {
1118 const int maxLineNrStr = 10;
1119 char anchorStr[maxLineNrStr];
1120 qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine());
1121 //printf("Write object link to %s\n",qPrint(md->getBodyDef()->getSourceFileBase()));
1122 ol.writeObjectLink(QCString(),md->getBodyDef()->getSourceFileBase(),anchorStr,name);
1123 }
1124 else if (md->isLinkable())
1125 {
1127 md->getOutputFileBase(),
1128 md->anchor(),name);
1129 }
1130 else
1131 {
1132 ol.docify(name);
1133 }
1134 }
1135 };
1136
1137 ol.startParagraph("reference");
1138 ol.parseText(text);
1139 ol.docify(" ");
1140 writeMarkerList(ol,
1141 theTranslator->trWriteList(static_cast<int>(members.size())).str(),
1142 members.size(),
1143 replaceFunc);
1144 ol.writeString(".");
1145 ol.endParagraph();
1146
1147 }
1148}
virtual bool isLinkable() const =0
virtual QCString anchor() const =0
virtual const FileDef * getBodyDef() const =0
virtual QCString getReference() const =0
virtual QCString getSourceFileBase() const =0
virtual QCString getOutputFileBase() const =0
virtual int getStartBodyLine() const =0
virtual const QCString & name() const =0
virtual bool isSignal() const =0
virtual bool isObjCMethod() const =0
virtual bool isSlot() const =0
virtual bool isFunction() const =0
virtual QCString getScopeString() const =0
virtual bool isPrototype() const =0
void writeString(const QCString &text)
Definition outputlist.h:412
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:440
void docify(const QCString &s)
Definition outputlist.h:438
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:408
void endParagraph()
Definition outputlist.h:410
void parseText(const QCString &textStr)
virtual QCString trWriteList(int numEntries)=0
#define Config_getBool(name)
Definition config.h:33
static MemberVector refMapToVector(const std::unordered_map< std::string, MemberDef * > &map)
#define qsnprintf
Definition qcstring.h:49
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:6326
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:1103

References Definition::anchor(), Config_getBool, OutputList::docify(), OutputList::endParagraph(), Definition::getBodyDef(), getLanguageSpecificSeparator(), Definition::getOutputFileBase(), Definition::getReference(), MemberDef::getScopeString(), Definition::getSourceFileBase(), Definition::getStartBodyLine(), QCString::isEmpty(), MemberDef::isFunction(), Definition::isLinkable(), MemberDef::isObjCMethod(), MemberDef::isPrototype(), MemberDef::isSignal(), MemberDef::isSlot(), Definition::name(), name(), p, OutputList::parseText(), qsnprintf, refMapToVector(), OutputList::startParagraph(), theTranslator, writeMarkerList(), OutputList::writeObjectLink(), and OutputList::writeString().

Referenced by writeSourceReffedBy(), and writeSourceRefs().

◆ addInnerCompound()

void DefinitionImpl::addInnerCompound ( Definition * d)

Definition at line 1215 of file definition.cpp.

1216{
1217 err("DefinitionImpl::addInnerCompound() called\n");
1218}
#define err(fmt,...)
Definition message.h:127

References err.

◆ addSectionsToDefinition()

void DefinitionImpl::addSectionsToDefinition ( const std::vector< const SectionInfo * > & anchorList)

Definition at line 303 of file definition.cpp.

304{
305 //printf("%s: addSectionsToDefinition(%d)\n",qPrint(name()),anchorList->count());
306 for (const SectionInfo *si : anchorList)
307 {
308 //printf("Add section '%s' to definition '%s'\n",
309 // qPrint(si->label()),qPrint(name()));
310 SectionManager &sm = SectionManager::instance();
311 SectionInfo *gsi=sm.find(si->label());
312 //printf("===== label=%s gsi=%p\n",qPrint(si->label),gsi);
313 if (gsi==nullptr)
314 {
315 gsi = sm.add(*si);
316 }
317 if (p->sectionRefs.find(gsi->label())==nullptr)
318 {
319 p->sectionRefs.add(gsi);
320 gsi->setDefinition(p->def);
321 }
322 }
323}
const T * find(const std::string &key) const
Definition linkedmap.h:47
QCString label() const
Definition section.h:68
void setDefinition(Definition *d)
Definition section.h:82
SectionInfo * add(const SectionInfo &si)
Definition section.h:138
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:175

References SectionManager::add(), LinkedMap< T, Hash, KeyEqual, Map >::find(), SectionManager::instance(), SectionInfo::label(), p, and SectionInfo::setDefinition().

◆ addSourceReferencedBy()

void DefinitionImpl::addSourceReferencedBy ( MemberDef * d,
const QCString & sourceRefName )

Definition at line 1194 of file definition.cpp.

1195{
1196 if (md)
1197 {
1198 p->sourceRefByDict.emplace(sourceRefName.str(),md);
1199 }
1200}

References p, and QCString::str().

◆ addSourceReferences()

void DefinitionImpl::addSourceReferences ( MemberDef * d,
const QCString & sourceRefName )

Definition at line 1202 of file definition.cpp.

1203{
1204 if (md)
1205 {
1206 p->sourceRefsDict.emplace(sourceRefName.str(),md);
1207 }
1208}

References p, and QCString::str().

◆ briefDescription()

QCString DefinitionImpl::briefDescription ( bool abbreviate = FALSE) const

Definition at line 1533 of file definition.cpp.

1534{
1535 //printf("%s::briefDescription(%d)='%s'\n",qPrint(name()),abbr,p->brief?qPrint(p->brief->doc):"<none>");
1536 return p->brief ?
1537 (abbr ? abbreviate(p->brief->doc,p->def->displayName()) : p->brief->doc) :
1538 QCString("");
1539}
static QCString abbreviate(const QCString &s, const QCString &name)

References abbreviate(), and p.

Referenced by hasBriefDescription().

◆ briefDescriptionAsTooltip()

QCString DefinitionImpl::briefDescriptionAsTooltip ( ) const

Definition at line 1552 of file definition.cpp.

1553{
1554 return p->brief ? p->brief->tooltip : QCString();
1555}

References p.

◆ briefFile()

QCString DefinitionImpl::briefFile ( ) const

Definition at line 1562 of file definition.cpp.

1563{
1564 return p->brief && !p->brief->file.isEmpty() ? p->brief->file : QCString("<"+p->name+">");
1565}

References p.

Referenced by _setBriefDescription(), operator=(), and setBriefDescription().

◆ briefLine()

int DefinitionImpl::briefLine ( ) const

Definition at line 1557 of file definition.cpp.

1558{
1559 return p->brief ? p->brief->line : 1;
1560}

References p.

Referenced by _setBriefDescription(), operator=(), and setBriefDescription().

◆ computeTooltip()

void DefinitionImpl::computeTooltip ( )

Definition at line 1541 of file definition.cpp.

1542{
1543 if (p->brief && p->brief->tooltip.isEmpty() && !p->brief->doc.isEmpty())
1544 {
1545 const MemberDef *md = p->def->definitionType()==Definition::TypeMember ? toMemberDef(p->def) : nullptr;
1546 const Definition *scope = p->def->definitionType()==Definition::TypeMember ? p->def->getOuterScope() : p->def;
1547 p->brief->tooltip = parseCommentAsText(scope,md,
1548 p->brief->doc, p->brief->file, p->brief->line);
1549 }
1550}
MemberDef * toMemberDef(Definition *d)
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
Definition util.cpp:5803

References p, parseCommentAsText(), toMemberDef(), and Definition::TypeMember.

◆ docFile()

QCString DefinitionImpl::docFile ( ) const

Definition at line 1478 of file definition.cpp.

1479{
1480 if (p->details && !p->details->file.isEmpty()) return p->details->file;
1481 else if (p->brief && !p->brief->file.isEmpty()) return p->brief->file;
1482 else return "<" + p->name + ">";
1483}

References p.

Referenced by _setDocumentation(), operator=(), setDocumentation(), and toDefinition().

◆ docLine()

int DefinitionImpl::docLine ( ) const

Definition at line 1473 of file definition.cpp.

1474{
1475 return p->details ? p->details->line : p->brief ? p->brief->line : 1;
1476}

References p.

Referenced by _setDocumentation(), operator=(), setDocumentation(), and toDefinition().

◆ documentation()

QCString DefinitionImpl::documentation ( ) const

Definition at line 1468 of file definition.cpp.

1469{
1470 return p->details ? p->details->doc : QCString("");
1471}

References p.

◆ externalReference()

QCString DefinitionImpl::externalReference ( const QCString & relPath) const

Definition at line 1778 of file definition.cpp.

1779{
1780 QCString ref = getReference();
1781 if (!ref.isEmpty())
1782 {
1783 auto it = Doxygen::tagDestinationMap.find(ref.str());
1785 {
1786 QCString result(it->second);
1787 size_t l = result.length();
1788 if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
1789 { // relative path -> prepend relPath.
1790 result.prepend(relPath);
1791 l+=relPath.length();
1792 }
1793 if (l>0 && result.at(l-1)!='/') result+='/';
1794 return result;
1795 }
1796 }
1797 return relPath;
1798}
QCString getReference() const
static StringMap tagDestinationMap
Definition doxygen.h:116
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:175

References QCString::at(), end(), getReference(), QCString::isEmpty(), QCString::length(), QCString::prepend(), QCString::str(), and Doxygen::tagDestinationMap.

◆ findInnerCompound()

const Definition * DefinitionImpl::findInnerCompound ( const QCString & name) const

Definition at line 1210 of file definition.cpp.

1211{
1212 return nullptr;
1213}

◆ getBodyDef()

const FileDef * DefinitionImpl::getBodyDef ( ) const

Definition at line 1647 of file definition.cpp.

1648{
1649 return p->body ? p->body->fileDef : nullptr;
1650}

References p.

◆ getDefColumn()

int DefinitionImpl::getDefColumn ( ) const

Definition at line 1815 of file definition.cpp.

1816{
1817 return p->defColumn;
1818}

References p.

◆ getDefFileExtension()

QCString DefinitionImpl::getDefFileExtension ( ) const

Definition at line 1592 of file definition.cpp.

1593{
1594 return p->defFileExt;
1595}

References p.

◆ getDefFileName()

QCString DefinitionImpl::getDefFileName ( ) const

Definition at line 1587 of file definition.cpp.

1588{
1589 return p->defFileName;
1590}

References p.

◆ getDefLine()

int DefinitionImpl::getDefLine ( ) const

Definition at line 1810 of file definition.cpp.

1811{
1812 return p->defLine;
1813}

References p.

◆ getEndBodyLine()

int DefinitionImpl::getEndBodyLine ( ) const

Definition at line 1642 of file definition.cpp.

1643{
1644 return p->body ? p->body->endLine : -1;
1645}

References p.

◆ getLanguage()

SrcLangExt DefinitionImpl::getLanguage ( ) const

Definition at line 1731 of file definition.cpp.

1732{
1733 return p->lang;
1734}

References p.

Referenced by qualifiedName().

◆ getOuterScope()

Definition * DefinitionImpl::getOuterScope ( ) const

Definition at line 1666 of file definition.cpp.

1667{
1668 return p->outerScope;
1669}

References p.

Referenced by navigationPathAsString().

◆ getReference()

QCString DefinitionImpl::getReference ( ) const

Definition at line 1622 of file definition.cpp.

1623{
1624 return p->ref;
1625}

References p.

Referenced by externalReference().

◆ getReferencedByMembers()

const MemberVector & DefinitionImpl::getReferencedByMembers ( ) const

Definition at line 1683 of file definition.cpp.

1684{
1685 std::lock_guard<std::mutex> lock(g_memberReferenceMutex);
1686 if (p->referencedByMembers.empty() && !p->sourceRefByDict.empty())
1687 {
1688 p->referencedByMembers = refMapToVector(p->sourceRefByDict);
1689 }
1690 return p->referencedByMembers;
1691}
static std::mutex g_memberReferenceMutex

References g_memberReferenceMutex, p, and refMapToVector().

◆ getReferencesMembers()

const MemberVector & DefinitionImpl::getReferencesMembers ( ) const

Definition at line 1673 of file definition.cpp.

1674{
1675 std::lock_guard<std::mutex> lock(g_memberReferenceMutex);
1676 if (p->referencesMembers.empty() && !p->sourceRefsDict.empty())
1677 {
1678 p->referencesMembers = refMapToVector(p->sourceRefsDict);
1679 }
1680 return p->referencesMembers;
1681}

References g_memberReferenceMutex, p, and refMapToVector().

◆ getSectionRefs()

const SectionRefs & DefinitionImpl::getSectionRefs ( ) const

Definition at line 1456 of file definition.cpp.

1457{
1458 return p->sectionRefs;
1459}

References p.

◆ getSourceAnchor()

QCString DefinitionImpl::getSourceAnchor ( ) const

Definition at line 918 of file definition.cpp.

919{
920 const int maxAnchorStrLen = 20;
921 char anchorStr[maxAnchorStrLen];
922 anchorStr[0]='\0';
923 if (p->body && p->body->startLine!=-1)
924 {
925 if (Htags::useHtags)
926 {
927 qsnprintf(anchorStr,maxAnchorStrLen,"L%d",p->body->defLine);
928 }
929 else
930 {
931 qsnprintf(anchorStr,maxAnchorStrLen,"l%05d",p->body->defLine);
932 }
933 }
934 return anchorStr;
935}
static bool useHtags
Definition htags.h:23

References p, qsnprintf, and Htags::useHtags.

Referenced by writeSourceDef().

◆ getSourceFileBase()

QCString DefinitionImpl::getSourceFileBase ( ) const

Definition at line 905 of file definition.cpp.

906{
907 ASSERT(p->def->definitionType()!=Definition::TypeFile); // file overloads this method
908 QCString fn;
909 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
910 if (sourceBrowser &&
911 p->body && p->body->startLine!=-1 && p->body->fileDef)
912 {
913 fn = p->body->fileDef->getSourceFileBase();
914 }
915 return fn;
916}
#define ASSERT(x)
Definition qcstring.h:39

References ASSERT, Config_getBool, p, and Definition::TypeFile.

Referenced by writeSourceDef().

◆ getStartBodyLine()

int DefinitionImpl::getStartBodyLine ( ) const

Definition at line 1637 of file definition.cpp.

1638{
1639 return p->body ? p->body->startLine : -1;
1640}

References p.

◆ getStartDefLine()

int DefinitionImpl::getStartDefLine ( ) const

Definition at line 1632 of file definition.cpp.

1633{
1634 return p->body ? p->body->defLine : -1;
1635}

References p.

◆ hasBriefDescription()

bool DefinitionImpl::hasBriefDescription ( ) const

Definition at line 1772 of file definition.cpp.

1773{
1774 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
1775 return !briefDescription().isEmpty() && briefMemberDesc;
1776}
QCString briefDescription(bool abbreviate=FALSE) const

References briefDescription(), Config_getBool, and QCString::isEmpty().

◆ hasDocumentation()

bool DefinitionImpl::hasDocumentation ( ) const

Definition at line 1170 of file definition.cpp.

1171{
1172 bool extractAll = Config_getBool(EXTRACT_ALL);
1173 //bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1174 bool hasDocs =
1175 (p->details && !p->details->doc.isEmpty()) || // has detailed docs
1176 (p->brief && !p->brief->doc.isEmpty()) || // has brief description
1177 (p->inbodyDocs && !p->inbodyDocs->doc.isEmpty()) || // has inbody docs
1178 extractAll //|| // extract everything
1179 // (sourceBrowser && p->body &&
1180 // p->body->startLine!=-1 && p->body->fileDef)
1181 ; // link to definition
1182 return hasDocs;
1183}

References Config_getBool, and p.

◆ hasSections()

bool DefinitionImpl::hasSections ( ) const

Definition at line 325 of file definition.cpp.

326{
327 //printf("DefinitionImpl::hasSections(%s) #sections=%d\n",qPrint(name()),
328 // p->sectionRefs.size());
329 if (p->sectionRefs.empty()) return FALSE;
330 for (const SectionInfo *si : p->sectionRefs)
331 {
332 if (si->type().isSection())
333 {
334 return TRUE;
335 }
336 }
337 return FALSE;
338}
SectionType type() const
Definition section.h:70
constexpr bool isSection() const
Definition section.h:46

References FALSE, SectionType::isSection(), p, TRUE, and SectionInfo::type().

◆ hasSourceReffedBy()

bool DefinitionImpl::hasSourceReffedBy ( ) const

Definition at line 1160 of file definition.cpp.

1161{
1162 return !p->sourceRefByDict.empty();
1163}

References p.

◆ hasSourceRefs()

bool DefinitionImpl::hasSourceRefs ( ) const

Definition at line 1165 of file definition.cpp.

1166{
1167 return !p->sourceRefsDict.empty();
1168}

References p.

◆ hasSources()

bool DefinitionImpl::hasSources ( ) const

Definition at line 1008 of file definition.cpp.

1009{
1010 return p->body && p->body->startLine!=-1 &&
1011 p->body->endLine>=p->body->startLine &&
1012 p->body->fileDef;
1013}

References p.

Referenced by writeInlineCode().

◆ hasUserDocumentation()

bool DefinitionImpl::hasUserDocumentation ( ) const

Definition at line 1185 of file definition.cpp.

1186{
1187 bool hasDocs =
1188 (p->details && !p->details->doc.isEmpty()) ||
1189 (p->brief && !p->brief->doc.isEmpty()) ||
1190 (p->inbodyDocs && !p->inbodyDocs->doc.isEmpty());
1191 return hasDocs;
1192}

References p.

◆ id()

QCString DefinitionImpl::id ( ) const

Definition at line 298 of file definition.cpp.

299{
300 return p->id;
301}

Referenced by setId().

◆ inbodyDocumentation()

QCString DefinitionImpl::inbodyDocumentation ( ) const

Definition at line 1569 of file definition.cpp.

1570{
1571 return p->inbodyDocs ? p->inbodyDocs->doc : QCString("");
1572}

References p.

◆ inbodyFile()

QCString DefinitionImpl::inbodyFile ( ) const

Definition at line 1579 of file definition.cpp.

1580{
1581 return p->inbodyDocs && !p->inbodyDocs->file.isEmpty() ? p->inbodyDocs->file : QCString("<"+p->name+">");
1582}

References p.

Referenced by _setInbodyDocumentation(), and setInbodyDocumentation().

◆ inbodyLine()

int DefinitionImpl::inbodyLine ( ) const

Definition at line 1574 of file definition.cpp.

1575{
1576 return p->inbodyDocs ? p->inbodyDocs->line : 1;
1577}

References p.

Referenced by _setInbodyDocumentation(), and setInbodyDocumentation().

◆ isAnonymous()

bool DefinitionImpl::isAnonymous ( ) const

Definition at line 1805 of file definition.cpp.

1806{
1807 return p->isAnonymous;
1808}

References p.

◆ isArtificial()

bool DefinitionImpl::isArtificial ( ) const

Definition at line 1612 of file definition.cpp.

1613{
1614 return p->isArtificial;
1615}

References p.

◆ isExported()

bool DefinitionImpl::isExported ( ) const

Definition at line 1617 of file definition.cpp.

1618{
1619 return p->isExported;
1620}

References p.

◆ isHidden()

bool DefinitionImpl::isHidden ( ) const

Definition at line 1597 of file definition.cpp.

1598{
1599 return p->hidden;
1600}

References p.

◆ isLinkableViaGroup()

bool DefinitionImpl::isLinkableViaGroup ( ) const

Definition at line 1657 of file definition.cpp.

1658{
1659 for (const auto &gd : partOfGroups())
1660 {
1661 if (gd->isLinkable()) return true;
1662 }
1663 return false;
1664}
const GroupList & partOfGroups() const

References partOfGroups().

◆ isReference()

bool DefinitionImpl::isReference ( ) const

Definition at line 1627 of file definition.cpp.

1628{
1629 return !p->ref.isEmpty();
1630}

References p.

◆ isVisible()

bool DefinitionImpl::isVisible ( ) const

Definition at line 1607 of file definition.cpp.

1608{
1609 return p->def->isLinkable() && !p->hidden;
1610}

References p.

◆ isVisibleInProject()

bool DefinitionImpl::isVisibleInProject ( ) const

Definition at line 1602 of file definition.cpp.

1603{
1604 return p->def->isLinkableInProject() && !p->hidden;
1605}

References p.

◆ localName()

const QCString & DefinitionImpl::localName ( ) const

Definition at line 1279 of file definition.cpp.

1280{
1281 return p->localName;
1282}

References p.

Referenced by navigationPathAsString().

◆ makePartOfGroup()

void DefinitionImpl::makePartOfGroup ( GroupDef * gd)

Definition at line 1284 of file definition.cpp.

1285{
1286 p->partOfGroups.push_back(gd);
1287}

References p.

◆ mergeReferencedBy()

void DefinitionImpl::mergeReferencedBy ( const Definition * other)

Definition at line 1709 of file definition.cpp.

1710{
1711 const DefinitionImpl *defImpl = other->toDefinitionImpl_();
1712 if (defImpl)
1713 {
1714 for (const auto &kv : defImpl->p->sourceRefByDict)
1715 {
1716 auto it = p->sourceRefByDict.find(kv.first);
1717 if (it != p->sourceRefByDict.end())
1718 {
1719 p->sourceRefByDict.emplace(kv.first,kv.second);
1720 }
1721 }
1722 }
1723}
virtual const DefinitionImpl * toDefinitionImpl_() const =0
DefinitionImpl(Definition *def, const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)

References DefinitionImpl(), p, and Definition::toDefinitionImpl_().

◆ mergeReferences()

void DefinitionImpl::mergeReferences ( const Definition * other)

Definition at line 1693 of file definition.cpp.

1694{
1695 const DefinitionImpl *defImpl = other->toDefinitionImpl_();
1696 if (defImpl)
1697 {
1698 for (const auto &kv : defImpl->p->sourceRefsDict)
1699 {
1700 auto it = p->sourceRefsDict.find(kv.first);
1701 if (it != p->sourceRefsDict.end())
1702 {
1703 p->sourceRefsDict.insert(kv);
1704 }
1705 }
1706 }
1707}

References DefinitionImpl(), p, and Definition::toDefinitionImpl_().

◆ mergeRefItems()

void DefinitionImpl::mergeRefItems ( Definition * d)

Definition at line 1294 of file definition.cpp.

1295{
1296 auto otherXrefList = d->xrefListItems();
1297
1298 // append vectors
1299 p->xrefListItems.reserve(p->xrefListItems.size()+otherXrefList.size());
1300 p->xrefListItems.insert (p->xrefListItems.end(),
1301 otherXrefList.begin(),otherXrefList.end());
1302
1303 // sort results on itemId
1304 std::stable_sort(p->xrefListItems.begin(),p->xrefListItems.end(),
1305 [](RefItem *left,RefItem *right)
1306 { return left->id() <right->id() ||
1307 (left->id()==right->id() &&
1308 left->list()->listName() < right->list()->listName());
1309 });
1310
1311 // filter out duplicates
1312 auto last = std::unique(p->xrefListItems.begin(),p->xrefListItems.end(),
1313 [](const RefItem *left,const RefItem *right)
1314 { return left->id()==right->id() &&
1315 left->list()->listName()==right->list()->listName();
1316 });
1317 p->xrefListItems.erase(last, p->xrefListItems.end());
1318}
virtual const RefItemVector & xrefListItems() const =0

References p, and Definition::xrefListItems().

◆ name()

const QCString & DefinitionImpl::name ( ) const

◆ navigationPathAsString()

QCString DefinitionImpl::navigationPathAsString ( ) const

Returns the string used in the footer for $navpath when GENERATE_TREEVIEW is enabled

Definition at line 1375 of file definition.cpp.

1376{
1377 QCString result;
1378 Definition *outerScope = getOuterScope();
1379 QCString locName = localName();
1380 if (outerScope && outerScope!=Doxygen::globalScope)
1381 {
1382 result+=outerScope->navigationPathAsString();
1383 }
1384 else if (p->def->definitionType()==Definition::TypeFile &&
1385 toFileDef(p->def)->getDirDef())
1386 {
1387 result+=(toFileDef(p->def))->getDirDef()->navigationPathAsString();
1388 }
1389 result+="<li class=\"navelem\">";
1390 if (p->def->isLinkableInProject())
1391 {
1392 QCString fn = p->def->getOutputFileBase();
1394 if (p->def->definitionType()==Definition::TypeGroup &&
1395 !toGroupDef(p->def)->groupTitle().isEmpty())
1396 {
1397 result+="<a class=\"el\" href=\"$relpath^"+fn+"\">"+
1398 convertToHtml(toGroupDef(p->def)->groupTitle())+"</a>";
1399 }
1400 else if (p->def->definitionType()==Definition::TypePage &&
1401 toPageDef(p->def)->hasTitle())
1402 {
1403 result+="<a class=\"el\" href=\"$relpath^"+fn+"\">"+
1404 convertToHtml((toPageDef(p->def))->title())+"</a>";
1405 }
1406 else if (p->def->definitionType()==Definition::TypeClass)
1407 {
1408 QCString name = locName;
1409 if (name.endsWith("-p"))
1410 {
1411 name = name.left(name.length()-2);
1412 }
1413 result+="<a class=\"el\" href=\"$relpath^"+fn;
1414 if (!p->def->anchor().isEmpty()) result+="#"+p->def->anchor();
1415 result+="\">"+convertToHtml(name)+"</a>";
1416 }
1417 else
1418 {
1419 result+="<a class=\"el\" href=\"$relpath^"+fn+"\">"+
1420 convertToHtml(locName)+"</a>";
1421 }
1422 }
1423 else
1424 {
1425 result+="<b>"+convertToHtml(locName)+"</b>";
1426 }
1427 result+="</li>";
1428 return result;
1429}
virtual QCString navigationPathAsString() const =0
const QCString & localName() const
Definition * getOuterScope() const
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
virtual DirDef * getDirDef() const =0
virtual QCString groupTitle() const =0
virtual bool hasTitle() const =0
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1894
GroupDef * toGroupDef(Definition *d)
PageDef * toPageDef(Definition *d)
Definition pagedef.cpp:467
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4403
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5339

References addHtmlExtensionIfMissing(), convertToHtml(), getOuterScope(), Doxygen::globalScope, GroupDef::groupTitle(), localName(), name(), Definition::navigationPathAsString(), p, toFileDef(), toGroupDef(), toPageDef(), Definition::TypeClass, Definition::TypeFile, Definition::TypeGroup, and Definition::TypePage.

Referenced by writeNavigationPath().

◆ operator=() [1/2]

DefinitionImpl & DefinitionImpl::operator= ( const DefinitionImpl & d)

Definition at line 261 of file definition.cpp.

262{
263 if (this!=&other)
264 {
265 p = std::make_unique<Private>(*other.p);
266 }
267 return *this;
268}

References DefinitionImpl(), and p.

◆ operator=() [2/2]

◆ partOfGroups()

const GroupList & DefinitionImpl::partOfGroups ( ) const

Definition at line 1652 of file definition.cpp.

1653{
1654 return p->partOfGroups;
1655}

References p.

Referenced by isLinkableViaGroup().

◆ pathFragment()

QCString DefinitionImpl::pathFragment ( ) const

Definition at line 1337 of file definition.cpp.

1338{
1339 QCString result;
1340 if (p->outerScope && p->outerScope!=Doxygen::globalScope)
1341 {
1342 result = p->outerScope->pathFragment();
1343 }
1344 if (p->def->isLinkable())
1345 {
1346 if (!result.isEmpty()) result+="/";
1347 if (p->def->definitionType()==Definition::TypeGroup &&
1348 !toGroupDef(p->def)->groupTitle().isEmpty())
1349 {
1350 result+=toGroupDef(p->def)->groupTitle();
1351 }
1352 else if (p->def->definitionType()==Definition::TypePage &&
1353 toPageDef(p->def)->hasTitle())
1354 {
1355 result+=toPageDef(p->def)->title();
1356 }
1357 else
1358 {
1359 result+=p->localName;
1360 }
1361 }
1362 else
1363 {
1364 result+=p->localName;
1365 }
1366 return result;
1367}
virtual QCString title() const =0

References Doxygen::globalScope, GroupDef::groupTitle(), QCString::isEmpty(), p, PageDef::title(), toGroupDef(), toPageDef(), Definition::TypeGroup, and Definition::TypePage.

◆ qualifiedName()

QCString DefinitionImpl::qualifiedName ( ) const

Definition at line 1222 of file definition.cpp.

1223{
1224 std::lock_guard<std::recursive_mutex> lock(g_qualifiedNameMutex);
1225 if (!p->qualifiedName.isEmpty())
1226 {
1227 return p->qualifiedName;
1228 }
1229
1230 //printf("start %s::qualifiedName() localName=%s\n",qPrint(name()),qPrint(p->localName));
1231 if (p->outerScope==nullptr)
1232 {
1233 if (p->localName=="<globalScope>")
1234 {
1235 return "";
1236 }
1237 else
1238 {
1239 return p->localName;
1240 }
1241 }
1242
1243 if (p->outerScope->name()=="<globalScope>")
1244 {
1245 p->qualifiedName = p->localName;
1246 }
1247 else
1248 {
1249 p->qualifiedName = p->outerScope->qualifiedName()+
1251 p->localName;
1252 }
1253 //printf("end %s::qualifiedName()=%s\n",qPrint(name()),qPrint(p->qualifiedName));
1254 //count--;
1255 return p->qualifiedName;
1256}
SrcLangExt getLanguage() const
static std::recursive_mutex g_qualifiedNameMutex

References g_qualifiedNameMutex, getLanguage(), getLanguageSpecificSeparator(), and p.

◆ setArtificial()

void DefinitionImpl::setArtificial ( bool b)

Definition at line 1741 of file definition.cpp.

1742{
1743 p->isArtificial = b;
1744}

References p.

◆ setBodyDef()

void DefinitionImpl::setBodyDef ( const FileDef * fd)

Definition at line 999 of file definition.cpp.

1000{
1001 if (!p->body.has_value())
1002 {
1003 p->body = std::make_optional<BodyInfo>();
1004 }
1005 p->body.value().fileDef=fd;
1006}

References p.

◆ setBodySegment()

void DefinitionImpl::setBodySegment ( int defLine,
int bls,
int ble )

Definition at line 987 of file definition.cpp.

988{
989 if (!p->body.has_value())
990 {
991 p->body = std::make_optional<BodyInfo>();
992 }
993 BodyInfo &body = p->body.value();
994 body.defLine = defLine;
995 body.startLine = bls;
996 body.endLine = ble;
997}
int startLine
line number of the start of the definition's body
Definition definition.h:65
int endLine
line number of the end of the definition's body
Definition definition.h:66
int defLine
line number of the start of the definition
Definition definition.h:64

References BodyInfo::defLine, BodyInfo::endLine, p, and BodyInfo::startLine.

◆ setBriefDescription()

void DefinitionImpl::setBriefDescription ( const QCString & b,
const QCString & briefFile,
int briefLine )

Definition at line 496 of file definition.cpp.

497{
498 if (b.isEmpty()) return;
500}

References _setBriefDescription(), briefFile(), briefLine(), and QCString::isEmpty().

◆ setDefFile()

void DefinitionImpl::setDefFile ( const QCString & df,
int defLine,
int defColumn )

Definition at line 150 of file definition.cpp.

151{
152 p->setDefFileName(df);
153 p->defLine = defLine;
154 p->defColumn = defCol;
155}

References p.

◆ setDocumentation()

void DefinitionImpl::setDocumentation ( const QCString & d,
const QCString & docFile,
int docLine,
bool stripWhiteSpace = TRUE )

Definition at line 433 of file definition.cpp.

434{
435 if (d.isEmpty()) return;
437}

References _setDocumentation(), docFile(), docLine(), FALSE, QCString::isEmpty(), and stripWhiteSpace().

◆ setExported()

void DefinitionImpl::setExported ( bool b)

Definition at line 1746 of file definition.cpp.

1747{
1748 p->isExported = b;
1749}

References p.

◆ setHidden()

void DefinitionImpl::setHidden ( bool b)

Definition at line 1736 of file definition.cpp.

1737{
1738 p->hidden = p->hidden || b;
1739}

References p.

◆ setId()

void DefinitionImpl::setId ( const QCString & name)

Definition at line 287 of file definition.cpp.

288{
289 if (id.isEmpty()) return;
290 p->id = id;
292 {
293 //printf("DefinitionImpl::setId '%s'->'%s'\n",id,qPrint(p->name));
294 Doxygen::clangUsrMap->emplace(id.str(),p->def);
295 }
296}
QCString id() const
static ClangUsrMap * clangUsrMap
Definition doxygen.h:126

References Doxygen::clangUsrMap, id(), and p.

◆ setInbodyDocumentation()

void DefinitionImpl::setInbodyDocumentation ( const QCString & d,
const QCString & docFile,
int docLine )

Definition at line 524 of file definition.cpp.

525{
526 if (d.isEmpty()) return;
528}
void _setInbodyDocumentation(const QCString &d, const QCString &docFile, int docLine)

References _setInbodyDocumentation(), inbodyFile(), inbodyLine(), and QCString::isEmpty().

◆ setLanguage()

void DefinitionImpl::setLanguage ( SrcLangExt lang)

Definition at line 1756 of file definition.cpp.

1757{
1758 p->lang=lang;
1759}

References p.

◆ setLocalName()

void DefinitionImpl::setLocalName ( const QCString & name)

Definition at line 1751 of file definition.cpp.

1752{
1753 p->localName=name;
1754}

References name(), and p.

◆ setName()

void DefinitionImpl::setName ( const QCString & name)

Definition at line 278 of file definition.cpp.

279{
280 if (name.isEmpty()) return;
281 p->name = name;
282 p->isAnonymous = p->name.isEmpty() ||
283 p->name.at(0)=='@' ||
284 p->name.find("::@")!=-1;
285}

References name(), and p.

Referenced by DefinitionImpl().

◆ setOuterScope()

void DefinitionImpl::setOuterScope ( Definition * d)

Definition at line 1258 of file definition.cpp.

1259{
1260 std::lock_guard<std::recursive_mutex> lock(g_qualifiedNameMutex);
1261 //printf("%s::setOuterScope(%s)\n",qPrint(name()),d?qPrint(d->name()):"<none>");
1262 Definition *outerScope = p->outerScope;
1263 bool found=false;
1264 // make sure that we are not creating a recursive scope relation.
1265 while (outerScope && !found)
1266 {
1267 found = (outerScope==d);
1268 outerScope = outerScope->getOuterScope();
1269 }
1270 if (!found)
1271 {
1272 p->qualifiedName.clear(); // flush cached scope name
1273 p->outerScope = d;
1274 }
1275 p->hidden = p->hidden || d->isHidden();
1276 assert(p->def!=p->outerScope);
1277}
virtual bool isHidden() const =0
virtual Definition * getOuterScope() const =0
bool found
Definition util.cpp:984

References found, g_qualifiedNameMutex, Definition::getOuterScope(), Definition::isHidden(), and p.

◆ setReference()

void DefinitionImpl::setReference ( const QCString & r)

Definition at line 1726 of file definition.cpp.

1727{
1728 p->ref=r;
1729}

References p.

◆ setRefItems()

void DefinitionImpl::setRefItems ( const RefItemVector & sli)

Definition at line 1289 of file definition.cpp.

1290{
1291 p->xrefListItems.insert(p->xrefListItems.end(), sli.cbegin(), sli.cend());
1292}

References p.

◆ symbolName()

QCString DefinitionImpl::symbolName ( ) const

Definition at line 1461 of file definition.cpp.

1462{
1463 return p->symbolName;
1464}

References p.

Referenced by addToMap().

◆ writeDocAnchorsToTagFile()

void DefinitionImpl::writeDocAnchorsToTagFile ( TextStream & tagFile) const

Definition at line 340 of file definition.cpp.

341{
342 if (!p->sectionRefs.empty())
343 {
344 //printf("%s: writeDocAnchorsToTagFile(%d)\n",qPrint(name()),p->sectionRef.size());
345 for (const SectionInfo *si : p->sectionRefs)
346 {
347 if (!si->generated() && si->ref().isEmpty() && !AnchorGenerator::instance().isGenerated(si->label().str()))
348 {
349 //printf("write an entry!\n");
350 if (p->def->definitionType()==Definition::TypeMember) tagFile << " ";
351 QCString fn = si->fileName();
353 tagFile << " <docanchor file=\"" << fn << "\"";
354 if (!si->title().isEmpty())
355 {
356 tagFile << " title=\"" << convertToXML(si->title()) << "\"";
357 }
358 tagFile << ">" << si->label() << "</docanchor>\n";
359 }
360 }
361 }
362}
bool isGenerated(const std::string &anchor) const
Returns true iff anchor is one of the generated anchors.
Definition anchor.cpp:128
static AnchorGenerator & instance()
Returns the singleton instance.
Definition anchor.cpp:38
QCString ref() const
Definition section.h:71
QCString fileName() const
Definition section.h:73
bool generated() const
Definition section.h:74
QCString title() const
Definition section.h:69
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4352

References addHtmlExtensionIfMissing(), convertToXML(), SectionInfo::fileName(), SectionInfo::generated(), AnchorGenerator::instance(), QCString::isEmpty(), SectionInfo::label(), p, SectionInfo::ref(), QCString::str(), SectionInfo::title(), and Definition::TypeMember.

◆ writeInlineCode()

void DefinitionImpl::writeInlineCode ( OutputList & ol,
const QCString & scopeName ) const

Write code of this definition into the documentation

Definition at line 1016 of file definition.cpp.

1017{
1018 const MemberDef *thisMd = nullptr;
1019 if (p->def->definitionType()==Definition::TypeMember)
1020 {
1021 thisMd = toMemberDef(p->def);
1022 }
1023 bool inlineSources = thisMd && thisMd->hasInlineSource();
1024 //printf("Source Fragment %s: %d-%d\n",qPrint(name()),
1025 // p->body->startLine,p->body->endLine);
1026 if (inlineSources && hasSources())
1027 {
1028 ol.pushGeneratorState();
1029 QCString codeFragment;
1030 bool isMacro = thisMd && thisMd->memberType()==MemberType::Define;
1031 int actualStart=p->body->startLine,actualEnd=p->body->endLine;
1032 if (readCodeFragment(p->body->fileDef->absFilePath(),isMacro,
1033 actualStart,actualEnd,codeFragment)
1034 )
1035 {
1036 //printf("Adding code fragment '%s' ext='%s' range=%d-%d\n",
1037 // qPrint(codeFragment),qPrint(p->defFileExt),actualStart,actualEnd);
1038 auto intf = Doxygen::parserManager->getCodeParser(p->defFileExt);
1039 intf->resetCodeParserState();
1040 //printf("Read:\n'%s'\n\n",qPrint(codeFragment));
1041
1042 auto &codeOL = ol.codeGenerators();
1043 codeOL.startCodeFragment("DoxyCode");
1044 intf->parseCode(codeOL, // codeOutIntf
1045 scopeName, // scope
1046 codeFragment, // input
1047 p->lang, // lang
1048 Config_getBool(STRIP_CODE_COMMENTS),
1049 FALSE, // isExample
1050 QCString(), // exampleName
1051 p->body->fileDef, // fileDef
1052 actualStart, // startLine
1053 actualEnd, // endLine
1054 TRUE, // inlineFragment
1055 thisMd, // memberDef
1056 TRUE // show line numbers
1057 );
1058 codeOL.endCodeFragment("DoxyCode");
1059 }
1060 ol.popGeneratorState();
1061 }
1062}
bool hasSources() const
static ParserManager * parserManager
Definition doxygen.h:131
virtual bool hasInlineSource() const =0
virtual MemberType memberType() const =0
void startCodeFragment(const QCString &style)
Definition outputlist.h:278
const OutputCodeList & codeGenerators() const
Definition outputlist.h:357
void pushGeneratorState()
void popGeneratorState()
std::unique_ptr< CodeParserInterface > getCodeParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
Definition parserintf.h:218
bool readCodeFragment(const QCString &fileName, bool isMacro, int &startLine, int &endLine, QCString &result)
Reads a fragment from file fileName starting with line startLine and ending with line endLine.

References OutputList::codeGenerators(), Config_getBool, Define, FALSE, MemberDef::hasInlineSource(), hasSources(), MemberDef::memberType(), p, Doxygen::parserManager, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), readCodeFragment(), OutputCodeList::startCodeFragment(), toMemberDef(), TRUE, and Definition::TypeMember.

◆ writeNavigationPath()

void DefinitionImpl::writeNavigationPath ( OutputList & ol) const

Definition at line 1432 of file definition.cpp.

1433{
1434 ol.pushGeneratorState();
1436
1437 QCString navPath;
1438 navPath += "<div id=\"nav-path\" class=\"navpath\">\n"
1439 " <ul>\n";
1440 navPath += navigationPathAsString();
1441 navPath += " </ul>\n"
1442 "</div>\n";
1443 ol.writeNavigationPath(navPath);
1444
1445 ol.popGeneratorState();
1446}
QCString navigationPathAsString() const
void disableAllBut(OutputType o)
void writeNavigationPath(const QCString &s)
Definition outputlist.h:609

References OutputList::disableAllBut(), Html, navigationPathAsString(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), and OutputList::writeNavigationPath().

◆ writeQuickMemberLinks()

void DefinitionImpl::writeQuickMemberLinks ( OutputList & ,
const MemberDef *  ) const

Definition at line 1820 of file definition.cpp.

1821{
1822}

◆ writeSourceDef()

void DefinitionImpl::writeSourceDef ( OutputList & ol) const

Write a reference to the source code defining this definition

Definition at line 938 of file definition.cpp.

939{
940 //printf("DefinitionImpl::writeSourceRef %d %p\n",bodyLine,bodyDef);
941 QCString fn = getSourceFileBase();
942 if (!fn.isEmpty())
943 {
944 QCString refText = theTranslator->trDefinedAtLineInSourceFile();
945 int lineMarkerPos = refText.find("@0");
946 int fileMarkerPos = refText.find("@1");
947 if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
948 {
949 QCString lineStr;
950 lineStr.sprintf("%d",p->body->defLine);
951 QCString anchorStr = getSourceAnchor();
952 ol.startParagraph("definition");
953 if (lineMarkerPos<fileMarkerPos) // line marker before file marker
954 {
955 // write text left from linePos marker
956 ol.parseText(refText.left(lineMarkerPos));
957 ol.writeObjectLink(QCString(),fn,anchorStr,lineStr);
958 // write text between markers
959 ol.parseText(refText.mid(lineMarkerPos+2,fileMarkerPos-lineMarkerPos-2));
960 // write file link
961 ol.writeObjectLink(QCString(),fn,QCString(),p->body->fileDef->name());
962 // write text right from file marker
963 ol.parseText(refText.right(refText.length()-static_cast<size_t>(fileMarkerPos)-2));
964 }
965 else // file marker before line marker
966 {
967 // write text left from file marker
968 ol.parseText(refText.left(fileMarkerPos));
969 // write file link
970 ol.writeObjectLink(QCString(),fn,QCString(),p->body->fileDef->name());
971 // write text between markers
972 ol.parseText(refText.mid(fileMarkerPos+2,lineMarkerPos-fileMarkerPos-2));
973 // write line link
974 ol.writeObjectLink(QCString(),fn,anchorStr,lineStr);
975 // write text right from linePos marker
976 ol.parseText(refText.right(refText.length()-static_cast<size_t>(lineMarkerPos)-2));
977 }
978 ol.endParagraph();
979 }
980 else
981 {
982 err("translation error: invalid markers in trDefinedAtLineInSourceFile()\n");
983 }
984 }
985}
QCString getSourceFileBase() const
QCString getSourceAnchor() const
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
QCString right(size_t len) const
Definition qcstring.h:219
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
QCString left(size_t len) const
Definition qcstring.h:214
virtual QCString trDefinedAtLineInSourceFile()=0

References OutputList::endParagraph(), err, QCString::find(), getSourceAnchor(), getSourceFileBase(), QCString::isEmpty(), QCString::left(), QCString::length(), QCString::mid(), p, OutputList::parseText(), QCString::right(), QCString::sprintf(), OutputList::startParagraph(), theTranslator, and OutputList::writeObjectLink().

◆ writeSourceReffedBy()

void DefinitionImpl::writeSourceReffedBy ( OutputList & ol,
const QCString & scopeName ) const

Definition at line 1150 of file definition.cpp.

1151{
1152 _writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),p->sourceRefByDict,FALSE);
1153}
void _writeSourceRefList(OutputList &ol, const QCString &scopeName, const QCString &text, const std::unordered_map< std::string, MemberDef * > &members, bool) const
virtual QCString trReferencedBy()=0

References _writeSourceRefList(), FALSE, p, and theTranslator.

◆ writeSourceRefs()

void DefinitionImpl::writeSourceRefs ( OutputList & ol,
const QCString & scopeName ) const

Definition at line 1155 of file definition.cpp.

1156{
1157 _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),p->sourceRefsDict,TRUE);
1158}
virtual QCString trReferences()=0

References _writeSourceRefList(), p, theTranslator, and TRUE.

◆ writeSummaryLinks()

void DefinitionImpl::writeSummaryLinks ( OutputList & ) const

Definition at line 1824 of file definition.cpp.

1825{
1826}

◆ writeToc()

void DefinitionImpl::writeToc ( OutputList & ol,
const LocalToc & lt ) const

Definition at line 1448 of file definition.cpp.

1449{
1450 if (p->sectionRefs.empty()) return;
1451 ol.writeLocalToc(p->sectionRefs,localToc);
1452}
void writeLocalToc(const SectionRefs &refs, const LocalToc &lt)
Definition outputlist.h:743

References p, and OutputList::writeLocalToc().

◆ xrefListItems()

const RefItemVector & DefinitionImpl::xrefListItems ( ) const

Definition at line 1332 of file definition.cpp.

1333{
1334 return p->xrefListItems;
1335}

References p.

Member Data Documentation

◆ p

std::unique_ptr<Private> DefinitionImpl::p
private

Definition at line 143 of file definitionimpl.h.

Referenced by _getXRefListId(), _setBriefDescription(), _setInbodyDocumentation(), _setSymbolName(), _symbolName(), _writeSourceRefList(), addSectionsToDefinition(), addSourceReferencedBy(), addSourceReferences(), briefDescription(), briefDescriptionAsTooltip(), briefFile(), briefLine(), computeTooltip(), DefinitionImpl(), DefinitionImpl(), docFile(), docLine(), documentation(), getBodyDef(), getDefColumn(), getDefFileExtension(), getDefFileName(), getDefLine(), getEndBodyLine(), getLanguage(), getOuterScope(), getReference(), getReferencedByMembers(), getReferencesMembers(), getSectionRefs(), getSourceAnchor(), getSourceFileBase(), getStartBodyLine(), getStartDefLine(), hasDocumentation(), hasSections(), hasSourceReffedBy(), hasSourceRefs(), hasSources(), hasUserDocumentation(), inbodyDocumentation(), inbodyFile(), inbodyLine(), isAnonymous(), isArtificial(), isExported(), isHidden(), isReference(), isVisible(), isVisibleInProject(), localName(), makePartOfGroup(), mergeReferencedBy(), mergeReferences(), mergeRefItems(), name(), navigationPathAsString(), operator=(), partOfGroups(), pathFragment(), qualifiedName(), setArtificial(), setBodyDef(), setBodySegment(), setDefFile(), setExported(), setHidden(), setId(), setLanguage(), setLocalName(), setName(), setOuterScope(), setReference(), setRefItems(), symbolName(), toDefinition(), writeDocAnchorsToTagFile(), writeInlineCode(), writeSourceDef(), writeSourceReffedBy(), writeSourceRefs(), writeToc(), xrefListItems(), and ~DefinitionImpl().


The documentation for this class was generated from the following files: