18#include <unordered_map>
62 using std::unique_ptr<T>::unique_ptr;
64 : std::unique_ptr<T>(other ? new T(*other) : nullptr)
69 if (*
this!=other) this->reset(other ?
new T(*other) :
nullptr);
75 std::unique_ptr<T>::operator=(std::move(other));
82template<
typename T,
typename... Args>
92 void init(
const QCString &df,
const QCString &n);
95 Definition *
def =
nullptr;
107 DeepCopyUniquePtr<BodyInfo>
body;
156 if (lname!=
"<globalScope>")
171 sourceRefByDict.
clear();
172 sourceRefsDict.clear();
182 m_impl->setDefFileName(df);
183 m_impl->defLine = defLine;
184 m_impl->defColumn = defCol;
192 if (exclSyms.empty())
return FALSE;
193 std::string symName =
name.str();
194 for (
const auto &pat : exclSyms)
196 QCString pattern = pat.c_str();
197 bool forceStart=
FALSE;
199 if (pattern.
at(0)==
'^')
200 pattern=pattern.
mid(1),forceStart=
TRUE;
201 if (pattern.
at(pattern.
length()-1)==
'$')
203 if (pattern.
find(
'*')!=-1)
205 const reg::Ex re(
substitute(pattern,
"*",
".*").str());
209 size_t ui = match.position();
210 size_t pl = match.length();
211 size_t sl = symName.length();
212 if ((ui==0 || pattern.
at(0)==
'*' || (!
isId(symName.at(ui-1)) && !forceStart)) &&
213 (ui+pl==sl || pattern.
at(pattern.
length()-1)==
'*' || (!
isId(symName.at(ui+pl)) && !forceEnd))
223 size_t i = symName.find(pattern.
str());
224 if (i!=std::string::npos)
227 size_t pl=pattern.
length();
228 size_t sl=symName.length();
230 if ((ui==0 || (!
isId(symName.at(ui-1)) && !forceStart)) &&
231 (ui+pl==sl || (!
isId(symName.at(ui+pl)) && !forceEnd))
265 const QCString &df,
int dl,
int dc,
266 const QCString &
name,
const char *b,
267 const char *d,
bool isSymbol)
275 m_impl->isSymbol = isSymbol;
295 m_impl = std::make_unique<DefinitionImpl::IMPL>(*other.
m_impl);
310 if (
name.isEmpty())
return;
313 m_impl->name.at(0)==
'@' ||
314 m_impl->name.find(
"::@")!=-1;
319 if (
id.isEmpty())
return;
336 for (
const SectionInfo *si : anchorList)
341 SectionInfo *gsi=sm.
find(si->label());
347 if (
m_impl->sectionRefs.find(gsi->
label())==
nullptr)
349 m_impl->sectionRefs.add(gsi);
360 for (
const SectionInfo *si :
m_impl->sectionRefs)
372 if (!
m_impl->sectionRefs.empty())
375 for (
const SectionInfo *si :
m_impl->sectionRefs)
383 tagFile <<
" <docanchor file=\"" << fn <<
"\"";
388 tagFile <<
">" << si->
label() <<
"</docanchor>\n";
401 MD5Buffer(docStr.
data(),
static_cast<unsigned int>(docStr.
length()),md5_sig);
402 MD5SigToString(md5_sig,sigStr);
405 if (sigList.
find(sigStr)==-1)
407 sigList+=QCString(
":")+sigStr;
437 if (
m_impl->details->doc.isEmpty())
439 m_impl->details->doc = doc;
447 m_impl->details->doc +=
"\n\n"+doc;
457 m_impl->details->line = 1;
475 size_t bl = brief.
length();
480 int c = brief.
at(bl-1);
483 case '.':
case '!':
case '?':
case '>':
case ':':
case ')':
break;
536 if (
m_impl->inbodyDocs->doc.isEmpty())
538 m_impl->inbodyDocs->doc = doc;
544 m_impl->inbodyDocs->doc += QCString(
"\n\n")+doc;
574 bool getFileContents(
const QCString &fileName,
size_t startLine,
size_t endLine, std::string &str)
578 bool usePipe = !filter.
isEmpty() && filterSourceFiles;
584 size_t startLine,
size_t endLine,std::string &str)
586 std::unique_lock<std::mutex> lock(
m_mutex);
591 auto item = it->second;
599 auto [ startLineOffset, fragmentSize] =
getFragmentLocation(it_off->second,startLine,endLine);
603 item.filePos+startLineOffset, fragmentSize);
610 QCString cmd=filter+
" \""+fileName+
"\"";
616 err(
"Error opening filter pipe command '%s'\n",
qPrint(cmd));
633 const int blockSize = 4096;
635 size_t bytesRead = fread(buf,1,blockSize,f);
636 size_t bytesWritten = fwrite(buf,1,bytesRead,bf);
637 if (bytesRead!=bytesWritten)
640 err(
"Failed to write to filter database %s. Wrote %zu out of %zu bytes\n",
647 str+=std::string_view(buf,bytesWritten);
651 m_cache.emplace(fileName.str(),item);
669 std::unique_lock<std::mutex> lock(
m_mutex);
697 const char *p=str.data();
701 while ((c=*p)!=
'\n' && c!=0) p++;
703 it->second.push_back(p-str.data());
710 size_t startLine,
size_t endLine) -> std::tuple<size_t,size_t>
712 assert(startLine > 0);
713 assert(startLine <= endLine);
714 const size_t startLineOffset = lineOffsets[std::min(startLine-1,lineOffsets.size()-1)];
715 const size_t endLineOffset = lineOffsets[std::min(endLine, lineOffsets.size()-1)];
716 assert(startLineOffset <= endLineOffset);
717 const size_t fragmentSize = endLineOffset-startLineOffset;
718 return std::tie(startLineOffset,fragmentSize);
723 void shrinkBuffer(std::string &str,
const QCString &fileName,
size_t startLine,
size_t endLine)
730 auto [ startLineOffset, fragmentSize] =
getFragmentLocation(lineOffsets,startLine,endLine);
733 str.erase(0,startLineOffset);
734 str.resize(fragmentSize);
743 if (size==0) { startOffset=0; size =
static_cast<size_t>(ifs.tellg()); }
744 ifs.seekg(startOffset, std::ios::beg);
746 ifs.read(str.data(), size);
750 std::unordered_map<std::string,FilterCacheItem>
m_cache;
777 int &startLine,
int &endLine,
QCString &result)
781 bool usePipe = !filter.
isEmpty() && filterSourceFiles;
784 const int blockSize = 4096;
787 static_cast<size_t>(std::max(1,startLine)),
788 static_cast<size_t>(std::max({1,startLine,endLine})),str);
801 int lineNr=startLine;
807 while ((c=*p++)!=
'{' && c!=
':' && c!=0)
816 col+=tabSize - (col%tabSize);
818 else if (pc==
'/' && c==
'/')
820 while ((c=*p++)!=
'\n' && c!=0);
821 if (c==
'\n') lineNr++,col=0;
823 else if (pc==
'/' && c==
'*')
825 while (((c=*p++)!=
'/' || pc!=
'*') && c!=0)
827 if (c==
'\n') lineNr++,col=0;
857 if (endLine!=startLine)
860 spaces.
fill(
' ',col);
869 if (cn==
'\n') lineNr++;
871 char lineStr[blockSize];
880 while ((c=*p) && i<blockSize-1)
889 }
while (size_read == (blockSize-1));
894 int newLineIndex = result.
findRev(
'\n');
895 int braceIndex = result.
findRev(
'}');
896 if (braceIndex > newLineIndex)
898 result.
resize(
static_cast<size_t>(braceIndex+1));
909 if (encoding!=
"UTF-8")
911 std::string encBuf = result.
str();
919 err(
"failed to transcode characters in code fragment in file %s lines %d to %d, from input encoding %s to UTF-8\n",
924 if (!result.
isEmpty() && result.
at(result.
length()-1)!=
'\n') result +=
"\n";
937 fn =
m_impl->body->fileDef->getSourceFileBase();
944 const int maxAnchorStrLen = 20;
945 char anchorStr[maxAnchorStrLen];
969 int lineMarkerPos = refText.
find(
"@0");
970 int fileMarkerPos = refText.
find(
"@1");
971 if (lineMarkerPos!=-1 && fileMarkerPos!=-1)
977 if (lineMarkerPos<fileMarkerPos)
983 ol.
parseText(refText.
mid(lineMarkerPos+2,fileMarkerPos-lineMarkerPos-2));
996 ol.
parseText(refText.
mid(fileMarkerPos+2,lineMarkerPos-fileMarkerPos-2));
1006 err(
"translation error: invalid markers in trDefinedAtLineInSourceFile()\n");
1014 m_impl->body->defLine = defLine;
1015 m_impl->body->startLine = bls;
1016 m_impl->body->endLine = ble;
1022 m_impl->body->fileDef=fd;
1035 const MemberDef *thisMd =
nullptr;
1046 QCString codeFragment;
1048 int actualStart=
m_impl->body->startLine,actualEnd=
m_impl->body->endLine;
1050 actualStart,actualEnd,codeFragment)
1056 intf->resetCodeParserState();
1061 intf->parseCode(codeOL,
1075 codeOL.endCodeFragment(
"DoxyCode");
1085 std::transform(map.begin(),map.end(),
1086 std::back_inserter(result),
1087 [](
const auto &item)
1088 { return item.second; }
1091 std::stable_sort(result.
begin(),result.
end(),
1092 [](
const auto &m1,
const auto &m2) { return genericCompareMembers(m1,m2)<0; });
1100 const QCString &text,
const std::unordered_map<std::string,MemberDef *> &membersMap,
1103 if (!membersMap.empty())
1107 auto replaceFunc = [
this,&members,scopeName,&ol](
size_t entryIndex)
1111 const MemberDef *md=members[entryIndex];
1117 if (!scope.
isEmpty() && scope!=scopeName)
1129 if (sourceBrowser &&
1135 const int maxLineNrStr = 10;
1136 char anchorStr[maxLineNrStr];
1179 return !
m_impl->sourceRefByDict.empty();
1184 return !
m_impl->sourceRefsDict.empty();
1192 (
m_impl->details && !
m_impl->details->doc.isEmpty()) ||
1194 (
m_impl->inbodyDocs && !
m_impl->inbodyDocs->doc.isEmpty()) ||
1205 (
m_impl->details && !
m_impl->details->doc.isEmpty()) ||
1207 (
m_impl->inbodyDocs && !
m_impl->inbodyDocs->doc.isEmpty());
1215 m_impl->sourceRefByDict.emplace(sourceRefName.
str(),md);
1223 m_impl->sourceRefsDict.emplace(sourceRefName.
str(),md);
1234 err(
"DefinitionImpl::addInnerCompound() called\n");
1242 if (!
m_impl->qualifiedName.isEmpty())
1244 return m_impl->qualifiedName;
1248 if (
m_impl->outerScope==
nullptr)
1250 if (
m_impl->localName==
"<globalScope>")
1256 return m_impl->localName;
1260 if (
m_impl->outerScope->name()==
"<globalScope>")
1266 m_impl->qualifiedName =
m_impl->outerScope->qualifiedName()+
1272 return m_impl->qualifiedName;
1279 Definition *p =
m_impl->outerScope;
1289 m_impl->qualifiedName.clear();
1298 return m_impl->localName;
1303 m_impl->partOfGroups.push_back(gd);
1308 m_impl->xrefListItems.insert(
m_impl->xrefListItems.end(), sli.cbegin(), sli.cend());
1316 m_impl->xrefListItems.reserve(
m_impl->xrefListItems.size()+otherXrefList.size());
1317 m_impl->xrefListItems.insert (
m_impl->xrefListItems.end(),
1318 otherXrefList.begin(),otherXrefList.end());
1321 std::stable_sort(
m_impl->xrefListItems.begin(),
m_impl->xrefListItems.end(),
1322 [](RefItem *left,RefItem *right)
1323 { return left->id() <right->id() ||
1324 (left->id()==right->id() &&
1325 left->list()->listName() < right->list()->listName());
1329 auto last = std::unique(
m_impl->xrefListItems.begin(),
m_impl->xrefListItems.end(),
1330 [](
const RefItem *left,
const RefItem *right)
1331 { return left->id()==right->id() &&
1332 left->list()->listName()==right->list()->listName();
1334 m_impl->xrefListItems.erase(last,
m_impl->xrefListItems.end());
1339 for (
const RefItem *item :
m_impl->xrefListItems)
1351 return m_impl->xrefListItems;
1359 result =
m_impl->outerScope->pathFragment();
1361 if (
m_impl->def->isLinkable())
1363 if (!result.
isEmpty()) result+=
"/";
1376 result+=
m_impl->localName;
1381 result+=
m_impl->localName;
1404 result+=(
toFileDef(
m_impl->def))->getDirDef()->navigationPathAsString();
1406 result+=
"<li class=\"navelem\">";
1407 if (
m_impl->def->isLinkableInProject())
1409 QCString fn =
m_impl->def->getOutputFileBase();
1414 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1420 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1425 QCString
name = locName;
1426 if (
name.endsWith(
"-p"))
1430 result+=
"<a class=\"el\" href=\"$relpath^"+fn;
1431 if (!
m_impl->def->anchor().isEmpty()) result+=
"#"+
m_impl->def->anchor();
1436 result+=
"<a class=\"el\" href=\"$relpath^"+fn+
"\">"+
1455 navPath +=
"<div id=\"nav-path\" class=\"navpath\">\n"
1458 navPath +=
" </ul>\n"
1467 if (
m_impl->sectionRefs.empty())
return;
1475 return m_impl->sectionRefs;
1480 return m_impl->symbolName;
1487 return m_impl->details ?
m_impl->details->doc : QCString(
"");
1497 if (
m_impl->details && !
m_impl->details->file.isEmpty())
return m_impl->details->file;
1498 else if (
m_impl->brief && !
m_impl->brief->file.isEmpty())
return m_impl->brief->file;
1499 else return "<" +
m_impl->name +
">";
1520 int i=scopelessName.
findRev(
"::");
1521 if (i!=-1) scopelessName=scopelessName.
mid(i+2);
1530 for (
const auto &p : briefDescAbbrev)
1541 if (c>=
'a' && c<=
'z') c+=
'A'-
'a';
1560 if (
m_impl->brief &&
m_impl->brief->tooltip.isEmpty() && !
m_impl->brief->doc.isEmpty())
1571 return m_impl->brief ?
m_impl->brief->tooltip : QCString();
1588 return m_impl->inbodyDocs ?
m_impl->inbodyDocs->doc : QCString(
"");
1593 return m_impl->inbodyDocs ?
m_impl->inbodyDocs->line : 1;
1598 return m_impl->inbodyDocs && !
m_impl->inbodyDocs->file.isEmpty() ?
m_impl->inbodyDocs->file : QCString(
"<"+
m_impl->name+
">");
1606 return m_impl->defFileName;
1611 return m_impl->defFileExt;
1621 return m_impl->def->isLinkableInProject() && !
m_impl->hidden;
1631 return m_impl->isArtificial;
1636 return m_impl->isExported;
1646 return !
m_impl->ref.isEmpty();
1671 return m_impl->partOfGroups;
1678 if (gd->isLinkable())
return true;
1685 return m_impl->outerScope;
1693 if (
m_impl->referencesMembers.empty() && !
m_impl->sourceRefsDict.empty())
1697 return m_impl->referencesMembers;
1703 if (
m_impl->referencedByMembers.empty() && !
m_impl->sourceRefByDict.empty())
1707 return m_impl->referencedByMembers;
1715 for (
const auto &kv : defImpl->
m_impl->sourceRefsDict)
1717 auto it =
m_impl->sourceRefsDict.find(kv.first);
1718 if (it !=
m_impl->sourceRefsDict.end())
1720 m_impl->sourceRefsDict.insert(kv);
1731 for (
const auto &kv : defImpl->
m_impl->sourceRefByDict)
1733 auto it =
m_impl->sourceRefByDict.find(kv.first);
1734 if (it !=
m_impl->sourceRefByDict.end())
1736 m_impl->sourceRefByDict.emplace(kv.first,kv.second);
1760 m_impl->isArtificial = b;
1786 return m_impl->symbolName;
1803 QCString result(it->second);
1804 size_t l = result.
length();
1805 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
1810 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
1824 return m_impl->isAnonymous;
1834 return m_impl->defColumn;
1891 if (dm==
nullptr)
return nullptr;
1897 if (d==
nullptr)
return nullptr;
bool isGenerated(const std::string &anchor) const
Returns true iff anchor is one of the generated anchors.
static AnchorGenerator & instance()
Returns the singleton instance.
static void print(DebugMask mask, int prio, const char *fmt,...)
Helper class add copy/assignment support to std::unique_ptr by making a deep copy Note that T may not...
DeepCopyUniquePtr & operator=(const DeepCopyUniquePtr &other)
~DeepCopyUniquePtr()=default
DeepCopyUniquePtr(const DeepCopyUniquePtr &other)
DeepCopyUniquePtr(DeepCopyUniquePtr &&other)
DeepCopyUniquePtr & operator=(DeepCopyUniquePtr &&other)
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.
std::unordered_map< std::string, MemberDef * > sourceRefsDict
DeepCopyUniquePtr< BodyInfo > body
MemberVector referencedByMembers
DeepCopyUniquePtr< DocInfo > inbodyDocs
DeepCopyUniquePtr< DocInfo > details
std::unordered_map< std::string, MemberDef * > sourceRefByDict
void setDefFileName(const QCString &df)
DeepCopyUniquePtr< BriefInfo > brief
void init(const QCString &df, const QCString &n)
MemberVector referencesMembers
RefItemVector xrefListItems
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)
std::unique_ptr< IMPL > m_impl
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
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.
virtual DirDef * getDirDef() const =0
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 bool hasTitle() const =0
virtual QCString title() const =0
std::unique_ptr< CodeParserInterface > getCodeParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
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
QCString listName() const
void setDefinition(Definition *d)
QCString fileName() const
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
void remove(const QCString &name, Ptr def)
Remove a symbol def from the map that was stored under key name.
void add(const QCString &name, Ptr def)
Add a symbol def into the map under key name.
Text streaming class that buffers data.
virtual QCString trWriteList(int numEntries)=0
virtual QCString trReferencedBy()=0
virtual QCString trReferences()=0
virtual bool needsPunctuation()
add punctuation at the end of a brief description when needed and supported by the language
virtual QCString trDefinedAtLineInSourceFile()=0
#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)
DeepCopyUniquePtr< T > make_DeepCopyUnique(Args &&... args)
Helper to create an object wrapped in a DeepCopyUniquePtr.
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...
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.