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>();
504 if (!
p->inbodyDocs.has_value())
506 p->inbodyDocs = std::make_optional<DocInfo>();
508 DocInfo &inbodyDocs =
p->inbodyDocs.value();
511 inbodyDocs.
doc = doc;
551 bool usePipe = !filter.
isEmpty() && filterSourceFiles;
557 size_t startLine,
size_t endLine,std::string &str)
559 std::unique_lock<std::mutex> lock(
m_mutex);
564 auto item = it->second;
572 auto [ startLineOffset, fragmentSize] =
getFragmentLocation(it_off->second,startLine,endLine);
576 item.filePos+startLineOffset, fragmentSize);
583 QCString cmd=filter+
" \""+fileName+
"\"";
589 err(
"Error opening filter pipe command '%s'\n",
qPrint(cmd));
606 const int blockSize = 4096;
608 size_t bytesRead = fread(buf,1,blockSize,f);
609 size_t bytesWritten = fwrite(buf,1,bytesRead,bf);
610 if (bytesRead!=bytesWritten)
613 err(
"Failed to write to filter database %s. Wrote %zu out of %zu bytes\n",
620 str+=std::string_view(buf,bytesWritten);
624 m_cache.emplace(fileName.str(),item);
642 std::unique_lock<std::mutex> lock(
m_mutex);
670 const char *p=str.data();
674 while ((c=*p)!=
'\n' && c!=0) p++;
676 it->second.push_back(p-str.data());
683 size_t startLine,
size_t endLine) -> std::tuple<size_t,size_t>
685 assert(startLine > 0);
686 assert(startLine <= endLine);
687 const size_t startLineOffset = lineOffsets[std::min(startLine-1,lineOffsets.size()-1)];
688 const size_t endLineOffset = lineOffsets[std::min(endLine, lineOffsets.size()-1)];
689 assert(startLineOffset <= endLineOffset);
690 const size_t fragmentSize = endLineOffset-startLineOffset;
691 return std::tie(startLineOffset,fragmentSize);
703 auto [ startLineOffset, fragmentSize] =
getFragmentLocation(lineOffsets,startLine,endLine);
706 str.erase(0,startLineOffset);
707 str.resize(fragmentSize);
716 if (size==0) { startOffset=0; size =
static_cast<size_t>(ifs.tellg()); }
717 ifs.seekg(startOffset, std::ios::beg);
719 ifs.read(str.data(), size);
723 std::unordered_map<std::string,FilterCacheItem>
m_cache;
750 int &startLine,
int &endLine,
QCString &result)
754 bool usePipe = !filter.
isEmpty() && filterSourceFiles;
757 const int blockSize = 4096;
760 static_cast<size_t>(std::max(1,startLine)),
761 static_cast<size_t>(std::max({1,startLine,endLine})),str);
774 int lineNr=startLine;
780 while ((c=*p++)!=
'{' && c!=
':' && c!=0)
789 col+=tabSize - (col%tabSize);
791 else if (pc==
'/' && c==
'/')
793 while ((c=*p++)!=
'\n' && c!=0);
794 if (c==
'\n') lineNr++,col=0;
796 else if (pc==
'/' && c==
'*')
798 while (((c=*p++)!=
'/' || pc!=
'*') && c!=0)
800 if (c==
'\n') lineNr++,col=0;
830 if (endLine!=startLine)
833 spaces.
fill(
' ',col);
842 if (cn==
'\n') lineNr++;
844 char lineStr[blockSize];
853 while ((c=*p) && i<blockSize-1)
862 }
while (size_read == (blockSize-1));
867 int newLineIndex = result.
findRev(
'\n');
868 int braceIndex = result.
findRev(
'}');
869 if (braceIndex > newLineIndex)
871 result.
resize(
static_cast<size_t>(braceIndex+1));
882 if (encoding!=
"UTF-8")
884 std::string encBuf = result.
str();
892 err(
"failed to transcode characters in code fragment in file %s lines %d to %d, from input encoding %s to UTF-8\n",
897 if (!result.
isEmpty() && result.
at(result.
length()-1)!=
'\n') result +=
"\n";
908 p->body &&
p->body->startLine!=-1 &&
p->body->fileDef)
910 fn =
p->body->fileDef->getSourceFileBase();
917 const int maxAnchorStrLen = 20;
918 char anchorStr[maxAnchorStrLen];
920 if (
p->body &&
p->body->startLine!=-1)
924 qsnprintf(anchorStr,maxAnchorStrLen,
"L%d",
p->body->defLine);
928 qsnprintf(anchorStr,maxAnchorStrLen,
"l%05d",
p->body->defLine);
942 int lineMarkerPos = refText.
find(
"@0");
943 int fileMarkerPos = refText.
find(
"@1");
944 if (lineMarkerPos!=-1 && fileMarkerPos!=-1)
947 lineStr.
sprintf(
"%d",
p->body->defLine);
950 if (lineMarkerPos<fileMarkerPos)
956 ol.
parseText(refText.
mid(lineMarkerPos+2,fileMarkerPos-lineMarkerPos-2));
969 ol.
parseText(refText.
mid(fileMarkerPos+2,lineMarkerPos-fileMarkerPos-2));
979 err(
"translation error: invalid markers in trDefinedAtLineInSourceFile()\n");
986 if (!
p->body.has_value())
988 p->body = std::make_optional<BodyInfo>();
998 if (!
p->body.has_value())
1000 p->body = std::make_optional<BodyInfo>();
1002 p->body.value().fileDef=fd;
1007 return p->body &&
p->body->startLine!=-1 &&
1008 p->body->endLine>=
p->body->startLine &&
1028 int actualStart=
p->body->startLine,actualEnd=
p->body->endLine;
1030 actualStart,actualEnd,codeFragment)
1036 intf->resetCodeParserState();
1041 intf->parseCode(codeOL,
1055 codeOL.endCodeFragment(
"DoxyCode");
1065 std::transform(map.begin(),map.end(),
1066 std::back_inserter(result),
1067 [](
const auto &item)
1068 { return item.second; }
1071 std::stable_sort(result.
begin(),result.
end(),
1072 [](
const auto &m1,
const auto &m2) { return genericCompareMembers(m1,m2)<0; });
1080 const QCString &text,
const std::unordered_map<std::string,MemberDef *> &membersMap,
1083 if (!membersMap.empty())
1087 auto replaceFunc = [
this,&members,scopeName,&ol](
size_t entryIndex)
1091 const MemberDef *md=members[entryIndex];
1097 if (!scope.
isEmpty() && scope!=scopeName)
1109 if (sourceBrowser &&
1115 const int maxLineNrStr = 10;
1116 char anchorStr[maxLineNrStr];
1138 theTranslator->trWriteList(
static_cast<int>(members.size())).str(),
1159 return !
p->sourceRefByDict.empty();
1164 return !
p->sourceRefsDict.empty();
1172 (
p->details && !
p->details->doc.isEmpty()) ||
1173 (
p->brief && !
p->brief->doc.isEmpty()) ||
1174 (
p->inbodyDocs && !
p->inbodyDocs->doc.isEmpty()) ||
1185 (
p->details && !
p->details->doc.isEmpty()) ||
1186 (
p->brief && !
p->brief->doc.isEmpty()) ||
1187 (
p->inbodyDocs && !
p->inbodyDocs->doc.isEmpty());
1195 p->sourceRefByDict.emplace(sourceRefName.
str(),md);
1203 p->sourceRefsDict.emplace(sourceRefName.
str(),md);
1214 err(
"DefinitionImpl::addInnerCompound() called\n");
1222 if (!
p->qualifiedName.isEmpty())
1224 return p->qualifiedName;
1228 if (
p->outerScope==
nullptr)
1230 if (
p->localName==
"<globalScope>")
1236 return p->localName;
1240 if (
p->outerScope->name()==
"<globalScope>")
1242 p->qualifiedName =
p->localName;
1246 p->qualifiedName =
p->outerScope->qualifiedName()+
1252 return p->qualifiedName;
1262 while (outerScope && !
found)
1264 found = (outerScope==d);
1269 p->qualifiedName.clear();
1273 assert(
p->def!=
p->outerScope);
1278 return p->localName;
1283 p->partOfGroups.push_back(gd);
1288 p->xrefListItems.insert(
p->xrefListItems.end(), sli.cbegin(), sli.cend());
1296 p->xrefListItems.reserve(
p->xrefListItems.size()+otherXrefList.size());
1297 p->xrefListItems.insert (
p->xrefListItems.end(),
1298 otherXrefList.begin(),otherXrefList.end());
1301 std::stable_sort(
p->xrefListItems.begin(),
p->xrefListItems.end(),
1303 { return left->id() <right->id() ||
1304 (left->id()==right->id() &&
1305 left->list()->listName() < right->list()->listName());
1309 auto last = std::unique(
p->xrefListItems.begin(),
p->xrefListItems.end(),
1311 { return left->id()==right->id() &&
1312 left->list()->listName()==right->list()->listName();
1314 p->xrefListItems.erase(last,
p->xrefListItems.end());
1319 for (
const RefItem *item :
p->xrefListItems)
1331 return p->xrefListItems;
1339 result =
p->outerScope->pathFragment();
1341 if (
p->def->isLinkable())
1343 if (!result.
isEmpty()) result+=
"/";
1356 result+=
p->localName;
1361 result+=
p->localName;
1384 result+=(
toFileDef(
p->def))->getDirDef()->navigationPathAsString();
1386 result+=
"<li class=\"navelem\">";
1387 if (
p->def->isLinkableInProject())
1389 QCString fn =
p->def->getOutputFileBase();
1394 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1400 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1406 if (
name.endsWith(
"-p"))
1410 result+=
"<a class=\"el\" href=\"$relpath^"+fn;
1411 if (!
p->def->anchor().isEmpty()) result+=
"#"+
p->def->anchor();
1416 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1435 navPath +=
"<div id=\"nav-path\" class=\"navpath\">\n"
1438 navPath +=
" </ul>\n"
1447 if (
p->sectionRefs.empty())
return;
1455 return p->sectionRefs;
1460 return p->symbolName;
1467 return p->details ?
p->details->doc :
QCString(
"");
1472 return p->details ?
p->details->line :
p->brief ?
p->brief->line : 1;
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 +
">";
1500 int i=scopelessName.
findRev(
"::");
1501 if (i!=-1) scopelessName=scopelessName.
mid(i+2);
1510 for (
const auto &p : briefDescAbbrev)
1521 if (c>=
'a' && c<=
'z') c+=
'A'-
'a';
1534 (abbr ?
abbreviate(
p->brief->doc,
p->def->displayName()) :
p->brief->doc) :
1540 if (
p->brief &&
p->brief->tooltip.isEmpty() && !
p->brief->doc.isEmpty())
1545 p->brief->doc,
p->brief->file,
p->brief->line);
1551 return p->brief ?
p->brief->tooltip :
QCString();
1556 return p->brief ?
p->brief->line : 1;
1561 return p->brief && !
p->brief->file.isEmpty() ?
p->brief->file :
QCString(
"<"+
p->name+
">");
1568 return p->inbodyDocs ?
p->inbodyDocs->doc :
QCString(
"");
1573 return p->inbodyDocs ?
p->inbodyDocs->line : 1;
1578 return p->inbodyDocs && !
p->inbodyDocs->file.isEmpty() ?
p->inbodyDocs->file :
QCString(
"<"+
p->name+
">");
1586 return p->defFileName;
1591 return p->defFileExt;
1601 return p->def->isLinkableInProject() && !
p->hidden;
1606 return p->def->isLinkable() && !
p->hidden;
1611 return p->isArtificial;
1616 return p->isExported;
1626 return !
p->ref.isEmpty();
1631 return p->body ?
p->body->defLine : -1;
1636 return p->body ?
p->body->startLine : -1;
1641 return p->body ?
p->body->endLine : -1;
1646 return p->body ?
p->body->fileDef :
nullptr;
1651 return p->partOfGroups;
1658 if (gd->isLinkable())
return true;
1665 return p->outerScope;
1673 if (
p->referencesMembers.empty() && !
p->sourceRefsDict.empty())
1677 return p->referencesMembers;
1683 if (
p->referencedByMembers.empty() && !
p->sourceRefByDict.empty())
1687 return p->referencedByMembers;
1695 for (
const auto &kv : defImpl->
p->sourceRefsDict)
1697 auto it =
p->sourceRefsDict.find(kv.first);
1698 if (it !=
p->sourceRefsDict.end())
1700 p->sourceRefsDict.insert(kv);
1711 for (
const auto &kv : defImpl->
p->sourceRefByDict)
1713 auto it =
p->sourceRefByDict.find(kv.first);
1714 if (it !=
p->sourceRefByDict.end())
1716 p->sourceRefByDict.emplace(kv.first,kv.second);
1735 p->hidden =
p->hidden || b;
1740 p->isArtificial = b;
1766 return p->symbolName;
1784 size_t l = result.
length();
1785 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
1790 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
1804 return p->isAnonymous;
1814 return p->defColumn;
1871 if (dm==
nullptr)
return nullptr;
1877 if (d==
nullptr)
return nullptr;
static AnchorGenerator & instance()
Returns the singleton instance.
static void print(DebugMask mask, int prio, const char *fmt,...)
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)
Shrinks buffer str which should hold the contents of fileName to the fragment starting a line startLi...
std::vector< size_t > LineOffsets
auto getFragmentLocation(const LineOffsets &lineOffsets, size_t startLine, size_t endLine) -> std::tuple< size_t, size_t >
Returns the byte offset and size within a file of a fragment given the array of line offsets and the ...
std::unordered_map< std::string, LineOffsets > m_lineOffsets
bool getFileContentsDisk(const QCString &fileName, size_t startLine, size_t endLine, std::string &str)
reads the fragment start at startLine and ending at endLine from file fileName into buffer str
static FilterCache & instance()
void readFragmentFromFile(std::string &str, const QCString &fileName, size_t startOffset, size_t size=0)
Reads the fragment start at byte offset startOffset of file fileName into buffer str.
void compileLineOffsets(const QCString &fileName, const std::string &str)
computes the starting offset for each line for file fileName, whose contents should already be stored...
bool getFileContents(const QCString &fileName, size_t startLine, size_t endLine, std::string &str)
collects the part of file fileName starting at startLine and ending at endLine into buffer 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
Find an object given the key.
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)
Add a new section given the data of an existing section.
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
const char * qPrint(const char *s)
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.