18#include <unordered_map>
76 std::optional<BodyInfo>
body;
126 if (lname!=
"<globalScope>")
152 p->setDefFileName(df);
153 p->defLine = defLine;
154 p->defColumn = defCol;
162 if (exclSyms.empty())
return FALSE;
163 std::string symName =
name.
str();
164 for (
const auto &pat : exclSyms)
167 bool forceStart=
FALSE;
169 if (pattern.
at(0)==
'^')
170 pattern=pattern.
mid(1),forceStart=
TRUE;
171 if (pattern.
at(pattern.
length()-1)==
'$')
173 if (pattern.
find(
'*')!=-1)
179 size_t ui = match.position();
180 size_t pl = match.length();
181 size_t sl = symName.length();
182 if ((ui==0 || pattern.
at(0)==
'*' || (!
isId(symName.at(ui-1)) && !forceStart)) &&
183 (ui+pl==sl || pattern.
at(pattern.
length()-1)==
'*' || (!
isId(symName.at(ui+pl)) && !forceEnd))
193 size_t i = symName.find(pattern.
str());
194 if (i!=std::string::npos)
197 size_t pl=pattern.
length();
198 size_t sl=symName.length();
200 if ((ui==0 || (!
isId(symName.at(ui-1)) && !forceStart)) &&
201 (ui+pl==sl || (!
isId(symName.at(ui+pl)) && !forceEnd))
237 const char *d,
bool isSymbol)
245 p->isSymbol = isSymbol;
265 p = std::make_unique<Private>(*other.
p);
280 if (
name.isEmpty())
return;
282 p->isAnonymous =
p->name.isEmpty() ||
283 p->name.at(0)==
'@' ||
284 p->name.find(
"::@")!=-1;
289 if (
id.isEmpty())
return;
317 if (
p->sectionRefs.find(gsi->
label())==
nullptr)
319 p->sectionRefs.add(gsi);
329 if (
p->sectionRefs.empty())
return FALSE;
342 if (!
p->sectionRefs.empty())
353 tagFile <<
" <docanchor file=\"" << fn <<
"\"";
358 tagFile <<
">" << si->
label() <<
"</docanchor>\n";
371 MD5Buffer(docStr.
data(),
static_cast<unsigned int>(docStr.
length()),md5_sig);
372 MD5SigToString(md5_sig,sigStr);
375 if (sigList.
find(sigStr)==-1)
403 if (!
p->details.has_value())
405 p->details = std::make_optional<DocInfo>();
446 size_t bl = brief.
length();
451 int c = brief.
at(bl-1);
454 case '.':
case '!':
case '?':
case '>':
case ':':
case ')':
break;
464 if (
p->brief && !
p->brief->doc.isEmpty())
472 if (!
p->brief.has_value())
474 p->brief = std::make_optional<BriefInfo>();
506 if (!
p->inbodyDocs.has_value())
508 p->inbodyDocs = std::make_optional<DocInfo>();
510 DocInfo &inbodyDocs =
p->inbodyDocs.value();
513 inbodyDocs.
doc = doc;
554 bool usePipe = !filter.
isEmpty() && filterSourceFiles;
560 size_t startLine,
size_t endLine,std::string &str)
562 std::unique_lock<std::mutex> lock(
m_mutex);
567 auto item = it->second;
575 auto [ startLineOffset, fragmentSize] =
getFragmentLocation(it_off->second,startLine,endLine);
579 item.filePos+startLineOffset, fragmentSize);
586 QCString cmd=filter+
" \""+fileName+
"\"";
592 err(
"Error opening filter pipe command '{}'\n",cmd);
609 const int blockSize = 4096;
611 size_t bytesRead = fread(buf,1,blockSize,f);
612 size_t bytesWritten = fwrite(buf,1,bytesRead,bf);
613 if (bytesRead!=bytesWritten)
616 err(
"Failed to write to filter database {}. Wrote {} out of {} bytes\n",
623 str+=std::string_view(buf,bytesWritten);
627 m_cache.emplace(fileName.str(),item);
645 std::unique_lock<std::mutex> lock(
m_mutex);
673 const char *p=str.data();
677 while ((c=*p)!=
'\n' && c!=0) p++;
679 it->second.push_back(p-str.data());
686 size_t startLine,
size_t endLine) -> std::tuple<size_t,size_t>
688 assert(startLine > 0);
689 assert(startLine <= endLine);
690 const size_t startLineOffset = lineOffsets[std::min(startLine-1,lineOffsets.size()-1)];
691 const size_t endLineOffset = lineOffsets[std::min(endLine, lineOffsets.size()-1)];
692 assert(startLineOffset <= endLineOffset);
693 const size_t fragmentSize = endLineOffset-startLineOffset;
694 return std::tie(startLineOffset,fragmentSize);
706 auto [ startLineOffset, fragmentSize] =
getFragmentLocation(lineOffsets,startLine,endLine);
709 str.erase(0,startLineOffset);
710 str.resize(fragmentSize);
719 if (size==0) { startOffset=0; size =
static_cast<size_t>(ifs.tellg()); }
720 ifs.seekg(startOffset, std::ios::beg);
722 ifs.read(str.data(), size);
726 std::unordered_map<std::string,FilterCacheItem>
m_cache;
753 int &startLine,
int &endLine,
QCString &result)
757 bool usePipe = !filter.
isEmpty() && filterSourceFiles;
760 const int blockSize = 4096;
763 static_cast<size_t>(std::max(1,startLine)),
764 static_cast<size_t>(std::max({1,startLine,endLine})),str);
777 int lineNr=startLine;
783 while ((c=*p++)!=
'{' && c!=
':' && c!=0)
792 col+=tabSize - (col%tabSize);
794 else if (pc==
'/' && c==
'/')
796 while ((c=*p++)!=
'\n' && c!=0);
797 if (c==
'\n') lineNr++,col=0;
799 else if (pc==
'/' && c==
'*')
801 while (((c=*p++)!=
'/' || pc!=
'*') && c!=0)
803 if (c==
'\n') lineNr++,col=0;
833 if (endLine!=startLine)
836 spaces.
fill(
' ',col);
845 if (cn==
'\n') lineNr++;
847 char lineStr[blockSize];
856 while ((c=*p) && i<blockSize-1)
865 }
while (size_read == (blockSize-1));
870 int newLineIndex = result.
findRev(
'\n');
871 int braceIndex = result.
findRev(
'}');
872 if (braceIndex > newLineIndex)
874 result.
resize(
static_cast<size_t>(braceIndex+1));
885 if (encoding!=
"UTF-8")
887 std::string encBuf = result.
str();
895 err(
"failed to transcode characters in code fragment in file {} lines {} to {}, from input encoding {} to UTF-8\n",
896 fileName,startLine,endLine,encoding);
900 if (!result.
isEmpty() && result.
at(result.
length()-1)!=
'\n') result +=
"\n";
911 p->body &&
p->body->startLine!=-1 &&
p->body->fileDef)
913 fn =
p->body->fileDef->getSourceFileBase();
920 const int maxAnchorStrLen = 20;
921 char anchorStr[maxAnchorStrLen];
923 if (
p->body &&
p->body->startLine!=-1)
927 qsnprintf(anchorStr,maxAnchorStrLen,
"L%d",
p->body->defLine);
931 qsnprintf(anchorStr,maxAnchorStrLen,
"l%05d",
p->body->defLine);
945 int lineMarkerPos = refText.
find(
"@0");
946 int fileMarkerPos = refText.
find(
"@1");
947 if (lineMarkerPos!=-1 && fileMarkerPos!=-1)
950 lineStr.
sprintf(
"%d",
p->body->defLine);
953 if (lineMarkerPos<fileMarkerPos)
959 ol.
parseText(refText.
mid(lineMarkerPos+2,fileMarkerPos-lineMarkerPos-2));
972 ol.
parseText(refText.
mid(fileMarkerPos+2,lineMarkerPos-fileMarkerPos-2));
982 err(
"translation error: invalid markers in trDefinedAtLineInSourceFile()\n");
989 if (!
p->body.has_value())
991 p->body = std::make_optional<BodyInfo>();
1001 if (!
p->body.has_value())
1003 p->body = std::make_optional<BodyInfo>();
1005 p->body.value().fileDef=fd;
1010 return p->body &&
p->body->startLine!=-1 &&
1011 p->body->endLine>=
p->body->startLine &&
1031 int actualStart=
p->body->startLine,actualEnd=
p->body->endLine;
1033 actualStart,actualEnd,codeFragment)
1039 intf->resetCodeParserState();
1044 intf->parseCode(codeOL,
1058 codeOL.endCodeFragment(
"DoxyCode");
1068 std::transform(map.begin(),map.end(),
1069 std::back_inserter(result),
1070 [](
const auto &item)
1071 { return item.second; }
1074 std::stable_sort(result.
begin(),result.
end(),
1075 [](
const auto &m1,
const auto &m2) { return genericCompareMembers(m1,m2)<0; });
1083 const QCString &text,
const std::unordered_map<std::string,MemberDef *> &membersMap,
1086 if (!membersMap.empty())
1090 auto replaceFunc = [
this,&members,scopeName,&ol](
size_t entryIndex)
1094 const MemberDef *md=members[entryIndex];
1100 if (!scope.
isEmpty() && scope!=scopeName)
1112 if (sourceBrowser &&
1118 const int maxLineNrStr = 10;
1119 char anchorStr[maxLineNrStr];
1141 theTranslator->trWriteList(
static_cast<int>(members.size())).str(),
1162 return !
p->sourceRefByDict.empty();
1167 return !
p->sourceRefsDict.empty();
1175 (
p->details && !
p->details->doc.isEmpty()) ||
1176 (
p->brief && !
p->brief->doc.isEmpty()) ||
1177 (
p->inbodyDocs && !
p->inbodyDocs->doc.isEmpty()) ||
1188 (
p->details && !
p->details->doc.isEmpty()) ||
1189 (
p->brief && !
p->brief->doc.isEmpty()) ||
1190 (
p->inbodyDocs && !
p->inbodyDocs->doc.isEmpty());
1198 p->sourceRefByDict.emplace(sourceRefName.
str(),md);
1206 p->sourceRefsDict.emplace(sourceRefName.
str(),md);
1217 err(
"DefinitionImpl::addInnerCompound() called\n");
1225 if (!
p->qualifiedName.isEmpty())
1227 return p->qualifiedName;
1231 if (
p->outerScope==
nullptr)
1233 if (
p->localName==
"<globalScope>")
1239 return p->localName;
1243 if (
p->outerScope->name()==
"<globalScope>")
1245 p->qualifiedName =
p->localName;
1249 p->qualifiedName =
p->outerScope->qualifiedName()+
1255 return p->qualifiedName;
1265 while (outerScope && !
found)
1267 found = (outerScope==d);
1272 p->qualifiedName.clear();
1276 assert(
p->def!=
p->outerScope);
1281 return p->localName;
1286 p->partOfGroups.push_back(gd);
1291 p->xrefListItems.insert(
p->xrefListItems.end(), sli.cbegin(), sli.cend());
1299 p->xrefListItems.reserve(
p->xrefListItems.size()+otherXrefList.size());
1300 p->xrefListItems.insert (
p->xrefListItems.end(),
1301 otherXrefList.begin(),otherXrefList.end());
1304 std::stable_sort(
p->xrefListItems.begin(),
p->xrefListItems.end(),
1306 { return left->id() <right->id() ||
1307 (left->id()==right->id() &&
1308 left->list()->listName() < right->list()->listName());
1312 auto last = std::unique(
p->xrefListItems.begin(),
p->xrefListItems.end(),
1314 { return left->id()==right->id() &&
1315 left->list()->listName()==right->list()->listName();
1317 p->xrefListItems.erase(last,
p->xrefListItems.end());
1322 for (
const RefItem *item :
p->xrefListItems)
1334 return p->xrefListItems;
1342 result =
p->outerScope->pathFragment();
1344 if (
p->def->isLinkable())
1346 if (!result.
isEmpty()) result+=
"/";
1359 result+=
p->localName;
1364 result+=
p->localName;
1387 result+=(
toFileDef(
p->def))->getDirDef()->navigationPathAsString();
1389 result+=
"<li class=\"navelem\">";
1390 if (
p->def->isLinkableInProject())
1392 QCString fn =
p->def->getOutputFileBase();
1397 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1403 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1409 if (
name.endsWith(
"-p"))
1413 result+=
"<a class=\"el\" href=\"$relpath^"+fn;
1414 if (!
p->def->anchor().isEmpty()) result+=
"#"+
p->def->anchor();
1419 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1438 navPath +=
"<div id=\"nav-path\" class=\"navpath\">\n"
1441 navPath +=
" </ul>\n"
1450 if (
p->sectionRefs.empty())
return;
1458 return p->sectionRefs;
1463 return p->symbolName;
1470 return p->details ?
p->details->doc :
QCString(
"");
1475 return p->details ?
p->details->line :
p->brief ?
p->brief->line : 1;
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 +
">";
1503 int i=scopelessName.
findRev(
"::");
1504 if (i!=-1) scopelessName=scopelessName.
mid(i+2);
1513 for (
const auto &p : briefDescAbbrev)
1524 if (c>=
'a' && c<=
'z') c+=
'A'-
'a';
1537 (abbr ?
abbreviate(
p->brief->doc,
p->def->displayName()) :
p->brief->doc) :
1543 if (
p->brief &&
p->brief->tooltip.isEmpty() && !
p->brief->doc.isEmpty())
1548 p->brief->doc,
p->brief->file,
p->brief->line);
1554 return p->brief ?
p->brief->tooltip :
QCString();
1559 return p->brief ?
p->brief->line : 1;
1564 return p->brief && !
p->brief->file.isEmpty() ?
p->brief->file :
QCString(
"<"+
p->name+
">");
1571 return p->inbodyDocs ?
p->inbodyDocs->doc :
QCString(
"");
1576 return p->inbodyDocs ?
p->inbodyDocs->line : 1;
1581 return p->inbodyDocs && !
p->inbodyDocs->file.isEmpty() ?
p->inbodyDocs->file :
QCString(
"<"+
p->name+
">");
1589 return p->defFileName;
1594 return p->defFileExt;
1604 return p->def->isLinkableInProject() && !
p->hidden;
1609 return p->def->isLinkable() && !
p->hidden;
1614 return p->isArtificial;
1619 return p->isExported;
1629 return !
p->ref.isEmpty();
1634 return p->body ?
p->body->defLine : -1;
1639 return p->body ?
p->body->startLine : -1;
1644 return p->body ?
p->body->endLine : -1;
1649 return p->body ?
p->body->fileDef :
nullptr;
1654 return p->partOfGroups;
1661 if (gd->isLinkable())
return true;
1668 return p->outerScope;
1676 if (
p->referencesMembers.empty() && !
p->sourceRefsDict.empty())
1680 return p->referencesMembers;
1686 if (
p->referencedByMembers.empty() && !
p->sourceRefByDict.empty())
1690 return p->referencedByMembers;
1698 for (
const auto &kv : defImpl->
p->sourceRefsDict)
1700 auto it =
p->sourceRefsDict.find(kv.first);
1701 if (it !=
p->sourceRefsDict.end())
1703 p->sourceRefsDict.insert(kv);
1714 for (
const auto &kv : defImpl->
p->sourceRefByDict)
1716 auto it =
p->sourceRefByDict.find(kv.first);
1717 if (it !=
p->sourceRefByDict.end())
1719 p->sourceRefByDict.emplace(kv.first,kv.second);
1738 p->hidden =
p->hidden || b;
1743 p->isArtificial = b;
1769 return p->symbolName;
1787 size_t l = result.
length();
1788 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
1793 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
1807 return p->isAnonymous;
1817 return p->defColumn;
1874 if (dm==
nullptr)
return nullptr;
1880 if (d==
nullptr)
return nullptr;
static AnchorGenerator & instance()
Returns the singleton instance.
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
DefinitionAliasImpl(Definition *def, const Definition *scope, const Definition *alias)
const Definition * m_scope
const QCString & name() const
QCString qualifiedName() const
virtual ~DefinitionAliasImpl()
The common base class of all entity definitions found in the sources.
virtual const RefItemVector & xrefListItems() const =0
virtual QCString navigationPathAsString() const =0
virtual bool isLinkable() const =0
virtual QCString anchor() const =0
virtual DefinitionMutable * toDefinitionMutable_()=0
virtual const FileDef * getBodyDef() const =0
virtual bool isHidden() const =0
virtual QCString getReference() const =0
virtual void _setSymbolName(const QCString &name)=0
virtual QCString getSourceFileBase() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual int getStartBodyLine() const =0
virtual const DefinitionImpl * toDefinitionImpl_() const =0
virtual const QCString & name() const =0
Private data associated with a Symbol DefinitionImpl object.
MemberVector referencesMembers
std::optional< BriefInfo > brief
std::optional< BodyInfo > body
void init(const QCString &df, const QCString &n)
std::optional< DocInfo > inbodyDocs
MemberVector referencedByMembers
std::unordered_map< std::string, MemberDef * > sourceRefByDict
std::unordered_map< std::string, MemberDef * > sourceRefsDict
RefItemVector xrefListItems
void setDefFileName(const QCString &df)
void setId(const QCString &name)
void setBodySegment(int defLine, int bls, int ble)
void mergeRefItems(Definition *d)
QCString documentation() const
void addSourceReferencedBy(MemberDef *d, const QCString &sourceRefName)
const RefItemVector & xrefListItems() const
void writeSummaryLinks(OutputList &) const
QCString _symbolName() const
QCString getSourceFileBase() const
QCString externalReference(const QCString &relPath) const
void addSectionsToDefinition(const std::vector< const SectionInfo * > &anchorList)
bool isLinkableViaGroup() const
void setDefFile(const QCString &df, int defLine, int defColumn)
const Definition * findInnerCompound(const QCString &name) const
void setName(const QCString &name)
SrcLangExt getLanguage() const
void addInnerCompound(Definition *d)
void setArtificial(bool b)
bool hasSourceReffedBy() const
void _writeSourceRefList(OutputList &ol, const QCString &scopeName, const QCString &text, const std::unordered_map< std::string, MemberDef * > &members, bool) const
void writeNavigationPath(OutputList &ol) const
QCString getDefFileName() const
void writeSourceReffedBy(OutputList &ol, const QCString &scopeName) const
bool _docsAlreadyAdded(const QCString &doc, QCString &sigList)
void _setInbodyDocumentation(const QCString &d, const QCString &docFile, int docLine)
void setRefItems(const RefItemVector &sli)
int getStartBodyLine() const
void setLocalName(const QCString &name)
QCString symbolName() const
void setOuterScope(Definition *d)
void _setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)
QCString qualifiedName() const
const MemberVector & getReferencesMembers() const
void setBodyDef(const FileDef *fd)
void writeInlineCode(OutputList &ol, const QCString &scopeName) const
void setInbodyDocumentation(const QCString &d, const QCString &docFile, int docLine)
bool isArtificial() const
QCString briefDescriptionAsTooltip() const
int _getXRefListId(const QCString &listName) const
QCString inbodyDocumentation() const
QCString getSourceAnchor() const
QCString getDefFileExtension() const
void writeQuickMemberLinks(OutputList &, const MemberDef *) const
const GroupList & partOfGroups() const
void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)
const QCString & name() const
QCString briefFile() const
bool hasUserDocumentation() const
QCString briefDescription(bool abbreviate=FALSE) const
bool hasBriefDescription() const
const SectionRefs & getSectionRefs() const
DefinitionImpl & operator=(const DefinitionImpl &d)
bool isVisibleInProject() const
void writeSourceRefs(OutputList &ol, const QCString &scopeName) const
void makePartOfGroup(GroupDef *gd)
const QCString & localName() const
void mergeReferencedBy(const Definition *other)
int getStartDefLine() const
void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)
void setReference(const QCString &r)
bool hasSourceRefs() const
void writeToc(OutputList &ol, const LocalToc <) const
QCString navigationPathAsString() const
void _setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace, bool atTop)
const FileDef * getBodyDef() const
void writeSourceDef(OutputList &ol) const
void setLanguage(SrcLangExt lang)
void mergeReferences(const Definition *other)
QCString inbodyFile() const
std::unique_ptr< Private > p
bool hasDocumentation() const
Definition * getOuterScope() const
const MemberVector & getReferencedByMembers() const
QCString pathFragment() const
DefinitionImpl(Definition *def, const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
int getEndBodyLine() const
void writeDocAnchorsToTagFile(TextStream &) const
void _setSymbolName(const QCString &name)
QCString getReference() const
void addSourceReferences(MemberDef *d, const QCString &sourceRefName)
virtual Definition * toDefinition_()=0
static ParserManager * parserManager
static NamespaceDefMutable * globalScope
static StringMap tagDestinationMap
static QCString filterDBFileName
static SymbolMap< Definition > * symbolMap
static ClangUsrMap * clangUsrMap
A model of a file symbol.
Minimal replacement for QFileInfo.
void shrinkBuffer(std::string &str, const QCString &fileName, size_t startLine, size_t endLine)
std::vector< size_t > LineOffsets
auto getFragmentLocation(const LineOffsets &lineOffsets, size_t startLine, size_t endLine) -> std::tuple< size_t, size_t >
std::unordered_map< std::string, LineOffsets > m_lineOffsets
bool getFileContentsDisk(const QCString &fileName, size_t startLine, size_t endLine, std::string &str)
static FilterCache & instance()
void readFragmentFromFile(std::string &str, const QCString &fileName, size_t startOffset, size_t size=0)
void compileLineOffsets(const QCString &fileName, const std::string &str)
bool getFileContents(const QCString &fileName, size_t startLine, size_t endLine, std::string &str)
bool getFileContentsPipe(const QCString &fileName, const QCString &filter, size_t startLine, size_t endLine, std::string &str)
std::unordered_map< std::string, FilterCacheItem > m_cache
A model of a group of symbols.
virtual QCString groupTitle() const =0
const T * find(const std::string &key) const
A model of a class/file/namespace member symbol.
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 hasInlineSource() const =0
virtual MemberType memberType() const =0
virtual bool isPrototype() const =0
A vector of MemberDef object.
iterator begin() noexcept
void startCodeFragment(const QCString &style)
Class representing a list of output generators that are written to in parallel.
void writeString(const QCString &text)
const OutputCodeList & codeGenerators() const
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
void docify(const QCString &s)
void startParagraph(const QCString &classDef=QCString())
void pushGeneratorState()
void disableAllBut(OutputType o)
void writeLocalToc(const SectionRefs &refs, const LocalToc <)
void writeNavigationPath(const QCString &s)
void parseText(const QCString &textStr)
virtual QCString title() const =0
This is an alternative implementation of QCString.
int find(char c, int index=0, bool cs=TRUE) const
void fill(char c, int len=-1)
Fills a string with a predefined character.
QCString & prepend(const char *s)
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
void resize(size_t newlen)
const std::string & str() const
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
QCString right(size_t len) const
QCString & sprintf(const char *format,...)
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString left(size_t len) const
This struct represents an item in the list of references.
QCString listName() const
class that provide information about a section.
void setDefinition(Definition *d)
QCString fileName() const
singleton class that owns the list of all sections
SectionInfo * add(const SectionInfo &si)
static SectionManager & instance()
returns a reference to the singleton
class that represents a list of constant references to sections.
constexpr bool isSection() const
Text streaming class that buffers data.
Class representing a regular expression.
Object representing the matching results.
#define Config_getInt(name)
#define Config_getList(name)
#define Config_getBool(name)
std::vector< std::string > StringVector
static std::mutex g_memberReferenceMutex
static void removeFromMap(const QCString &name, Definition *d)
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.
static void addToMap(const QCString &name, Definition *d)
static bool matchExcludedSymbols(const QCString &name)
static QCString abbreviate(const QCString &s, const QCString &name)
Definition * toDefinition(DefinitionMutable *dm)
static MemberVector refMapToVector(const std::unordered_map< std::string, MemberDef * > &map)
static std::recursive_mutex g_qualifiedNameMutex
static bool stripWord(QCString &s, QCString w)
DefinitionMutable * toDefinitionMutable(Definition *d)
DirIterator end(const DirIterator &) noexcept
FileDef * toFileDef(Definition *d)
GroupDef * toGroupDef(Definition *d)
Translator * theTranslator
MemberDef * toMemberDef(Definition *d)
std::ifstream openInputStream(const QCString &name, bool binary=false, bool openAtEnd=false)
FILE * popen(const QCString &name, const QCString &type)
FILE * fopen(const QCString &fileName, const QCString &mode)
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
PageDef * toPageDef(Definition *d)
Portable versions of functions that are platform dependent.
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
std::vector< RefItem * > RefItemVector
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...
Data associated with description found in the body.
int startLine
line number of the start of the definition's body
int endLine
line number of the end of the definition's body
int defLine
line number of the start of the definition
Data associated with a brief description.
Data associated with a detailed description.
SrcLangExt
Language as given by extension.
bool isUTF8CharUpperCase(const std::string &input, size_t pos)
Returns true iff the input string at byte position pos holds an upper case character.
bool lastUTF8CharIsMultibyte(const std::string &input)
Returns true iff the last character in input is a multibyte character.
Various UTF8 related helper functions.
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
QCString convertToHtml(const QCString &s, bool keepEntities)
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
bool transcodeCharacterStringToUTF8(std::string &input, const char *inputEncoding)
QCString stripScope(const QCString &name)
int computeQualifiedIndex(const QCString &name)
Return the index of the last :: in the string name that is still before the first <.
QCString convertToXML(const QCString &s, bool keepEntities)
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
QCString getEncoding(const FileInfo &fi)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
QCString getFileFilter(const QCString &name, bool isSourceCode)
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
void addHtmlExtensionIfMissing(QCString &fName)
A bunch of utility functions.