#include <expat_serializer.hpp>
Inheritance diagram for s11n::io::expat_serializer< NodeType >:
Public Types | |
typedef NodeType | node_type |
typedef expat_serializer< node_type > | this_type |
Public Member Functions | |
expat_serializer () | |
virtual | ~expat_serializer () |
virtual bool | serialize (const node_type &src, std::ostream &dest) |
Writes src out to dest. | |
node_type * | expat_parse_stream (std::istream &is) |
Uses expat to try to parse a tree of nodes from the given stream. | |
virtual node_type * | deserialize (std::istream &src) |
Overridden to parse src using this object's grammar rules. | |
Static Public Member Functions | |
static bool | is_valid_xml_key (const std::string &s) |
Performs a "fast" check for XML key validity on s: if the first char is alpha or underscore, the function returns true, else it returns false. | |
static void XMLCALL | start_node (void *, const char *name, const char **attr) |
static void XMLCALL | end_node (void *, const char *) |
expat end-node callback. | |
static void XMLCALL | char_handler (void *, const char *txt, int len) |
expat char-data callback. |
Definition at line 46 of file expat_serializer.hpp.
typedef NodeType s11n::io::expat_serializer< NodeType >::node_type |
Reimplemented from s11n::io::data_node_serializer< NodeType >.
Definition at line 49 of file expat_serializer.hpp.
typedef expat_serializer<node_type> s11n::io::expat_serializer< NodeType >::this_type |
Definition at line 69 of file expat_serializer.hpp.
s11n::io::expat_serializer< NodeType >::expat_serializer | ( | ) | [inline] |
Definition at line 71 of file expat_serializer.hpp.
References s11n::io::data_node_serializer< NodeType >::magic_cookie(), and MAGIC_COOKIE_EXPAT_XML.
virtual s11n::io::expat_serializer< NodeType >::~expat_serializer | ( | ) | [inline, virtual] |
Definition at line 76 of file expat_serializer.hpp.
static bool s11n::io::expat_serializer< NodeType >::is_valid_xml_key | ( | const std::string & | s | ) | [inline, static] |
Performs a "fast" check for XML key validity on s: if the first char is alpha or underscore, the function returns true, else it returns false.
Definition at line 56 of file expat_serializer.hpp.
Referenced by s11n::io::expat_serializer< NodeType >::serialize().
virtual bool s11n::io::expat_serializer< NodeType >::serialize | ( | const node_type & | src, | |
std::ostream & | dest | |||
) | [inline, virtual] |
Writes src out to dest.
Reimplemented from s11n::io::data_node_serializer< NodeType >.
Definition at line 81 of file expat_serializer.hpp.
References EXPAT_CLASS_ATTRIBUTE, s11n::io::expat_serializer_translations(), INDENT, s11n::io::expat_serializer< NodeType >::is_valid_xml_key(), s11n::io::data_node_serializer< NodeType >::magic_cookie(), and s11n::io::strtool::translate_entities().
static void XMLCALL s11n::io::expat_serializer< NodeType >::start_node | ( | void * | , | |
const char * | name, | |||
const char ** | attr | |||
) | [inline, static] |
Definition at line 191 of file expat_serializer.hpp.
References EXPAT_CLASS_ATTRIBUTE, and EXPATDEBUG.
Referenced by s11n::io::expat_serializer< NodeType >::expat_parse_stream().
static void XMLCALL s11n::io::expat_serializer< NodeType >::end_node | ( | void * | , | |
const char * | ||||
) | [inline, static] |
expat end-node callback.
Definition at line 219 of file expat_serializer.hpp.
References EXPATDEBUG.
Referenced by s11n::io::expat_serializer< NodeType >::expat_parse_stream().
static void XMLCALL s11n::io::expat_serializer< NodeType >::char_handler | ( | void * | , | |
const char * | txt, | |||
int | len | |||
) | [inline, static] |
expat char-data callback.
Definition at line 238 of file expat_serializer.hpp.
References EXPATDEBUG.
Referenced by s11n::io::expat_serializer< NodeType >::expat_parse_stream().
node_type* s11n::io::expat_serializer< NodeType >::expat_parse_stream | ( | std::istream & | is | ) | [inline] |
Uses expat to try to parse a tree of nodes from the given stream.
Definition at line 254 of file expat_serializer.hpp.
References CERR, s11n::io::expat_serializer< NodeType >::char_handler(), s11n::io::expat_serializer< NodeType >::end_node(), EXPATDEBUG, and s11n::io::expat_serializer< NodeType >::start_node().
Referenced by s11n::io::expat_serializer< NodeType >::deserialize().
virtual node_type* s11n::io::expat_serializer< NodeType >::deserialize | ( | std::istream & | src | ) | [inline, virtual] |
Overridden to parse src using this object's grammar rules.
Reimplemented from s11n::io::data_node_serializer< NodeType >.
Definition at line 308 of file expat_serializer.hpp.
References s11n::io::expat_serializer< NodeType >::expat_parse_stream().