116 enum class Kind {
None=-1,
Class,
Struct,
Union,
Interface,
Exception,
Protocol,
Category,
Enum,
Service,
Singleton };
253 std::unique_ptr<R> *p = std::get_if<std::unique_ptr<R>>(&
m_variant);
254 return p ? p->get() :
nullptr;
260 const std::unique_ptr<R> *p = std::get_if<std::unique_ptr<R>>(&
m_variant);
261 return p ? p->get() :
nullptr;
265 template<
class R,
typename... Args>
344 void endElement(
const QCString &name );
352 void buildLists(
const std::shared_ptr<Entry> &root);
372 p_warn(
"tag 'compound' was not expected!");
385 if (protStr==
"protected")
389 else if (protStr==
"private")
393 if (virtStr==
"virtual")
397 else if (virtStr==
"pure")
401 if (staticStr==
"yes")
429 p_warn(
"Unexpected tag 'member' found");
448 p_warn(
"Found 'enumvalue' tag outside of member tag");
482 p_warn(
"Unexpected tag 'docanchor' found");
546 p_warn(
"Unexpected tag 'class' found");
574 p_warn(
"Unexpected tag 'concept' found");
590 p_warn(
"Unexpected tag 'module' found");
618 p_warn(
"Unexpected tag 'namespace' found");
640 p_warn(
"Unexpected tag 'file' found");
656 p_warn(
"Unexpected tag 'page' found");
672 p_warn(
"Unexpected tag 'subpage' found");
688 p_warn(
"Unexpected tag 'dir' found");
713 p_warn(
"Unexpected tag 'type' found");
739 p_warn(
"Unexpected tag 'name' found");
754 if (protStr==
"protected")
758 else if (protStr==
"private")
762 if (virtStr==
"virtual")
770 p_warn(
"Unexpected tag 'base' found");
783 p_warn(
"Unexpected tag 'base' found");
809 p_warn(
"Unexpected tag 'includes' found");
822 p_warn(
"Unexpected tag 'templarg' found");
845 p_warn(
"Unexpected tag 'filename' found");
867 p_warn(
"Unexpected tag 'path' found");
885 p_warn(
"Unexpected tag 'anchor' found");
907 p_warn(
"Unexpected tag 'clangid' found");
921 p_warn(
"Unexpected tag 'anchorfile' found");
933 p_warn(
"Unexpected tag 'arglist' found");
954 p_warn(
"Unexpected tag 'title' found");
968 p_warn(
"Unexpected tag 'subgroup' found");
980 void buildMemberList(
const std::shared_ptr<Entry> &ce,
const std::vector<TagMemberInfo> &members);
981 void addDocAnchors(
const std::shared_ptr<Entry> &e,
const std::vector<TagAnchorInfo> &l);
1124 it->second.startCb(*
this,attrib);
1138 it->second.endCb(*
this);
1162 p_warn(
"Unknown compound attribute '%s' found!",kind.c_str());
1167 if (isObjC==
"yes" && classInfo)
1190 for (
const auto &md : cd->
members)
1236 for (
const auto &md : nd->
members)
1265 for (
const auto &md : fd->
members)
1274 for (
const auto &ii : fd->
includes)
1298 for (
const auto &fi : gd->
fileList)
1306 for (
const auto &pg : gd->
pageList)
1311 for (
const auto &md : gd->
members)
1343 for (
const auto &fi : dd->
fileList)
1359 for (
const auto &ta : l)
1366 ta.label,ta.fileName,-1,ta.title,
1368 e->anchors.push_back(si);
1375 ta.label,ta.fileName,-1,ta.title,
1383 for (
const auto &tmi : members)
1385 std::shared_ptr<Entry> me = std::make_shared<Entry>();
1386 me->type = tmi.type;
1387 me->name = tmi.name;
1388 me->args = tmi.arglist;
1389 if (!me->args.isEmpty())
1393 if (tmi.enumValues.size()>0)
1395 me->spec.setStrong(
true);
1396 for (
const auto &evi : tmi.enumValues)
1398 std::shared_ptr<Entry> ev = std::make_shared<Entry>();
1400 ev->name = evi.name;
1401 ev->id = evi.clangid;
1402 ev->section = EntryType::makeVariable();
1404 ev->tagInfoData.anchor = evi.anchor;
1405 ev->tagInfoData.fileName = evi.file;
1406 ev->hasTagInfo =
TRUE;
1407 me->moveToSubEntryAndKeep(ev);
1410 me->protection = tmi.prot;
1411 me->virt = tmi.virt;
1412 me->isStatic = tmi.isStatic;
1413 me->fileName = ce->fileName;
1414 me->id = tmi.clangId;
1415 me->startLine = tmi.lineNr;
1416 if (ce->section.isGroupDoc())
1422 me->tagInfoData.anchor = tmi.anchor;
1423 me->tagInfoData.fileName = tmi.anchorFile;
1424 me->hasTagInfo =
TRUE;
1425 if (tmi.kind==
"define")
1428 me->section = EntryType::makeDefine();
1430 else if (tmi.kind==
"enumvalue")
1432 me->section = EntryType::makeVariable();
1435 else if (tmi.kind==
"property")
1437 me->section = EntryType::makeVariable();
1440 else if (tmi.kind==
"event")
1442 me->section = EntryType::makeVariable();
1445 else if (tmi.kind==
"variable")
1447 me->section = EntryType::makeVariable();
1450 else if (tmi.kind==
"typedef")
1452 me->section = EntryType::makeVariable();
1453 me->type.prepend(
"typedef ");
1456 else if (tmi.kind==
"enumeration")
1458 me->section = EntryType::makeEnum();
1461 else if (tmi.kind==
"function")
1463 me->section = EntryType::makeFunction();
1466 else if (tmi.kind==
"signal")
1468 me->section = EntryType::makeFunction();
1471 else if (tmi.kind==
"prototype")
1473 me->section = EntryType::makeFunction();
1476 else if (tmi.kind==
"friend")
1478 me->section = EntryType::makeFunction();
1479 me->type.prepend(
"friend ");
1482 else if (tmi.kind==
"dcop")
1484 me->section = EntryType::makeFunction();
1487 else if (tmi.kind==
"slot")
1489 me->section = EntryType::makeFunction();
1492 ce->moveToSubEntryAndKeep(me);
1508 std::shared_ptr<Entry> ce = std::make_shared<Entry>();
1509 ce->section = EntryType::makeClass();
1526 ce->name = tci->
name;
1533 ce->tagInfoData.anchor = tci->
anchor;
1534 ce->tagInfoData.fileName = tci->
filename;
1535 ce->startLine = tci->
lineNr;
1537 ce->hasTagInfo =
TRUE;
1541 ce->extends = tci->
bases;
1549 a.
name = argName.c_str();
1556 root->moveToSubEntryAndKeep(ce);
1566 std::shared_ptr<Entry> fe = std::make_shared<Entry>();
1568 fe->name = tfi->
name;
1571 fe->tagInfoData.fileName = tfi->
filename;
1572 fe->hasTagInfo =
TRUE;
1575 fe->fileName = fullName;
1576 fe->startLine = tfi->
lineNr;
1583 mn->push_back(std::move(fd));
1588 mn->push_back(std::move(fd));
1591 root->moveToSubEntryAndKeep(fe);
1601 std::shared_ptr<Entry> ce = std::make_shared<Entry>();
1602 ce->section = EntryType::makeConcept();
1603 ce->name = tci->
name;
1606 ce->tagInfoData.fileName = tci->
filename;
1607 ce->startLine = tci->
lineNr;
1609 ce->hasTagInfo =
TRUE;
1612 root->moveToSubEntryAndKeep(ce);
1629 std::vector<const SectionInfo *> anchorList;
1637 ta.label,ta.fileName,-1,ta.title,
1639 anchorList.push_back(si);
1658 std::shared_ptr<Entry> ne = std::make_shared<Entry>();
1659 ne->section = EntryType::makeNamespace();
1660 ne->name = tni->
name;
1663 ne->tagInfoData.fileName = tni->
filename;
1664 ne->startLine = tni->
lineNr;
1666 ne->hasTagInfo =
TRUE;
1670 root->moveToSubEntryAndKeep(ne);
1680 std::shared_ptr<Entry> pe = std::make_shared<Entry>();
1681 pe->section = EntryType::makePackage();
1682 pe->name = tpgi->
name;
1685 pe->tagInfoData.fileName = tpgi->
filename;
1686 pe->startLine = tpgi->
lineNr;
1688 pe->hasTagInfo =
TRUE;
1691 root->moveToSubEntryAndKeep(pe);
1701 std::shared_ptr<Entry> ge = std::make_shared<Entry>();
1702 ge->section = EntryType::makeGroupDoc();
1703 ge->name = tgi->
name;
1704 ge->type = tgi->
title;
1707 ge->tagInfoData.fileName = tgi->
filename;
1708 ge->startLine = tgi->
lineNr;
1710 ge->hasTagInfo =
TRUE;
1713 root->moveToSubEntryAndKeep(ge);
1725 const auto &children = root->children();
1726 auto i = std::find_if(children.begin(),children.end(),
1727 [&](
const std::shared_ptr<Entry> &e) { return e->name == sg.c_str(); });
1728 if (i!=children.end())
1742 std::shared_ptr<Entry> pe = std::make_shared<Entry>();
1744 pe->section = isIndex ? EntryType::makeMainpageDoc() : EntryType::makePageDoc();
1745 pe->name = tpi->
name;
1746 pe->args = tpi->
title;
1747 for (
const auto &subpage : tpi->
subpages)
1756 pe->startLine = tpi->
lineNr;
1758 pe->hasTagInfo =
TRUE;
1759 root->moveToSubEntryAndKeep(pe);
1775 for (
const auto &fd : *fn)
1781 for (
const auto &ii : tfi->
includes)
1788 for (
const auto &ifd : *ifn)
1792 if (ifd->getOutputFileBase()==
QCString(ii.id))
1799 else if (ii.isImported)
1803 else if (ii.isLocal)
1807 fd->addIncludeDependency(ifd.get(),ii.text,kind);
1829 handlers.
startDocument = [&tagFileParser]() { tagFileParser.startDocument(); };
1831 handlers.
endElement = [&tagFileParser](
const std::string &name) { tagFileParser.endElement(
QCString(name)); };
1832 handlers.
characters = [&tagFileParser](
const std::string &chars) { tagFileParser.characters(
QCString(chars)); };
1833 handlers.
error = [&tagFileParser](
const std::string &fileName,
int lineNr,
const std::string &
msg) { tagFileParser.error(
QCString(fileName),lineNr,
QCString(
msg)); };
1835 tagFileParser.setDocumentLocator(&parser);
1837 [&]() { DebugLex::print(Debug::Lex_xml,
"Entering",
"libxml/xml.l",fullName); },
1838 [&]() { DebugLex::print(Debug::Lex_xml,
"Finished",
"libxml/xml.l",fullName); }
1840 tagFileParser.buildLists(root);
1841 tagFileParser.addIncludes();
1844 tagFileParser.dump();
static bool looksGenerated(const std::string &anchor)
Returns true if anchor is a potentially generated anchor.
This class represents an function or template argument list.
void push_back(const Argument &a)
static void print(DebugMask mask, int prio, const char *fmt,...)
static bool isFlagSet(const DebugMask mask)
virtual void addSectionsToDefinition(const std::vector< const SectionInfo * > &anchorList)=0
static FileNameLinkedMap * inputNameLinkedMap
Class representing all files with a certain base name.
static ModuleManager & instance()
This is an alternative implementation of QCString.
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
const std::string & str() const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
class that provide information about a section.
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
Replace an existing section with a new one Return a non-owning pointer to the newly added section.
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
static constexpr int Anchor
Wrapper class for a number of boolean properties.
Event handlers that can installed by the client and called while parsing a XML document.
std::unordered_map< std::string, std::string > Attributes
std::function< EndElementType > endElement
handler invoked when a closing tag has been found
std::function< StartElementType > startElement
handler invoked when an opening tag has been found
std::function< CharsType > characters
handler invoked when content between tags has been found
static std::string value(const Attributes &attrib, const std::string &key)
std::function< ErrorType > error
handler invoked when the parser encounters an error
std::function< StartDocType > startDocument
handler invoked at the start of the document
void parse(const char *fileName, const char *inputString, bool debugEnabled, std::function< void()> debugStart, std::function< void()> debugEnd, std::function< Transcode > transcoder=[](std::string &s, const char *){ return true;})
TagAnchorInfo(const QCString &f, const QCString &l, const QCString &t=QCString())
Variant class that holds a unique pointer to one of the specific container types.
TagPageInfo * getPageInfo()
const TagDirInfo * getDirInfo() const
TagGroupInfo * getGroupInfo()
const R * get() const
Generic const getter.
std::variant< std::monostate, TagClassInfoPtr, TagConceptInfoPtr, TagNamespaceInfoPtr, TagPackageInfoPtr, TagFileInfoPtr, TagGroupInfoPtr, TagPageInfoPtr, TagDirInfoPtr, TagModuleInfoPtr > VariantT
const TagConceptInfo * getConceptInfo() const
TagCompoundVariant(const TagCompoundVariant &)=delete
TagModuleInfo * getModuleInfo()
TagNamespaceInfo * getNamespaceInfo()
static TagCompoundVariant make(Args &&... args)
Generic factory method to create a variant holding a unique pointer to a given compound type.
const TagPackageInfo * getPackageInfo() const
TagCompoundVariant & operator=(const TagCompoundVariant &)=delete
const TagGroupInfo * getGroupInfo() const
~TagCompoundVariant()=default
TagConceptInfo * getConceptInfo()
TagDirInfo * getDirInfo()
const TagModuleInfo * getModuleInfo() const
const TagClassInfo * getClassInfo() const
TagCompoundVariant(VariantT &&v)
const TagPageInfo * getPageInfo() const
TagPackageInfo * getPackageInfo()
const TagFileInfo * getFileInfo() const
TagFileInfo * getFileInfo()
const TagNamespaceInfo * getNamespaceInfo() const
R * get()
Generic non-const getter.
TagCompoundInfo * getCompoundInfo()
Convenience method to get the shared compound info.
TagCompoundVariant(TagCompoundVariant &&)=default
TagCompoundVariant & operator=(TagCompoundVariant &&)=default
TagClassInfo * getClassInfo()
Container for enum values that are scoped within an enum.
void addDocAnchors(const std::shared_ptr< Entry > &e, const std::vector< TagAnchorInfo > &l)
void startIncludes(const XMLHandlers::Attributes &attrib)
void startDocAnchor(const XMLHandlers::Attributes &attrib)
void endElement(const QCString &name)
void p_warn(const char *fmt)
TagFileParser(const char *tagName)
void startElement(const QCString &name, const XMLHandlers::Attributes &attrib)
const XMLLocator * m_locator
void startStringValue(const XMLHandlers::Attributes &)
void setDocumentLocator(const XMLLocator *locator)
TagCompoundVariant m_curCompound
void startBase(const XMLHandlers::Attributes &attrib)
void error(const QCString &fileName, int lineNr, const QCString &msg)
TagMemberInfo m_curMember
void p_warn(const char *fmt, const char *s)
void startIgnoreElement(const XMLHandlers::Attributes &)
void characters(const QCString &ch)
void buildLists(const std::shared_ptr< Entry > &root)
TagEnumValueInfo m_curEnumValue
void startMember(const XMLHandlers::Attributes &attrib)
void buildMemberList(const std::shared_ptr< Entry > &ce, const std::vector< TagMemberInfo > &members)
void startCompound(const XMLHandlers::Attributes &attrib)
TagIncludeInfo m_curIncludes
std::vector< TagCompoundVariant > m_tagFileCompounds
std::stack< State > m_stateStack
void startEnumValue(const XMLHandlers::Attributes &attrib)
Container for include info that can be read from a tagfile.
Container for member specific info that can be read from a tagfile.
std::vector< TagEnumValueInfo > enumValues
std::vector< TagAnchorInfo > docAnchors
std::vector< std::string > StringVector
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=nullptr)
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
void warn_(const QCString &file, int line, const char *fmt,...)
void msg(const char *fmt,...)
std::unique_ptr< TagPackageInfo > TagPackageInfoPtr
std::unique_ptr< TagFileInfo > TagFileInfoPtr
std::unique_ptr< TagClassInfo > TagClassInfoPtr
std::unique_ptr< TagNamespaceInfo > TagNamespaceInfoPtr
std::unique_ptr< TagDirInfo > TagDirInfoPtr
static const std::map< std::string, CompoundFactory > g_compoundFactory
std::unique_ptr< TagConceptInfo > TagConceptInfoPtr
std::unique_ptr< TagModuleInfo > TagModuleInfoPtr
std::unique_ptr< TagPageInfo > TagPageInfoPtr
ElementCallbacks::EndCallback endCb(void(TagFileParser::*fn)())
static const std::map< std::string, ElementCallbacks > g_elementHandlers
ElementCallbacks::StartCallback startCb(void(TagFileParser::*fn)(const XMLHandlers::Attributes &))
std::unique_ptr< TagGroupInfo > TagGroupInfoPtr
const char * qPrint(const char *s)
This class contains the information about the argument of a function or template.
This class stores information about an inheritance relation.
QCString name
the name of the base class
@ GROUPING_INGROUP
membership in group was defined by @ingroup
CompoundFactory(TagFileParser::State s, const CreateFunc &f)
TagFileParser::State state
std::function< TagCompoundVariant()> CreateFunc
std::function< void(TagFileParser &, const XMLHandlers::Attributes &)> StartCallback
std::function< void(TagFileParser &)> EndCallback
Container for class specific info that can be read from a tagfile.
StringVector templateArguments
std::vector< BaseInfo > bases
Base class for all compound types.
std::vector< TagAnchorInfo > docAnchors
std::vector< TagMemberInfo > members
Container for concept specific info that can be read from a tagfile.
Container for directory specific info that can be read from a tagfile.
Container for file specific info that can be read from a tagfile.
StringVector namespaceList
std::vector< TagIncludeInfo > includes
Container for group specific info that can be read from a tagfile.
StringVector namespaceList
StringVector subgroupList
Container for module specific info that can be read from a tagfile.
Container for namespace specific info that can be read from a tagfile.
StringVector namespaceList
Container for package specific info that can be read from a tagfile.
Container for page specific info that can be read from a tagfile.
void parseTagFile(const std::shared_ptr< Entry > &root, const char *fullName)
Protection
Protection level of members.
Specifier
Virtualness of a member.
QCString stripPath(const QCString &s)
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
QCString stripExtension(const QCString &fName)
EntryType guessSection(const QCString &name)
QCString getFileNameExtension(const QCString &fn)
A bunch of utility functions.