浏览该文件的文档.
22 #include <unordered_map>
29 using Attributes = std::unordered_map<std::string,std::string>;
34 using ErrorType = void(
const std::string,
int,
const std::string &);
35 using CharsType = void(
const std::string &);
46 auto it = attrib.find(key);
59 virtual int lineNr()
const = 0;
60 virtual std::string
fileName()
const = 0;
81 void parse(
const char *
fileName,
const char *inputString,
bool debugEnabled);
84 virtual int lineNr()
const override;
85 virtual std::string
fileName()
const override;
87 std::unique_ptr<Private>
p;
std::function< StartElementType > startElement
handler invoked when an opening tag has been found
std::unordered_map< std::string, std::string > Attributes
virtual int lineNr() const override
virtual std::string fileName() const =0
void(const std::string &, const Attributes &) StartElementType
std::unique_ptr< Private > p
virtual std::string fileName() const override
void(const std::string, int, const std::string &) ErrorType
virtual int lineNr() const =0
std::function< ErrorType > error
handler invoked when the parser encounters an error
std::function< EndElementType > endElement
handler invoked when a closing tag has been found
void parse(const char *fileName, const char *inputString, bool debugEnabled)
std::function< EndDocType > endDocument
handler invoked at the end of the document
std::function< CharsType > characters
handler invoked when content between tags has been found
void(const std::string &) EndElementType
XMLParser(const XMLHandlers &handlers)
Event handlers that can installed by the client and called while parsing a XML document.
void(const std::string &) CharsType
std::function< StartDocType > startDocument
handler invoked at the start of the document
static std::string value(const Attributes &attrib, const std::string &key)