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(), and toDefinition().

◆ _getXRefListId()

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

Definition at line 1317 of file definition.cpp.

1318{
1319 for (const RefItem *item : p->xrefListItems)
1320 {
1321 if (item->list()->listName()==listName)
1322 {
1323 return item->id();
1324 }
1325 }
1326 return -1;
1327}
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:5368

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

References 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 1759 of file definition.cpp.

1760{
1761 p->symbolName=name;
1762}

References name(), and p.

◆ _symbolName()

QCString DefinitionImpl::_symbolName ( ) const

Definition at line 1764 of file definition.cpp.

1765{
1766 return p->symbolName;
1767}

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 1079 of file definition.cpp.

1082{
1083 if (!membersMap.empty())
1084 {
1085 auto members = refMapToVector(membersMap);
1086
1087 auto replaceFunc = [this,&members,scopeName,&ol](size_t entryIndex)
1088 {
1089 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1090 bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE);
1091 const MemberDef *md=members[entryIndex];
1092 if (md)
1093 {
1094 QCString scope=md->getScopeString();
1095 QCString name=md->name();
1096 //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),qPrint(scope),scopeName);
1097 if (!scope.isEmpty() && scope!=scopeName)
1098 {
1099 name.prepend(scope+getLanguageSpecificSeparator(p->lang));
1100 }
1101 if (!md->isObjCMethod() &&
1102 (md->isFunction() || md->isSlot() ||
1103 md->isPrototype() || md->isSignal()
1104 )
1105 )
1106 {
1107 name+="()";
1108 }
1109 if (sourceBrowser &&
1110 !(md->isLinkable() && !refLinkSource) &&
1111 md->getStartBodyLine()!=-1 &&
1112 md->getBodyDef()
1113 )
1114 {
1115 const int maxLineNrStr = 10;
1116 char anchorStr[maxLineNrStr];
1117 qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine());
1118 //printf("Write object link to %s\n",qPrint(md->getBodyDef()->getSourceFileBase()));
1119 ol.writeObjectLink(QCString(),md->getBodyDef()->getSourceFileBase(),anchorStr,name);
1120 }
1121 else if (md->isLinkable())
1122 {
1124 md->getOutputFileBase(),
1125 md->anchor(),name);
1126 }
1127 else
1128 {
1129 ol.docify(name);
1130 }
1131 }
1132 };
1133
1134 ol.startParagraph("reference");
1135 ol.parseText(text);
1136 ol.docify(" ");
1137 writeMarkerList(ol,
1138 theTranslator->trWriteList(static_cast<int>(members.size())).str(),
1139 members.size(),
1140 replaceFunc);
1141 ol.writeString(".");
1142 ol.endParagraph();
1143
1144 }
1145}
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:6230
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 1212 of file definition.cpp.

1213{
1214 err("DefinitionImpl::addInnerCompound() called\n");
1215}
#define err(fmt,...)
Definition message.h:84

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
Find an object given the key.
Definition linkedmap.h:47
QCString label() const
Definition section.h:68
void setDefinition(Definition *d)
Definition section.h:82
SectionInfo * add(const SectionInfo &si)
Add a new section given the data of an existing section.
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 1191 of file definition.cpp.

1192{
1193 if (md)
1194 {
1195 p->sourceRefByDict.emplace(sourceRefName.str(),md);
1196 }
1197}

References p, and QCString::str().

◆ addSourceReferences()

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

Definition at line 1199 of file definition.cpp.

1200{
1201 if (md)
1202 {
1203 p->sourceRefsDict.emplace(sourceRefName.str(),md);
1204 }
1205}

References p, and QCString::str().

◆ briefDescription()

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

Definition at line 1530 of file definition.cpp.

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

References abbreviate(), and p.

Referenced by hasBriefDescription().

◆ briefDescriptionAsTooltip()

QCString DefinitionImpl::briefDescriptionAsTooltip ( ) const

Definition at line 1549 of file definition.cpp.

1550{
1551 return p->brief ? p->brief->tooltip : QCString();
1552}

References p.

◆ briefFile()

QCString DefinitionImpl::briefFile ( ) const

Definition at line 1559 of file definition.cpp.

1560{
1561 return p->brief && !p->brief->file.isEmpty() ? p->brief->file : QCString("<"+p->name+">");
1562}

References p.

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

◆ briefLine()

int DefinitionImpl::briefLine ( ) const

Definition at line 1554 of file definition.cpp.

1555{
1556 return p->brief ? p->brief->line : 1;
1557}

References p.

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

◆ computeTooltip()

void DefinitionImpl::computeTooltip ( )

Definition at line 1538 of file definition.cpp.

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

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

◆ docFile()

QCString DefinitionImpl::docFile ( ) const

Definition at line 1475 of file definition.cpp.

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

References p.

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

◆ docLine()

int DefinitionImpl::docLine ( ) const

Definition at line 1470 of file definition.cpp.

1471{
1472 return p->details ? p->details->line : p->brief ? p->brief->line : 1;
1473}

References p.

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

◆ documentation()

QCString DefinitionImpl::documentation ( ) const

Definition at line 1465 of file definition.cpp.

1466{
1467 return p->details ? p->details->doc : QCString("");
1468}

References p.

◆ externalReference()

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

Definition at line 1775 of file definition.cpp.

1776{
1777 QCString ref = getReference();
1778 if (!ref.isEmpty())
1779 {
1780 auto it = Doxygen::tagDestinationMap.find(ref.str());
1782 {
1783 QCString result(it->second);
1784 size_t l = result.length();
1785 if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
1786 { // relative path -> prepend relPath.
1787 result.prepend(relPath);
1788 l+=relPath.length();
1789 }
1790 if (l>0 && result.at(l-1)!='/') result+='/';
1791 return result;
1792 }
1793 }
1794 return relPath;
1795}
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 1207 of file definition.cpp.

1208{
1209 return nullptr;
1210}

◆ getBodyDef()

const FileDef * DefinitionImpl::getBodyDef ( ) const

Definition at line 1644 of file definition.cpp.

1645{
1646 return p->body ? p->body->fileDef : nullptr;
1647}

References p.

◆ getDefColumn()

int DefinitionImpl::getDefColumn ( ) const

Definition at line 1812 of file definition.cpp.

1813{
1814 return p->defColumn;
1815}

References p.

◆ getDefFileExtension()

QCString DefinitionImpl::getDefFileExtension ( ) const

Definition at line 1589 of file definition.cpp.

1590{
1591 return p->defFileExt;
1592}

References p.

◆ getDefFileName()

QCString DefinitionImpl::getDefFileName ( ) const

Definition at line 1584 of file definition.cpp.

1585{
1586 return p->defFileName;
1587}

References p.

◆ getDefLine()

int DefinitionImpl::getDefLine ( ) const

Definition at line 1807 of file definition.cpp.

1808{
1809 return p->defLine;
1810}

References p.

◆ getEndBodyLine()

int DefinitionImpl::getEndBodyLine ( ) const

Definition at line 1639 of file definition.cpp.

1640{
1641 return p->body ? p->body->endLine : -1;
1642}

References p.

◆ getLanguage()

SrcLangExt DefinitionImpl::getLanguage ( ) const

Definition at line 1728 of file definition.cpp.

1729{
1730 return p->lang;
1731}

References p.

Referenced by qualifiedName().

◆ getOuterScope()

Definition * DefinitionImpl::getOuterScope ( ) const

Definition at line 1663 of file definition.cpp.

1664{
1665 return p->outerScope;
1666}

References p.

Referenced by navigationPathAsString().

◆ getReference()

QCString DefinitionImpl::getReference ( ) const

Definition at line 1619 of file definition.cpp.

1620{
1621 return p->ref;
1622}

References p.

Referenced by externalReference().

◆ getReferencedByMembers()

const MemberVector & DefinitionImpl::getReferencedByMembers ( ) const

Definition at line 1680 of file definition.cpp.

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

References g_memberReferenceMutex, p, and refMapToVector().

◆ getReferencesMembers()

const MemberVector & DefinitionImpl::getReferencesMembers ( ) const

Definition at line 1670 of file definition.cpp.

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

References g_memberReferenceMutex, p, and refMapToVector().

◆ getSectionRefs()

const SectionRefs & DefinitionImpl::getSectionRefs ( ) const

Definition at line 1453 of file definition.cpp.

1454{
1455 return p->sectionRefs;
1456}

References p.

◆ getSourceAnchor()

QCString DefinitionImpl::getSourceAnchor ( ) const

Definition at line 915 of file definition.cpp.

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

References p, qsnprintf, and Htags::useHtags.

Referenced by writeSourceDef().

◆ getSourceFileBase()

QCString DefinitionImpl::getSourceFileBase ( ) const

Definition at line 902 of file definition.cpp.

903{
904 ASSERT(p->def->definitionType()!=Definition::TypeFile); // file overloads this method
905 QCString fn;
906 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
907 if (sourceBrowser &&
908 p->body && p->body->startLine!=-1 && p->body->fileDef)
909 {
910 fn = p->body->fileDef->getSourceFileBase();
911 }
912 return fn;
913}
#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 1634 of file definition.cpp.

1635{
1636 return p->body ? p->body->startLine : -1;
1637}

References p.

◆ getStartDefLine()

int DefinitionImpl::getStartDefLine ( ) const

Definition at line 1629 of file definition.cpp.

1630{
1631 return p->body ? p->body->defLine : -1;
1632}

References p.

◆ hasBriefDescription()

bool DefinitionImpl::hasBriefDescription ( ) const

Definition at line 1769 of file definition.cpp.

1770{
1771 bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC);
1772 return !briefDescription().isEmpty() && briefMemberDesc;
1773}
QCString briefDescription(bool abbreviate=FALSE) const

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

◆ hasDocumentation()

bool DefinitionImpl::hasDocumentation ( ) const

Definition at line 1167 of file definition.cpp.

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

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 1157 of file definition.cpp.

1158{
1159 return !p->sourceRefByDict.empty();
1160}

References p.

◆ hasSourceRefs()

bool DefinitionImpl::hasSourceRefs ( ) const

Definition at line 1162 of file definition.cpp.

1163{
1164 return !p->sourceRefsDict.empty();
1165}

References p.

◆ hasSources()

bool DefinitionImpl::hasSources ( ) const

Definition at line 1005 of file definition.cpp.

1006{
1007 return p->body && p->body->startLine!=-1 &&
1008 p->body->endLine>=p->body->startLine &&
1009 p->body->fileDef;
1010}

References p.

Referenced by writeInlineCode().

◆ hasUserDocumentation()

bool DefinitionImpl::hasUserDocumentation ( ) const

Definition at line 1182 of file definition.cpp.

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

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 1566 of file definition.cpp.

1567{
1568 return p->inbodyDocs ? p->inbodyDocs->doc : QCString("");
1569}

References p.

◆ inbodyFile()

QCString DefinitionImpl::inbodyFile ( ) const

Definition at line 1576 of file definition.cpp.

1577{
1578 return p->inbodyDocs && !p->inbodyDocs->file.isEmpty() ? p->inbodyDocs->file : QCString("<"+p->name+">");
1579}

References p.

Referenced by _setInbodyDocumentation(), and setInbodyDocumentation().

◆ inbodyLine()

int DefinitionImpl::inbodyLine ( ) const

Definition at line 1571 of file definition.cpp.

1572{
1573 return p->inbodyDocs ? p->inbodyDocs->line : 1;
1574}

References p.

Referenced by _setInbodyDocumentation(), and setInbodyDocumentation().

◆ isAnonymous()

bool DefinitionImpl::isAnonymous ( ) const

Definition at line 1802 of file definition.cpp.

1803{
1804 return p->isAnonymous;
1805}

References p.

◆ isArtificial()

bool DefinitionImpl::isArtificial ( ) const

Definition at line 1609 of file definition.cpp.

1610{
1611 return p->isArtificial;
1612}

References p.

◆ isExported()

bool DefinitionImpl::isExported ( ) const

Definition at line 1614 of file definition.cpp.

1615{
1616 return p->isExported;
1617}

References p.

◆ isHidden()

bool DefinitionImpl::isHidden ( ) const

Definition at line 1594 of file definition.cpp.

1595{
1596 return p->hidden;
1597}

References p.

◆ isLinkableViaGroup()

bool DefinitionImpl::isLinkableViaGroup ( ) const

Definition at line 1654 of file definition.cpp.

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

References partOfGroups().

◆ isReference()

bool DefinitionImpl::isReference ( ) const

Definition at line 1624 of file definition.cpp.

1625{
1626 return !p->ref.isEmpty();
1627}

References p.

◆ isVisible()

bool DefinitionImpl::isVisible ( ) const

Definition at line 1604 of file definition.cpp.

1605{
1606 return p->def->isLinkable() && !p->hidden;
1607}

References p.

◆ isVisibleInProject()

bool DefinitionImpl::isVisibleInProject ( ) const

Definition at line 1599 of file definition.cpp.

1600{
1601 return p->def->isLinkableInProject() && !p->hidden;
1602}

References p.

◆ localName()

const QCString & DefinitionImpl::localName ( ) const

Definition at line 1276 of file definition.cpp.

1277{
1278 return p->localName;
1279}

References p.

Referenced by navigationPathAsString().

◆ makePartOfGroup()

void DefinitionImpl::makePartOfGroup ( GroupDef * gd)

Definition at line 1281 of file definition.cpp.

1282{
1283 p->partOfGroups.push_back(gd);
1284}

References p.

◆ mergeReferencedBy()

void DefinitionImpl::mergeReferencedBy ( const Definition * other)

Definition at line 1706 of file definition.cpp.

1707{
1708 const DefinitionImpl *defImpl = other->toDefinitionImpl_();
1709 if (defImpl)
1710 {
1711 for (const auto &kv : defImpl->p->sourceRefByDict)
1712 {
1713 auto it = p->sourceRefByDict.find(kv.first);
1714 if (it != p->sourceRefByDict.end())
1715 {
1716 p->sourceRefByDict.emplace(kv.first,kv.second);
1717 }
1718 }
1719 }
1720}
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 1690 of file definition.cpp.

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

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

◆ mergeRefItems()

void DefinitionImpl::mergeRefItems ( Definition * d)

Definition at line 1291 of file definition.cpp.

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

1373{
1374 QCString result;
1375 Definition *outerScope = getOuterScope();
1376 QCString locName = localName();
1377 if (outerScope && outerScope!=Doxygen::globalScope)
1378 {
1379 result+=outerScope->navigationPathAsString();
1380 }
1381 else if (p->def->definitionType()==Definition::TypeFile &&
1382 toFileDef(p->def)->getDirDef())
1383 {
1384 result+=(toFileDef(p->def))->getDirDef()->navigationPathAsString();
1385 }
1386 result+="<li class=\"navelem\">";
1387 if (p->def->isLinkableInProject())
1388 {
1389 QCString fn = p->def->getOutputFileBase();
1391 if (p->def->definitionType()==Definition::TypeGroup &&
1392 !toGroupDef(p->def)->groupTitle().isEmpty())
1393 {
1394 result+="<a class=\"el\" href=\"$relpath^"+fn+"\">"+
1395 convertToHtml(toGroupDef(p->def)->groupTitle())+"</a>";
1396 }
1397 else if (p->def->definitionType()==Definition::TypePage &&
1398 toPageDef(p->def)->hasTitle())
1399 {
1400 result+="<a class=\"el\" href=\"$relpath^"+fn+"\">"+
1401 convertToHtml((toPageDef(p->def))->title())+"</a>";
1402 }
1403 else if (p->def->definitionType()==Definition::TypeClass)
1404 {
1405 QCString name = locName;
1406 if (name.endsWith("-p"))
1407 {
1408 name = name.left(name.length()-2);
1409 }
1410 result+="<a class=\"el\" href=\"$relpath^"+fn;
1411 if (!p->def->anchor().isEmpty()) result+="#"+p->def->anchor();
1412 result+="\">"+convertToHtml(name)+"</a>";
1413 }
1414 else
1415 {
1416 result+="<a class=\"el\" href=\"$relpath^"+fn+"\">"+
1417 convertToHtml(locName)+"</a>";
1418 }
1419 }
1420 else
1421 {
1422 result+="<b>"+convertToHtml(locName)+"</b>";
1423 }
1424 result+="</li>";
1425 return result;
1426}
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:4317
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243

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 1649 of file definition.cpp.

1650{
1651 return p->partOfGroups;
1652}

References p.

Referenced by isLinkableViaGroup().

◆ pathFragment()

QCString DefinitionImpl::pathFragment ( ) const

Definition at line 1334 of file definition.cpp.

1335{
1336 QCString result;
1337 if (p->outerScope && p->outerScope!=Doxygen::globalScope)
1338 {
1339 result = p->outerScope->pathFragment();
1340 }
1341 if (p->def->isLinkable())
1342 {
1343 if (!result.isEmpty()) result+="/";
1344 if (p->def->definitionType()==Definition::TypeGroup &&
1345 !toGroupDef(p->def)->groupTitle().isEmpty())
1346 {
1347 result+=toGroupDef(p->def)->groupTitle();
1348 }
1349 else if (p->def->definitionType()==Definition::TypePage &&
1350 toPageDef(p->def)->hasTitle())
1351 {
1352 result+=toPageDef(p->def)->title();
1353 }
1354 else
1355 {
1356 result+=p->localName;
1357 }
1358 }
1359 else
1360 {
1361 result+=p->localName;
1362 }
1363 return result;
1364}
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 1219 of file definition.cpp.

1220{
1221 std::lock_guard<std::recursive_mutex> lock(g_qualifiedNameMutex);
1222 if (!p->qualifiedName.isEmpty())
1223 {
1224 return p->qualifiedName;
1225 }
1226
1227 //printf("start %s::qualifiedName() localName=%s\n",qPrint(name()),qPrint(p->localName));
1228 if (p->outerScope==nullptr)
1229 {
1230 if (p->localName=="<globalScope>")
1231 {
1232 return "";
1233 }
1234 else
1235 {
1236 return p->localName;
1237 }
1238 }
1239
1240 if (p->outerScope->name()=="<globalScope>")
1241 {
1242 p->qualifiedName = p->localName;
1243 }
1244 else
1245 {
1246 p->qualifiedName = p->outerScope->qualifiedName()+
1248 p->localName;
1249 }
1250 //printf("end %s::qualifiedName()=%s\n",qPrint(name()),qPrint(p->qualifiedName));
1251 //count--;
1252 return p->qualifiedName;
1253}
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 1738 of file definition.cpp.

1739{
1740 p->isArtificial = b;
1741}

References p.

◆ setBodyDef()

void DefinitionImpl::setBodyDef ( const FileDef * fd)

Definition at line 996 of file definition.cpp.

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

References p.

◆ setBodySegment()

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

Definition at line 984 of file definition.cpp.

985{
986 if (!p->body.has_value())
987 {
988 p->body = std::make_optional<BodyInfo>();
989 }
990 BodyInfo &body = p->body.value();
991 body.defLine = defLine;
992 body.startLine = bls;
993 body.endLine = ble;
994}
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 1743 of file definition.cpp.

1744{
1745 p->isExported = b;
1746}

References p.

◆ setHidden()

void DefinitionImpl::setHidden ( bool b)

Definition at line 1733 of file definition.cpp.

1734{
1735 p->hidden = p->hidden || b;
1736}

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 521 of file definition.cpp.

522{
523 if (d.isEmpty()) return;
525}
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 1753 of file definition.cpp.

1754{
1755 p->lang=lang;
1756}

References p.

◆ setLocalName()

void DefinitionImpl::setLocalName ( const QCString & name)

Definition at line 1748 of file definition.cpp.

1749{
1750 p->localName=name;
1751}

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 1255 of file definition.cpp.

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

1724{
1725 p->ref=r;
1726}

References p.

◆ setRefItems()

void DefinitionImpl::setRefItems ( const RefItemVector & sli)

Definition at line 1286 of file definition.cpp.

1287{
1288 p->xrefListItems.insert(p->xrefListItems.end(), sli.cbegin(), sli.cend());
1289}

References p.

◆ symbolName()

QCString DefinitionImpl::symbolName ( ) const

Definition at line 1458 of file definition.cpp.

1459{
1460 return p->symbolName;
1461}

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:4266

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 1013 of file definition.cpp.

1014{
1015 const MemberDef *thisMd = nullptr;
1016 if (p->def->definitionType()==Definition::TypeMember)
1017 {
1018 thisMd = toMemberDef(p->def);
1019 }
1020 bool inlineSources = thisMd && thisMd->hasInlineSource();
1021 //printf("Source Fragment %s: %d-%d\n",qPrint(name()),
1022 // p->body->startLine,p->body->endLine);
1023 if (inlineSources && hasSources())
1024 {
1025 ol.pushGeneratorState();
1026 QCString codeFragment;
1027 bool isMacro = thisMd && thisMd->memberType()==MemberType::Define;
1028 int actualStart=p->body->startLine,actualEnd=p->body->endLine;
1029 if (readCodeFragment(p->body->fileDef->absFilePath(),isMacro,
1030 actualStart,actualEnd,codeFragment)
1031 )
1032 {
1033 //printf("Adding code fragment '%s' ext='%s' range=%d-%d\n",
1034 // qPrint(codeFragment),qPrint(p->defFileExt),actualStart,actualEnd);
1035 auto intf = Doxygen::parserManager->getCodeParser(p->defFileExt);
1036 intf->resetCodeParserState();
1037 //printf("Read:\n'%s'\n\n",qPrint(codeFragment));
1038
1039 auto &codeOL = ol.codeGenerators();
1040 codeOL.startCodeFragment("DoxyCode");
1041 intf->parseCode(codeOL, // codeOutIntf
1042 scopeName, // scope
1043 codeFragment, // input
1044 p->lang, // lang
1045 Config_getBool(STRIP_CODE_COMMENTS),
1046 FALSE, // isExample
1047 QCString(), // exampleName
1048 p->body->fileDef, // fileDef
1049 actualStart, // startLine
1050 actualEnd, // endLine
1051 TRUE, // inlineFragment
1052 thisMd, // memberDef
1053 TRUE // show line numbers
1054 );
1055 codeOL.endCodeFragment("DoxyCode");
1056 }
1057 ol.popGeneratorState();
1058 }
1059}
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 1429 of file definition.cpp.

1430{
1431 ol.pushGeneratorState();
1433
1434 QCString navPath;
1435 navPath += "<div id=\"nav-path\" class=\"navpath\">\n"
1436 " <ul>\n";
1437 navPath += navigationPathAsString();
1438 navPath += " </ul>\n"
1439 "</div>\n";
1440 ol.writeNavigationPath(navPath);
1441
1442 ol.popGeneratorState();
1443}
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 1817 of file definition.cpp.

1818{
1819}

◆ writeSourceDef()

void DefinitionImpl::writeSourceDef ( OutputList & ol) const

Write a reference to the source code defining this definition

Definition at line 935 of file definition.cpp.

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

1148{
1149 _writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),p->sourceRefByDict,FALSE);
1150}
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 1152 of file definition.cpp.

1153{
1154 _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),p->sourceRefsDict,TRUE);
1155}
virtual QCString trReferences()=0

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

◆ writeSummaryLinks()

void DefinitionImpl::writeSummaryLinks ( OutputList & ) const

Definition at line 1821 of file definition.cpp.

1822{
1823}

◆ writeToc()

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

Definition at line 1445 of file definition.cpp.

1446{
1447 if (p->sectionRefs.empty()) return;
1448 ol.writeLocalToc(p->sectionRefs,localToc);
1449}
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 1329 of file definition.cpp.

1330{
1331 return p->xrefListItems;
1332}

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: