base class for xml parsers, runtime independant More...
#include <xmlParserBase.hxx>
Public Member Functions | |
void | setAttribute (std::string key, std::string value) |
std::string | getAttribute (std::string key) |
virtual void | addData (std::string value) |
virtual void | init (const xmlChar **p, xmlParserBase *father=0) |
Static Public Member Functions | |
static void XMLCALL | start_document (void *userData) |
static void XMLCALL | end_document (void *userData) |
static void XMLCALL | start_element (void *userData, const xmlChar *name, const xmlChar **p) |
static void XMLCALL | end_element (void *userData, const xmlChar *name) |
static void XMLCALL | characters (void *userData, const xmlChar *ch, int len) |
static void XMLCALL | comment (void *userData, const xmlChar *value) |
static void XMLCALL | warning (void *userData, const char *fmt,...) |
static void XMLCALL | error (void *userData, const char *fmt,...) |
static void XMLCALL | fatal_error (void *userData, const char *fmt,...) |
static void XMLCALL | cdata_block (void *userData, const xmlChar *value, int len) |
static void | cleanGarbage () |
static int | getGarbageSize () |
static void | XML_SetUserData (_xmlParserCtxt *ctxt, xmlParserBase *parser) |
Public Attributes | |
std::map< std::string, int > | counts |
Static Public Attributes | |
static _xmlParserCtxt * | _xmlParser |
static std::stack < xmlParserBase * > | _stackParser |
Protected Member Functions | |
void | getAttributes (const xmlChar **p) |
virtual void | onStart (const XML_Char *elem, const xmlChar **p) |
virtual void | onEnd (const XML_Char *name) |
virtual void | charData (std::string data) |
virtual void | incrCount (const XML_Char *elem) |
virtual void | end () |
virtual void | stopParse (std::string what) |
Protected Attributes | |
std::map< std::string, std::string > | _mapAttrib |
std::string | _data |
xmlParserBase * | _father |
Static Protected Attributes | |
static std::list< xmlParserBase * > | _garbage |
base class for xml parsers, runtime independant
Definition at line 51 of file xmlParserBase.hxx.
|
virtual |
Add data on the data attribute of the parser object dedicated to an xml tag
Reimplemented in outputParser, YACS::ENGINE::dataParser, YACS::ENGINE::arrayParser, YACS::ENGINE::valueParser, and YACS::ENGINE::portParser.
Definition at line 267 of file xmlParserBase.cxx.
|
static |
callback called for CDATA inside tags:
<tag>![CDATA[content]]></tag>
used only by libxml2
Definition at line 204 of file xmlParserBase.cxx.
References charData().
Referenced by xmlReader::parse().
|
static |
callback called for significant characters inside tags:
<tag>content</tag>
or outside tags, like space or new line; get also the CDATA tags:
<tag>![CDATA[content]]></tag>
Definition at line 108 of file xmlParserBase.cxx.
References charData().
Referenced by xmlReader::parse().
|
protectedvirtual |
to be specialized following the kind of xml tag
Reimplemented in YACS::ENGINE::sampleParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, YACS::ENGINE::attrParser, and YACS::ENGINE::stateParser.
Definition at line 299 of file xmlParserBase.cxx.
Referenced by cdata_block(), and characters().
|
static |
Definition at line 214 of file xmlParserBase.cxx.
Referenced by xmlReader::parse().
|
static |
callback usable only with libxml2
Definition at line 122 of file xmlParserBase.cxx.
Referenced by xmlReader::parse().
|
protectedvirtual |
to be specialized for each kind of xml tag
Definition at line 318 of file xmlParserBase.cxx.
Referenced by end_element().
|
static |
callback usable only with libxml2
Definition at line 63 of file xmlParserBase.cxx.
Referenced by xmlReader::parse().
|
static |
callback called on end of an xml element:
</name>
Definition at line 88 of file xmlParserBase.cxx.
References DEBTRACE, end(), onEnd(), tochar(), and XML_Char.
Referenced by xmlReader::parse().
|
static |
callback usable only with libxml2
Definition at line 156 of file xmlParserBase.cxx.
References DEBTRACE.
Referenced by xmlReader::parse().
|
static |
callback usable only with libxml2
Definition at line 181 of file xmlParserBase.cxx.
References DEBTRACE.
Referenced by xmlReader::parse().
std::string xmlParserBase::getAttribute | ( | std::string | key | ) |
Gets an attribute value given a string key. If the key does not exist, throws an Exception.
Definition at line 254 of file xmlParserBase.cxx.
|
protected |
Stores the tag attributes on a map. The map is an attribute of the parser object dedicated to the current xml tag
Definition at line 227 of file xmlParserBase.cxx.
Referenced by YACS::ENGINE::sampleParser::init().
|
inlinestatic |
Definition at line 78 of file xmlParserBase.hxx.
References _garbage.
Referenced by xmlReader::parse().
|
protectedvirtual |
May be specialized for each kind of xml tag. Counts the number of tag occurences of a given type inside a context.
Definition at line 307 of file xmlParserBase.cxx.
Referenced by start_element().
|
virtual |
all parsers must know their father parser (father tag), in order to set values or attributes in father.
Reimplemented in YACS::ENGINE::sampleParser, outputParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, YACS::ENGINE::dataParser, YACS::ENGINE::arrayParser, YACS::ENGINE::valueParser, YACS::ENGINE::portParser, YACS::ENGINE::attrParser, YACS::ENGINE::nodeParser, YACS::ENGINE::graphParser, and YACS::ENGINE::stateParser.
Definition at line 277 of file xmlParserBase.cxx.
Referenced by xmlReader::parse().
|
protectedvirtual |
to be specialized for each kind of xml tag
Reimplemented in outputParser.
Definition at line 292 of file xmlParserBase.cxx.
Referenced by end_element().
|
protectedvirtual |
to be specialized for each kind of xml tag
Reimplemented in outputParser.
Definition at line 285 of file xmlParserBase.cxx.
Referenced by start_element().
void xmlParserBase::setAttribute | ( | std::string | key, |
std::string | value | ||
) |
Stores an attribute (key, value) on the map attribute. used for attributes defined at another tag level (child tags).
Definition at line 245 of file xmlParserBase.cxx.
|
static |
callback usable only with libxml2
Definition at line 54 of file xmlParserBase.cxx.
Referenced by xmlReader::parse().
|
static |
callback called on start of an xml element:
<name>
Definition at line 72 of file xmlParserBase.cxx.
References incrCount(), onStart(), tochar(), and XML_Char.
Referenced by xmlReader::parse().
|
protectedvirtual |
Throws an exception.
Definition at line 325 of file xmlParserBase.cxx.
Referenced by YACS::ENGINE::sampleParser::onEnd(), and YACS::ENGINE::sampleParser::onStart().
|
static |
callback usable only with libxml2
Definition at line 133 of file xmlParserBase.cxx.
References DEBTRACE.
Referenced by xmlReader::parse().
|
static |
Definition at line 37 of file xmlParserBase.cxx.
Referenced by YACS::ENGINE::sampleParser::onStart().
|
protected |
Definition at line 106 of file xmlParserBase.hxx.
Referenced by YACS::ENGINE::sampleParser::charData(), and YACS::ENGINE::sampleParser::onEnd().
|
protected |
Definition at line 107 of file xmlParserBase.hxx.
Referenced by YACS::ENGINE::sampleParser::init().
|
staticprotected |
Definition at line 105 of file xmlParserBase.hxx.
Referenced by getGarbageSize().
|
protected |
Definition at line 104 of file xmlParserBase.hxx.
Referenced by YACS::ENGINE::sampleParser::onEnd().
|
static |
Definition at line 91 of file xmlParserBase.hxx.
Referenced by YACS::ENGINE::sampleParser::onStart(), and xmlReader::parse().
|
static |
Definition at line 87 of file xmlParserBase.hxx.
Referenced by YACS::ENGINE::sampleParser::onStart(), and xmlReader::parse().
std::map< std::string, int > xmlParserBase::counts |
Definition at line 85 of file xmlParserBase.hxx.