浏览该文件的文档.
117 enum class Kind {
None=-1,
Class,
Struct,
Union,
Interface,
Exception,
Protocol,
Category,
Enum,
Service,
Singleton };
260 return dynamic_cast<const TagDirInfo*
>(t.get());
294 void buildLists(
const std::shared_ptr<Entry> &root);
313 warn(
"tag 'compound' was not expected!");
326 if (protStr==
"protected")
330 else if (protStr==
"private")
334 if (virtStr==
"virtual")
338 else if (virtStr==
"pure")
342 if (staticStr==
"yes")
364 warn(
"Unexpected tag 'member' found");
383 warn(
"Found 'enumvalue' tag outside of member tag");
416 warn(
"Unexpected tag 'docanchor' found");
458 warn(
"Unexpected tag 'class' found");
477 warn(
"Unexpected tag 'concept' found");
496 warn(
"Unexpected tag 'namespace' found");
512 warn(
"Unexpected tag 'file' found");
525 warn(
"Unexpected tag 'page' found");
538 warn(
"Unexpected tag 'dir' found");
563 warn(
"Unexpected tag 'type' found");
585 warn(
"Unexpected tag 'name' found");
599 if (protStr==
"protected")
603 else if (protStr==
"private")
607 if (virtStr==
"virtual")
615 warn(
"Unexpected tag 'base' found");
627 warn(
"Unexpected tag 'base' found");
650 warn(
"Unexpected tag 'includes' found");
662 warn(
"Unexpected tag 'templarg' found");
681 warn(
"Unexpected tag 'filename' found");
697 warn(
"Unexpected tag 'path' found");
714 warn(
"Unexpected tag 'anchor' found");
734 warn(
"Unexpected tag 'clangid' found");
748 warn(
"Unexpected tag 'anchorfile' found");
760 warn(
"Unexpected tag 'arglist' found");
775 warn(
"Unexpected tag 'title' found");
788 warn(
"Unexpected tag 'subgroup' found");
800 void buildMemberList(
const std::shared_ptr<Entry> &ce,
const std::vector<TagMemberInfo> &members);
801 void addDocAnchors(
const std::shared_ptr<Entry> &e,
const std::vector<TagAnchorInfo> &l);
825 void warn(
const char *fmt,
const char *s)
904 using CreateFunc = std::function<std::unique_ptr<TagCompoundInfo>()>;
940 it->second.startCb(*
this,attrib);
944 warn(
"Unknown start tag '%s' found!",
qPrint(name));
954 it->second.endCb(*
this);
958 warn(
"Unknown end tag '%s' found!",
qPrint(name));
977 warn(
"Unknown compound attribute '%s' found!",kind.c_str());
1005 for (
const auto &md : cd->
members)
1010 msg(
" anchor: '%s'\n",
qPrint(md.anchor));
1011 msg(
" arglist: '%s'\n",
qPrint(md.arglist));
1037 msg(
" class: %s \n", cls.c_str() );
1040 for (
const auto &md : nd->
members)
1045 msg(
" anchor: '%s'\n",
qPrint(md.anchor));
1046 msg(
" arglist: '%s'\n",
qPrint(md.arglist));
1062 msg(
" namespace: %s \n", ns.c_str() );
1066 msg(
" class: %s \n", cs.c_str() );
1069 for (
const auto &md : fd->
members)
1074 msg(
" anchor: '%s'\n",
qPrint(md.anchor));
1075 msg(
" arglist: '%s'\n",
qPrint(md.arglist));
1078 for (
const auto &ii : fd->
includes)
1096 msg(
" namespace: %s \n", ns.c_str() );
1100 msg(
" class: %s \n", cs.c_str() );
1102 for (
const auto &fi : gd->
fileList)
1104 msg(
" file: %s \n", fi.c_str() );
1108 msg(
" subgroup: %s \n", sg.c_str() );
1110 for (
const auto &pg : gd->
pageList)
1112 msg(
" page: %s \n", pg.c_str() );
1115 for (
const auto &md : gd->
members)
1120 msg(
" anchor: '%s'\n",
qPrint(md.anchor));
1121 msg(
" arglist: '%s'\n",
qPrint(md.arglist));
1147 for (
const auto &fi : dd->
fileList)
1149 msg(
" file: %s \n", fi.c_str() );
1153 msg(
" subdir: %s \n", sd.c_str() );
1162 for (
const auto &ta : l)
1169 ta.label,ta.fileName,-1,ta.title,
1171 e->anchors.push_back(si);
1175 warn(
"Duplicate anchor %s found",
qPrint(ta.label));
1182 for (
const auto &tmi : members)
1184 std::shared_ptr<Entry> me = std::make_shared<Entry>();
1185 me->type = tmi.type;
1186 me->name = tmi.name;
1187 me->args = tmi.arglist;
1188 if (!me->args.isEmpty())
1192 if (tmi.enumValues.size()>0)
1195 for (
const auto &evi : tmi.enumValues)
1197 std::shared_ptr<Entry> ev = std::make_shared<Entry>();
1199 ev->name = evi.name;
1200 ev->id = evi.clangid;
1203 ev->tagInfoData.anchor = evi.anchor;
1204 ev->tagInfoData.fileName = evi.file;
1205 ev->hasTagInfo =
TRUE;
1206 me->moveToSubEntryAndKeep(ev);
1209 me->protection = tmi.prot;
1210 me->virt = tmi.virt;
1211 me->stat = tmi.isStatic;
1212 me->fileName = ce->fileName;
1213 me->id = tmi.clangId;
1214 me->startLine = tmi.lineNr;
1221 me->tagInfoData.anchor = tmi.anchor;
1222 me->tagInfoData.fileName = tmi.anchorFile;
1223 me->hasTagInfo =
TRUE;
1224 if (tmi.kind==
"define")
1229 else if (tmi.kind==
"enumvalue")
1234 else if (tmi.kind==
"property")
1239 else if (tmi.kind==
"event")
1244 else if (tmi.kind==
"variable")
1249 else if (tmi.kind==
"typedef")
1252 me->type.prepend(
"typedef ");
1255 else if (tmi.kind==
"enumeration")
1260 else if (tmi.kind==
"function")
1265 else if (tmi.kind==
"signal")
1270 else if (tmi.kind==
"prototype")
1275 else if (tmi.kind==
"friend")
1278 me->type.prepend(
"friend ");
1281 else if (tmi.kind==
"dcop")
1286 else if (tmi.kind==
"slot")
1291 ce->moveToSubEntryAndKeep(me);
1307 std::shared_ptr<Entry> ce = std::make_shared<Entry>();
1325 ce->name = tci->
name;
1332 ce->tagInfoData.anchor = tci->
anchor;
1333 ce->tagInfoData.fileName = tci->
filename;
1334 ce->startLine = tci->
lineNr;
1335 ce->hasTagInfo =
TRUE;
1339 ce->extends = tci->
bases;
1347 a.
name = argName.c_str();
1350 ce->tArgLists.push_back(al);
1354 root->moveToSubEntryAndKeep(ce);
1365 std::shared_ptr<Entry> fe = std::make_shared<Entry>();
1367 fe->name = tfi->
name;
1370 fe->tagInfoData.fileName = tfi->
filename;
1371 fe->hasTagInfo =
TRUE;
1374 fe->fileName = fullName;
1375 fe->startLine = tfi->
lineNr;
1384 mn->push_back(std::move(fd));
1389 mn->push_back(std::move(fd));
1392 root->moveToSubEntryAndKeep(fe);
1403 std::shared_ptr<Entry> ce = std::make_shared<Entry>();
1405 ce->name = tci->
name;
1408 ce->tagInfoData.fileName = tci->
filename;
1409 ce->startLine = tci->
lineNr;
1410 ce->hasTagInfo =
TRUE;
1413 root->moveToSubEntryAndKeep(ce);
1424 std::shared_ptr<Entry> ne = std::make_shared<Entry>();
1426 ne->name = tni->
name;
1429 ne->tagInfoData.fileName = tni->
filename;
1430 ne->startLine = tni->
lineNr;
1431 ne->hasTagInfo =
TRUE;
1435 root->moveToSubEntryAndKeep(ne);
1446 std::shared_ptr<Entry> pe = std::make_shared<Entry>();
1448 pe->name = tpgi->
name;
1451 pe->tagInfoData.fileName = tpgi->
filename;
1452 pe->startLine = tpgi->
lineNr;
1453 pe->hasTagInfo =
TRUE;
1456 root->moveToSubEntryAndKeep(pe);
1467 std::shared_ptr<Entry> ge = std::make_shared<Entry>();
1469 ge->name = tgi->
name;
1470 ge->type = tgi->
title;
1473 ge->tagInfoData.fileName = tgi->
filename;
1474 ge->startLine = tgi->
lineNr;
1475 ge->hasTagInfo =
TRUE;
1478 root->moveToSubEntryAndKeep(ge);
1491 const auto &children = root->children();
1492 auto i = std::find_if(children.begin(),children.end(),
1493 [&](
const std::shared_ptr<Entry> &e) { return e->name == sg.c_str(); });
1494 if (i!=children.end())
1509 std::shared_ptr<Entry> pe = std::make_shared<Entry>();
1512 pe->name = tpi->
name;
1513 pe->args = tpi->
title;
1516 pe->tagInfoData.fileName = tpi->
filename;
1517 pe->startLine = tpi->
lineNr;
1518 pe->hasTagInfo =
TRUE;
1519 root->moveToSubEntryAndKeep(pe);
1535 for (
const auto &fd : *fn)
1541 for (
const auto &ii : tfi->
includes)
1548 for (
const auto &ifd : *ifn)
1552 if (ifd->getOutputFileBase()==
QCString(ii.id))
1554 fd->addIncludeDependency(ifd.get(),ii.text,ii.isLocal,ii.isImported);
1576 handlers.
error = [&tagFileParser](
const std::string &fileName,
int lineNr,
const std::string &
msg) { tagFileParser.
error(
QCString(fileName),lineNr,
QCString(
msg)); };
std::vector< std::string > StringVector
void startElement(const QCString &name, const XMLHandlers::Attributes &attrib)
static TagPageInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Container for namespace specific info that can be read from a tagfile
static TagGroupInfo * get(std::unique_ptr< TagCompoundInfo > &t)
std::function< StartElementType > startElement
handler invoked when an opening tag has been found
Base class for all compound types
static TagClassInfo * get(std::unique_ptr< TagCompoundInfo > &t)
std::vector< TagAnchorInfo > docAnchors
void push_back(const Argument &a)
ElementCallbacks::StartCallback startCb(void(TagFileParser::*fn)(const XMLHandlers::Attributes &))
Container for directory specific info that can be read from a tagfile
Protection
Protection level of members
Class representing all files with a certain base name
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
std::unordered_map< std::string, std::string > Attributes
void endElement(const QCString &name)
static TagNamespaceInfo * get(std::unique_ptr< TagCompoundInfo > &t)
StringVector templateArguments
void error(const QCString &fileName, int lineNr, const QCString &msg)
Class representing a directory in the file system
void buildMemberList(const std::shared_ptr< Entry > &ce, const std::vector< TagMemberInfo > &members)
virtual std::string fileName() const =0
This class represents an function or template argument list.
std::vector< BaseInfo > bases
bool isEmpty() const
Returns TRUE iff the string is empty
StringVector namespaceList
static TagPackageInfo * get(std::unique_ptr< TagCompoundInfo > &t)
static TagConceptInfo * get(std::unique_ptr< TagCompoundInfo > &t)
T * add(const char *k, Args &&... args)
Adds a new object to the ordered vector if it was not added already.
static const std::map< std::string, ElementCallbacks > g_elementHandlers
Specifier
Virtualness of a member.
void startMember(const XMLHandlers::Attributes &attrib)
const XMLLocator * m_locator
CompoundFactory(TagFileParser::State s, CreateFunc f)
void startCompound(const XMLHandlers::Attributes &attrib)
TagEnumValueInfo m_curEnumValue
TagMemberInfo m_curMember
std::function< void(LayoutParser &)> EndCallback
Container for concept specific info that can be read from a tagfile
static const TagClassInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
static const TagConceptInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
void startIncludes(const XMLHandlers::Attributes &attrib)
StringVector namespaceList
virtual ~TagCompoundInfo()
static bool isFlagSet(DebugMask mask)
Container for class specific info that can be read from a tagfile
TagIncludeInfo m_curIncludes
DirIterator end(const DirIterator &) noexcept
static FileNameLinkedMap * inputNameLinkedMap
virtual int lineNr() const =0
TagFileParser(const char *tagName)
QCString name
the name of the base class
static const uint64 Union
std::function< ErrorType > error
handler invoked when the parser encounters an error
static const uint64 Struct
static const uint64 Interface
void startDocAnchor(const XMLHandlers::Attributes &attrib)
std::function< EndElementType > endElement
handler invoked when a closing tag has been found
void startIgnoreElement(const XMLHandlers::Attributes &)
void parse(const char *fileName, const char *inputString, bool debugEnabled)
CompoundType compoundType() const
FileDef * createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Container for group specific info that can be read from a tagfile
StringVector namespaceList
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
std::function< std::unique_ptr< TagCompoundInfo >()> CreateFunc
void setDocumentLocator(const XMLLocator *locator)
void addDocAnchors(const std::shared_ptr< Entry > &e, const std::vector< TagAnchorInfo > &l)
void startStringValue(const XMLHandlers::Attributes &)
This class contains the information about the argument of a function or template
void warn(const char *fmt, const char *s)
QCString stripPath(const QCString &s)
std::function< CharsType > characters
handler invoked when content between tags has been found
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
static const TagDirInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
std::vector< TagEnumValueInfo > enumValues
static const uint64 Service
const T * find(const std::string &key) const
Find an object given the key.
static const uint64 Protocol
static const std::map< std::string, CompoundFactory > g_compoundFactory
void characters(const QCString &ch)
Container for include info that can be read from a tagfile
static TagFileInfo * get(std::unique_ptr< TagCompoundInfo > &t)
SectionInfo * add(const SectionInfo &si)
Add a new section given the data of an existing section.
std::vector< TagAnchorInfo > docAnchors
Container for file specific info that can be read from a tagfile
static const TagPackageInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
static const uint64 Exception
void parseTagFile(const std::shared_ptr< Entry > &root, const char *fullName)
Information about an linkable anchor
TagAnchorInfo(const QCString &f, const QCString &l, const QCString &t=QCString())
static TagDirInfo * get(std::unique_ptr< TagCompoundInfo > &t)
Container for package specific info that can be read from a tagfile
void buildLists(const std::shared_ptr< Entry > &root)
Event handlers that can installed by the client and called while parsing a XML document.
static const uint64 Strong
static const TagPageInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
static SectionManager & instance()
returns a reference to the singleton
void msg(const char *fmt,...)
void startEnumValue(const XMLHandlers::Attributes &attrib)
@ GROUPING_INGROUP
membership in group was defined by @ingroup
static const uint64 Category
const char * qPrint(const char *s)
std::stack< State > m_stateStack
std::unique_ptr< TagCompoundInfo > m_curCompound
TagCompoundInfo(CompoundType type)
class that provide information about a section.
std::function< StartDocType > startDocument
handler invoked at the start of the document
QCString getFileNameExtension(const QCString &fn)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
TagFileParser::State state
ElementCallbacks::EndCallback endCb(void(TagFileParser::*fn)())
This class stores information about an inheritance relation
void warn(const char *fmt)
StringVector subgroupList
Container for member specific info that can be read from a tagfile
static const TagFileInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
std::vector< TagMemberInfo > members
std::vector< std::unique_ptr< TagCompoundInfo > > m_tagFileCompounds
Container for enum values that are scoped within an enum
static const uint64 Singleton
void startBase(const XMLHandlers::Attributes &attrib)
int guessSection(const QCString &name)
A bunch of utility functions.
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=0)
Container for page specific info that can be read from a tagfile
static const TagGroupInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
QCString right(size_t len) const
static const TagNamespaceInfo * get(const std::unique_ptr< TagCompoundInfo > &t)
std::function< void(LayoutParser &, const XMLHandlers::Attributes &)> StartCallback
std::vector< TagIncludeInfo > includes
static std::string value(const Attributes &attrib, const std::string &key)
This is an alternative implementation of QCString.