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_persistor Class Reference

class save internal xml document into stream More...

#include <persxml.h>

List of all members.

Public Member Functions

 xml_persistor (byte_consumer &stream, const xml_document &doc, mem_pool_t &small_pool, mem_pool_t &big_pool, bool validate, bool save_doc_type, size_t size)
 constructor
 ~xml_persistor ()
 destructor
bool persist ()
 saves xml to stream
const char * get_error () const
 returns last error

Protected Member Functions

void persistDocument ()
 persists document
void persistDocType ()
 persists DTD
void persistElement ()
 persists xml element
void persistAttributes ()
 persists attributes
void persistText ()
 persists text node
void persistCDATA ()
 persists CDATA section
void persistComment ()
 persists comment
void persistPI ()
 persists processing instruction
void persistEntityDecl (const entityDecl *decl=0)
 persists entity declaration
void persistNotationDecl (const notationDecl *decl=0)
 persists notation declaration
void persistElementDecl (const elementDecl *decl=0)
 persists element declaration
void persistAttributeDecl (const attributeDecl &decl)
 persists
void persistMixed (const dfa_token *parent)
 persists mixed element content
void persistChildren (const dfa_token *parent, dfaRule prevRule)
 persists children of element
void restore_stack (bool makeShift=true)
 restores element stack
void persistValue (const char *value, bool charData=false)
 persists value

Private Attributes

const size_t _xml_size
 xml size
byte_consumer_stream
 output byte stream
const xml_document_doc
 xml document
mem_pool_t_small_pool
 small memory pool
mem_pool_t_big_pool
 big memory pool
persistor_stack_t _element_stack
 xml element stack
string_t _error
 last error
bool _validate
 validation flag
bool _save_doc_type
 flag to save DTD
byte_allocator_tmp_allocator
 temporary allocator
byte_allocator_stack_allocator
 stack allocator
bool _in_doc_type
 flag if we are inside DTD saving


Detailed Description

class save internal xml document into stream

Definition at line 45 of file persxml.h.


Constructor & Destructor Documentation

BEGIN_TERIMBER_NAMESPACE xml_persistor::xml_persistor ( byte_consumer stream,
const xml_document doc,
mem_pool_t small_pool,
mem_pool_t big_pool,
bool  validate,
bool  save_doc_type,
size_t  size 
)

constructor

Parameters:
stream  output stream
doc  xml document
small_pool  small memory pool
big_pool  big memory pool
validate  flag to do validation
save_doc_type  flag to save internal DTD to the output xml
size  xml size - just a tip

Definition at line 46 of file persxml.cpp.

References _big_pool, _small_pool, _stack_allocator, _tmp_allocator, _xml_size, pool< C >::loan_object(), and os_def_size.

xml_persistor::~xml_persistor (  ) 


Member Function Documentation

const char * xml_persistor::get_error (  )  const

returns last error

Definition at line 78 of file persxml.cpp.

References _error.

Referenced by xml_designer_impl::save().

void xml_persistor::persistDocument (  )  [protected]

void xml_persistor::persistText (  )  [protected]

persists text node

Definition at line 781 of file persxml.cpp.

References _element_stack, xml_value_node::cast_to_node_value(), persistValue(), restore_stack(), and base_stack< T >::top().

Referenced by persist().

void xml_persistor::persistCDATA (  )  [protected]

void xml_persistor::persistComment (  )  [protected]

void xml_persistor::persistPI (  )  [protected]

void xml_persistor::persistNotationDecl ( const notationDecl decl = 0  )  [protected]

void xml_persistor::persistMixed ( const dfa_token parent  )  [protected]

void xml_persistor::persistChildren ( const dfa_token parent,
dfaRule  prevRule 
) [protected]

persists children of element

Parameters:
parent  DFA element pointer
prevRule  previous DFA rule

Definition at line 593 of file persxml.cpp.

References dfa_token::_decl, dfa_token::_first, dfa_token::_last, namedNode::_name, dfa_token::_rule, _stream, ch_asterisk, ch_close_paren, ch_comma, ch_open_paren, ch_pipe, ch_plus, ch_question, DFA_ANY, DFA_ASTERISK, DFA_CHOICE, DFA_LEAF, DFA_PLUS, DFA_QUESTION, DFA_SEQUENCE, byte_consumer::push(), and str_ANY.

Referenced by persistElementDecl().

void xml_persistor::persistValue ( const char *  value,
bool  charData = false 
) [protected]

persists value

Parameters:
value  value
charData  flag if this a char data

Definition at line 848 of file persxml.cpp.

References _stream, ch_ampersand, ch_close_angle, ch_double_quote, ch_open_angle, ch_semicolon, ch_single_quote, byte_consumer::push(), str_amp, str_apos, str_gt, str_lt, and str_quote.

Referenced by persistAttributes(), persistEntityDecl(), and persistText().


Member Data Documentation

const size_t xml_persistor::_xml_size [private]

xml size

Definition at line 128 of file persxml.h.

Referenced by xml_persistor(), and ~xml_persistor().

xml document

Definition at line 130 of file persxml.h.

Referenced by persist(), persistDocType(), and persistDocument().

small memory pool

Definition at line 131 of file persxml.h.

Referenced by xml_persistor(), and ~xml_persistor().

big memory pool

Definition at line 132 of file persxml.h.

Referenced by xml_persistor(), and ~xml_persistor().

last error

Definition at line 134 of file persxml.h.

Referenced by get_error(), and persist().

bool xml_persistor::_validate [private]

validation flag

Definition at line 135 of file persxml.h.

flag to save DTD

Definition at line 136 of file persxml.h.

Referenced by persistDocType(), and restore_stack().

temporary allocator

Definition at line 137 of file persxml.h.

Referenced by persistAttributes(), xml_persistor(), and ~xml_persistor().

flag if we are inside DTD saving

Definition at line 139 of file persxml.h.

Referenced by persist(), persistDocType(), and restore_stack().


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


© Copyright Terimber 2003-.