11 else if (entity ==
"amp")
13 else if (entity ==
"lt")
15 else if (entity ==
"gt")
23 #ifdef SIMPLE_SAX_PARSER_DEBUG
24 static char *debug_states[] = {
29 "IN_ELEMENT_WHITESPACE",
34 "IN_BEGIN_ATTRIBUTE_VALUE",
36 "IN_END_ATTRIBUTE_VALUE",
41 std::cerr << debug_states[state] << std::endl;
57 char stringDelims[] =
"\"&";
122 attributeValue.clear();
123 stringDelims[0] =
'\"';
128 attributeValue.clear();
129 stringDelims[0] =
'\'';
136 attributeValue +=
getToken(stringDelims);
141 Attribute attr(attributeName, attributeValue);
142 Attributes::iterator
i = std::lower_bound(
m_attributes.begin(),
146 throw ParserError(
"Attribute " + i->key +
" defined more than once");
153 throw ParserError(
"Unexpected end of input at " + attributeValue);
173 + tmp +
" for " + attributeValue);
257 if (*firstChar == EOF || (
int) separators[0] == *firstChar || strchr(separators + 1, *firstChar))
263 (*buffer)[0] = (
char) *firstChar;
272 *buffer = (
char*) realloc(*buffer, *maxSize);
286 if (separators[0] == c || strchr(separators + 1, c))
293 (*buffer)[i++] = (
char) c;
virtual void endElement(const std::string &)
std::string parseEntity(const std::string &entity)
virtual void data(const std::string &)
tuple maxSize
'/store/data/Commissioning08/BeamHalo/RECO/StuffAlmostToP5_v1/000/061/642/10A0FE34-A67D-DD11-AD05-000...
std::string getToken(const char *delim)
std::vector< std::string > m_elementTags
bool fgettoken(std::istream &in, char **buffer, size_t *maxSize, const char *separators, int *firstChar)
virtual ~SimpleSAXParser()
std::vector< std::vector< double > > tmp
void debug_state_machine(enum SimpleSAXParser::PARSER_STATES state)
virtual void startElement(const std::string &, Attributes &)