Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

ph::persist::xml::parse Class Reference

#include <parse.hpp>

Inheritance diagram for ph::persist::xml::parse:

ph::persist::xml::parseobj

Detailed Description

Definition at line 51 of file parse.hpp.

Public Member Functions

 parse (std::ostream *errorhandler=NULL, bool silent=false)
virtual ~parse ()
void startparse (const std::string &streamname)
int doparse (char *buf, long len, int done)
void endparse ()
int parsestream (std::istream *stream, const std::string &streamname)
int doparsefile (const std::string &filename)
virtual void startelement_handler (const xmlstring &name, const std::vector< xmlstring > &atts)=0
virtual void endelement_handler (const xmlstring &name)=0
virtual void cdata_handler (const xmlstring &s, int len)
virtual void comment_handler (const xmlstring &s)
virtual void default_handler (const xmlstring &s, int len)
virtual void finish_handler ()
int error ()

Static Public Member Functions

static bool parse_xml (std::istream *stream, const std::string &streampath, parse *parser, parse_progress *progress)
static bool decodexmldata (const xmlstring &s, xmlstring *news)
static bool encodexmldata (const xmlstring &s, xmlstring *news)

Protected Member Functions

xmlstring current (int top=0)
xmlstring element (int top)
xmlstring expectedattr (const std::vector< xmlstring > &atts, const xmlstring &token)
xmlstring attr (const std::vector< xmlstring > &atts, const xmlstring &token)
xmlstring attr (const std::vector< xmlstring > &atts, int index)
xmlstring attrval (const std::vector< xmlstring > &atts, int index)
void expected_error (const xmlstring &token)
void error (const std::string &string, bool detail=true)
void error (const std::string &format, const std::string &s1, bool detail=true)
void error (const std::string &format, const std::string &s1, const std::string &s2, bool detail=true)

Protected Attributes

bool _silent
std::ostream * _errorhandler


Constructor & Destructor Documentation

ph::persist::xml::parse::parse std::ostream *  errorhandler = NULL,
bool  silent = false
[inline]
 

Definition at line 69 of file parse.hpp.

virtual ph::persist::xml::parse::~parse  )  [inline, virtual]
 

Definition at line 71 of file parse.hpp.


Member Function Documentation

bool parse::parse_xml std::istream *  stream,
const std::string &  streampath,
parse parser,
parse_progress progress
[static]
 

Definition at line 32 of file parse.cpp.

References BUFFER_SIZE, doparse(), endparse(), error(), PARSE_SUCCESS, ph::persist::xml::parse_progress::progress(), PROGRESS_UNIT, startparse(), and ph::persist::xml::parse_progress::total().

Referenced by persist_test::test_baddata::test().

void parse::startparse const std::string &  streamname  ) 
 

Definition at line 74 of file parse.cpp.

References PARSE_SUCCESS, XML_ParserCreate(), XML_SetCharacterDataHandler(), XML_SetCommentHandler(), XML_SetDefaultHandler(), XML_SetElementHandler(), and XML_SetUserData().

Referenced by parse_xml(), and parsestream().

int parse::doparse char *  buf,
long  len,
int  done
 

Definition at line 92 of file parse.cpp.

References PARSE_BADXMLTYPE, PARSE_SUCCESS, and XML_Parse().

Referenced by parse_xml(), and parsestream().

void parse::endparse  ) 
 

Definition at line 120 of file parse.cpp.

References finish_handler(), and XML_ParserFree().

Referenced by parse_xml(), and parsestream().

int parse::parsestream std::istream *  stream,
const std::string &  streamname
 

Definition at line 130 of file parse.cpp.

References BUFFER_SIZE, doparse(), endparse(), error(), PARSE_SUCCESS, and startparse().

Referenced by doparsefile().

int parse::doparsefile const std::string &  filename  ) 
 

Definition at line 153 of file parse.cpp.

References PARSE_NOFILE, and parsestream().

virtual void ph::persist::xml::parse::startelement_handler const xmlstring name,
const std::vector< xmlstring > &  atts
[pure virtual]
 

virtual void ph::persist::xml::parse::endelement_handler const xmlstring name  )  [pure virtual]
 

virtual void ph::persist::xml::parse::cdata_handler const xmlstring s,
int  len
[inline, virtual]
 

Definition at line 89 of file parse.hpp.

virtual void ph::persist::xml::parse::comment_handler const xmlstring s  )  [inline, virtual]
 

Definition at line 90 of file parse.hpp.

virtual void ph::persist::xml::parse::default_handler const xmlstring s,
int  len
[inline, virtual]
 

Definition at line 91 of file parse.hpp.

virtual void ph::persist::xml::parse::finish_handler  )  [inline, virtual]
 

Definition at line 94 of file parse.hpp.

Referenced by endparse().

int ph::persist::xml::parse::error  )  [inline]
 

Definition at line 97 of file parse.hpp.

Referenced by error(), expected_error(), parse_xml(), and parsestream().

bool parse::decodexmldata const xmlstring s,
xmlstring news
[static]
 

Definition at line 348 of file parse.cpp.

References c, and S.

bool parse::encodexmldata const xmlstring s,
xmlstring news
[static]
 

Definition at line 318 of file parse.cpp.

References c, and S.

xmlstring ph::persist::xml::parse::current int  top = 0  )  [protected]
 

xmlstring ph::persist::xml::parse::element int  top  )  [protected]
 

xmlstring parse::expectedattr const std::vector< xmlstring > &  atts,
const xmlstring token
[protected]
 

Definition at line 253 of file parse.cpp.

References attr(), expected_error(), and S.

xmlstring parse::attr const std::vector< xmlstring > &  atts,
const xmlstring token
[protected]
 

Definition at line 240 of file parse.cpp.

References S.

Referenced by expectedattr().

xmlstring parse::attr const std::vector< xmlstring > &  atts,
int  index
[protected]
 

Definition at line 226 of file parse.cpp.

References S.

xmlstring parse::attrval const std::vector< xmlstring > &  atts,
int  index
[protected]
 

Definition at line 233 of file parse.cpp.

References S.

void parse::expected_error const xmlstring token  )  [protected]
 

Definition at line 263 of file parse.cpp.

References error(), and XMLFmt_expected.

Referenced by expectedattr().

void parse::error const std::string &  string,
bool  detail = true
[protected]
 

Definition at line 268 of file parse.cpp.

References _errorhandler, _silent, PARSE_XMLERROR, and XMLFmt_error.

void parse::error const std::string &  format,
const std::string &  s1,
bool  detail = true
[protected]
 

Definition at line 291 of file parse.cpp.

References error().

void parse::error const std::string &  format,
const std::string &  s1,
const std::string &  s2,
bool  detail = true
[protected]
 

Definition at line 296 of file parse.cpp.

References error().


Field Documentation

bool ph::persist::xml::parse::_silent [protected]
 

Definition at line 103 of file parse.hpp.

Referenced by error().

std::ostream* ph::persist::xml::parse::_errorhandler [protected]
 

Definition at line 104 of file parse.hpp.

Referenced by error().


The documentation for this class was generated from the following files:
Generated on Wed Apr 5 22:03:35 2006 for cppxmlobj by  doxygen 1.4.3