10#define xmlpp_state_hpp
21 explicit State(
const std::string& _tag,
22 std::function<
void (
const XML_Char **atts)> _pfStart =
nullptr,
23 std::function<
void ()> _pfEnd =
nullptr,
24 std::function<
void (
const char *pBuf,
int len)> _pfText =
nullptr
34 void addState(
State* s) { substates_.push_back(s); }
35 State* addState(
const std::string& tagname)
37 auto s =
new State(tagname);
38 substates_.push_back(s);
41 const std::list<State*>& substates() {
return substates_; }
42 std::function<void (
const XML_Char **atts)> pfStart{
nullptr};
43 std::function<void ()> pfEnd{
nullptr};
44 std::function<void (
const char *pBuf,
int len)> pfText{
nullptr};
48 std::list<State*> substates_;
53 std::stack<State*> parseStates;
59 void add_state(
State* state);
60 State* current_element()
const {
return parseStates.top(); }
62 void onStartElement(
const XML_Char *fullname,
const XML_Char **atts)
override;
67 std::stack<State*> parseStates;
void onCharacterData(const char *pBuf, int len) override
callback is called with parsed character data inside of an xml element.
Definition state.cpp:59
void onStartElement(const XML_Char *fullname, const XML_Char **atts) override
this callback is called after parsing the starting tag of an xml element.
Definition state.cpp:26
void onEndElement(const XML_Char *fullname) override
callback is called after parsing the end tag of an xml element
Definition state.cpp:46
default base class for delegates.
Definition delegate.hpp:217
contains the xml parsers delegate interface