Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

xml_processor Class Reference

xml processor main class More...

#include <parsexml.h>

Inheritance diagram for xml_processor:

byte_manager

List of all members.

Public Member Functions

 xml_processor (byte_source &stream, xml_document &doc, mem_pool_t &small_pool, mem_pool_t &big_pool, size_t xml_size, bool validate)
 consrtuctor
 ~xml_processor ()
 destructor
bool parse ()
 parser document
const char * get_error () const
 returns the last error

Private Member Functions

void parseDocument ()
 parses document [1] document ::= prolog element Misc*
void parseProlog ()
 parses prolog [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
void parseDocTypeDecl ()
 parses document type declaration [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | DeclSep)* ']' S?)? '>'
void parseElement ()
 parses xml element [39] element ::= EmptyElemTag | STag content ETag
xml_forceinline void parseStartTag ()
 parses xml element open tag [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' [40] STag ::= '<' Name (S Attribute)* S? '>'
void parseAttributes (xml_element &el)
 parses attributes [41] Attribute ::= Name Eq AttValue
xml_forceinline void parseEndTag ()
 parses element closing tag [42] ETag ::= '</' Name S? '>'
xml_forceinline void parseContent ()
 parses element content [43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
void parseCDATA ()
 CDATA section [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '<![CDATA[' [20] CData ::= (Char* - (Char* ']]>' Char*)) [21] CDEnd ::= ']]>'.
void _parseCharData ()
 parses char data - text node, internal version
xml_forceinline void parseCharData ()
 parses char data - text node inline wrapper
void parseGeneralReference (bool skip_after)
 parses general reference [67] Reference ::= EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [66] CharRef ::= '&#' [0-9]+ ';' | '&x' [0-9a-fA-F]+ ';'
void parseMisc ()
 parses misc [27] Misc ::= Comment | PI | S
void parseDTD (const char *location=0)
 parses DTD
void skipDTD ()
 parses DTD but does not build grammar
void resolve_references ()
 resolves references

Private Attributes

xml_document_doc
 xml document
bool _preserve_white_space
 flag to preserve white spaces
byte_allocator_white_space_allocator
 white space stack allocator
xml_white_space_stack_t _white_space_stack
 white space stack
string_t _error
 last error
bool _validate
 flag to do validation


Detailed Description

xml processor main class

Definition at line 61 of file parsexml.h.


Constructor & Destructor Documentation

BEGIN_TERIMBER_NAMESPACE xml_processor::xml_processor ( byte_source stream,
xml_document doc,
mem_pool_t small_pool,
mem_pool_t big_pool,
size_t  xml_size,
bool  validate 
)

consrtuctor

Parameters:
stream  byte stream
doc  xml document
small_pool  small memory pool
big_pool  big memory pool
xml_size  xml size - just a tip
validate  validation flag

Definition at line 51 of file parsexml.cpp.

References byte_manager::_small_pool, _white_space_allocator, and pool< C >::loan_object().

xml_processor::~xml_processor (  ) 

destructor

Definition at line 64 of file parsexml.cpp.

References byte_manager::_small_pool, _white_space_allocator, and pool< C >::return_object().


Member Function Documentation

const char * xml_processor::get_error (  )  const

returns the last error

Definition at line 70 of file parsexml.cpp.

References _error.

Referenced by xml_designer_impl::_load().

void xml_processor::parseDocument (  )  [private]

xml_forceinline void xml_processor::parseContent (  )  [private]

parses element content [43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*

Definition at line 119 of file parsexml.hpp.

References ch_ampersand, ch_bang, ch_dash, ch_open_angle, ch_open_square, ch_question, parseCDATA(), parseCharData(), byte_manager::parseComment(), byte_manager::parsePI(), byte_manager::pick(), byte_manager::pop(), byte_manager::push(), byte_manager::reset_all_tmp(), and byte_manager::throw_exception().

Referenced by parseElement().

void xml_processor::parseCDATA (  )  [private]

CDATA section [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '<![CDATA[' [20] CData ::= (Char* - (Char* ']]>' Char*)) [21] CDEnd ::= ']]>'.

Definition at line 392 of file parsexml.cpp.

References _doc, byte_manager::_tmp_store1, xml_document::add_cdata(), ch_close_angle, ch_close_square, ch_open_square, paged_buffer::persist(), byte_manager::pick(), byte_manager::pop(), paged_buffer::reset(), byte_manager::skip_sign(), byte_manager::skip_string(), str_CDATA, and byte_manager::throw_exception().

Referenced by parseContent().

xml_forceinline void xml_processor::parseCharData (  )  [private]

parses char data - text node inline wrapper

Definition at line 180 of file parsexml.hpp.

References _parseCharData(), _preserve_white_space, ch_open_angle, byte_manager::pick(), and byte_manager::skip_white_space().

Referenced by parseContent().

void xml_processor::parseGeneralReference ( bool  skip_after  )  [private]

parses general reference [67] Reference ::= EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [66] CharRef ::= '&#' [0-9]+ ';' | '&x' [0-9a-fA-F]+ ';'

Parameters:
skip_after  flag to skip white spaces after

Definition at line 584 of file parsexml.cpp.

References byte_manager::_tmp_store1, paged_buffer::persist(), byte_manager::push(), paged_buffer::reset(), byte_manager::resolveEntity(), and byte_manager::skip_white_space().

Referenced by parseAttributes(), parseElement(), and parseStartTag().

void xml_processor::skipDTD (  )  [private]

parses DTD but does not build grammar

Definition at line 568 of file parsexml.cpp.

References byte_manager::_big_pool, byte_manager::_small_pool, byte_manager::_stream, byte_manager::_xml_size, dtd_processor::parse(), and byte_manager::pop().

Referenced by parseDocTypeDecl().

void xml_processor::resolve_references (  )  [private]

resolves references

Definition at line 578 of file parsexml.cpp.

References _doc, and xml_grammar::resolve_references().

Referenced by parse().


Member Data Documentation

flag to preserve white spaces

Definition at line 160 of file parsexml.h.

Referenced by _parseCharData(), parse(), parseAttributes(), parseCharData(), parseEndTag(), and parseStartTag().

last error

Definition at line 163 of file parsexml.h.

Referenced by get_error(), and parse().

bool xml_processor::_validate [private]

flag to do validation

Definition at line 164 of file parsexml.h.

Referenced by parseEndTag(), and parseStartTag().


The documentation for this class was generated from the following files:


© Copyright Terimber 2003-.