Doxygen
Loading...
Searching...
No Matches
tagreader.h File Reference
#include <memory>
+ Include dependency graph for tagreader.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void parseTagFile (const std::shared_ptr< Entry > &root, const char *fullPathName)
 

Function Documentation

◆ parseTagFile()

void parseTagFile ( const std::shared_ptr< Entry > & root,
const char * fullPathName )

Definition at line 1815 of file tagreader.cpp.

1816{
1817 TagFileParser tagFileParser(fullName);
1818 QCString inputStr = fileToString(fullName);
1819 XMLHandlers handlers;
1820 // connect the generic events handlers of the XML parser to the specific handlers of the tagFileParser object
1821 handlers.startDocument = [&tagFileParser]() { tagFileParser.startDocument(); };
1822 handlers.startElement = [&tagFileParser](const std::string &name,const XMLHandlers::Attributes &attrs) { tagFileParser.startElement(QCString(name),attrs); };
1823 handlers.endElement = [&tagFileParser](const std::string &name) { tagFileParser.endElement(QCString(name)); };
1824 handlers.characters = [&tagFileParser](const std::string &chars) { tagFileParser.characters(QCString(chars)); };
1825 handlers.error = [&tagFileParser](const std::string &fileName,int lineNr,const std::string &msg) { tagFileParser.error(QCString(fileName),lineNr,QCString(msg)); };
1826 XMLParser parser(handlers);
1827 tagFileParser.setDocumentLocator(&parser);
1828 parser.parse(fullName,inputStr.data(),Debug::isFlagSet(Debug::Lex_xml),
1829 [&]() { DebugLex::print(Debug::Lex_xml,"Entering","libxml/xml.l",fullName); },
1830 [&]() { DebugLex::print(Debug::Lex_xml,"Finished", "libxml/xml.l",fullName); }
1831 );
1832 tagFileParser.buildLists(root);
1833 tagFileParser.addIncludes();
1835 {
1836 tagFileParser.dump();
1837 }
1838}
@ Tag
Definition debug.h:45
@ Lex_xml
Definition debug.h:70
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:132
This is an alternative implementation of QCString.
Definition qcstring.h:101
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159
Event handlers that can installed by the client and called while parsing a XML document.
Definition xml.h:27
std::unordered_map< std::string, std::string > Attributes
Definition xml.h:29
std::function< EndElementType > endElement
handler invoked when a closing tag has been found
Definition xml.h:40
std::function< StartElementType > startElement
handler invoked when an opening tag has been found
Definition xml.h:39
std::function< CharsType > characters
handler invoked when content between tags has been found
Definition xml.h:41
std::function< ErrorType > error
handler invoked when the parser encounters an error
Definition xml.h:42
std::function< StartDocType > startDocument
handler invoked at the start of the document
Definition xml.h:37
#define msg(fmt,...)
Definition message.h:94
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1414

References XMLHandlers::characters, QCString::data(), XMLHandlers::endElement, XMLHandlers::error, fileToString(), Debug::isFlagSet(), Debug::Lex_xml, msg, XMLParser::parse(), XMLHandlers::startDocument, XMLHandlers::startElement, Debug::Tag, and anonymous_namespace{tagreader.cpp}::TagFileParser::TagFileParser().

Referenced by readTagFile().