9 else if (entity ==
"amp")
11 else if (entity ==
"lt")
13 else if (entity ==
"gt")
19 #ifdef SIMPLE_SAX_PARSER_DEBUG 20 static char *debug_states[] = {
"IN_DOCUMENT",
24 "IN_ELEMENT_WHITESPACE",
29 "IN_BEGIN_ATTRIBUTE_VALUE",
31 "IN_END_ATTRIBUTE_VALUE",
49 char stringDelims[] =
"\"&";
109 attributeValue.clear();
110 stringDelims[0] =
'\"';
113 attributeValue.clear();
114 stringDelims[0] =
'\'';
120 attributeValue +=
getToken(stringDelims);
124 Attribute attr(attributeName, attributeValue);
127 throw ParserError(
"Attribute " +
i->key +
" defined more than once");
130 }
else if (
skipChar(stringDelims[1]))
133 throw ParserError(
"Unexpected end of input at " + attributeValue);
151 throw ParserError(
"Non-matching closing element " +
tmp +
" for " + attributeValue);
228 if (*firstChar == EOF || (
int)separators[0] == *firstChar || strchr(separators + 1, *firstChar)) {
232 (*
buffer)[0] = (char)*firstChar;
252 if (separators[0] ==
c || strchr(separators + 1,
c)) {
258 (*buffer)[
i++] = (char)
c;
virtual void endElement(const std::string &)
std::string parseEntity(const std::string &entity)
virtual void data(const std::string &)
std::string getToken(const char *delim)
std::vector< std::string > m_elementTags
void * realloc(void *ptr, size_t size) noexcept
bool fgettoken(std::istream &in, char **buffer, size_t *maxSize, const char *separators, int *firstChar)
virtual ~SimpleSAXParser()
void debug_state_machine(enum SimpleSAXParser::PARSER_STATES state)
virtual void startElement(const std::string &, Attributes &)