Home / Open source / Terimber 2.0
xml_persistor Class Referenceclass save internal xml document into stream
More...
#include <persxml.h>
List of all members.
Detailed Description
class save internal xml document into stream
Definition at line 45 of file persxml.h.
Constructor & Destructor Documentation
xml_persistor::~xml_persistor |
( |
|
) |
|
Member Function Documentation
bool xml_persistor::persist |
( |
|
) |
|
saves xml to stream
Definition at line 84 of file persxml.cpp.
References xml_node::_decl, _doc, _element_stack, _error, _in_doc_type, _stack_allocator, _stream, ATTRIBUTE_NODE, CDATA_SECTION_NODE, base_stack< T >::clear(), COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, base_stack< T >::empty(), ENTITY_NODE, byte_consumer::flush(), nodeDecl::get_type(), NOTATION_NODE, persistAttributes(), persistCDATA(), persistComment(), persistDocType(), persistDocument(), persistElement(), persistElementDecl(), persistEntityDecl(), persistNotationDecl(), persistPI(), persistText(), PROCESSING_INSTRUCTION_NODE, _stack< T, A >::push(), byte_allocator::reset(), TEXT_NODE, base_stack< T >::top(), and exception::what().
Referenced by xml_designer_impl::save().
const char * xml_persistor::get_error |
( |
|
) |
const |
void xml_persistor::persistDocument |
( |
|
) |
[protected] |
persists document
Definition at line 213 of file persxml.cpp.
References _doc, _element_stack, xml_container::_first_child, _stack_allocator, xml_document::_standalone, _stream, ch_cr, ch_lf, _stack< T, A >::push(), byte_consumer::push(), restore_stack(), and base_stack< T >::top().
Referenced by persist().
void xml_persistor::persistDocType |
( |
|
) |
[protected] |
persists DTD
Definition at line 234 of file persxml.cpp.
References _doc, xml_grammar::_doc_name, _element_stack, xml_container::_first_child, _in_doc_type, xml_grammar::_public_id, xml_tree_node::_right, _save_doc_type, _stack_allocator, _stream, xml_grammar::_system_id, base_map< K, T, Pr, M >::begin(), ch_bang, ch_close_angle, ch_cr, ch_double_quote, ch_lf, ch_open_angle, ch_open_square, ch_space, base_map< size_t, elementDecl, less< size_t >, M >::const_iterator, base_map< size_t, notationDecl, less< size_t >, M >::const_iterator, base_map< size_t, entityDecl, less< size_t >, M >::const_iterator, base_map< K, T, Pr, M >::end(), xml_grammar::get_elementMap(), xml_grammar::get_entityMap(), xml_grammar::get_notationMap(), xml_document::is_on_fly(), base_string< T >::length(), persistElementDecl(), persistEntityDecl(), persistNotationDecl(), _stack< T, A >::pop(), _stack< T, A >::push(), byte_consumer::push(), restore_stack(), str_DOCTYPE, str_PUBLIC, str_SYSTEM, and base_stack< T >::top().
Referenced by persist().
void xml_persistor::persistElement |
( |
|
) |
[protected] |
persists xml element
Definition at line 723 of file persxml.cpp.
References xml_node::_decl, _element_stack, xml_container::_first_child, namedNode::_name, _stack_allocator, _stream, ch_close_angle, ch_cr, ch_forward_slash, ch_hor_tab, ch_lf, ch_open_angle, nodeDecl::get_type(), xml_element::has_attributes(), xml_container::has_children(), persistAttributes(), _stack< T, A >::push(), byte_consumer::push(), restore_stack(), _stack< T, A >::size(), TEXT_NODE, and base_stack< T >::top().
Referenced by persist().
void xml_persistor::persistAttributes |
( |
|
) |
[protected] |
persists attributes
Definition at line 764 of file persxml.cpp.
References _element_stack, xml_element::_first_attr, namedNode::_name, xml_tree_node::_right, _stream, _tmp_allocator, xml_value_node::_value, xml_value_node::cast_to_node_value(), ch_double_quote, ch_equal, ch_space, attributeDecl::persist_attribute(), persistValue(), byte_consumer::push(), byte_allocator::reset(), and base_stack< T >::top().
Referenced by persist(), and persistElement().
void xml_persistor::persistText |
( |
|
) |
[protected] |
void xml_persistor::persistCDATA |
( |
|
) |
[protected] |
persists CDATA section
Definition at line 788 of file persxml.cpp.
References _element_stack, _stream, xml_value_node::cast_to_node_value(), ch_bang, ch_close_angle, ch_close_square, ch_cr, ch_lf, ch_open_angle, ch_open_square, byte_consumer::push(), restore_stack(), str_CDATA, and base_stack< T >::top().
Referenced by persist().
void xml_persistor::persistComment |
( |
|
) |
[protected] |
persists comment
Definition at line 810 of file persxml.cpp.
References _element_stack, _stream, xml_value_node::cast_to_node_value(), ch_bang, ch_close_angle, ch_cr, ch_dash, ch_lf, ch_open_angle, byte_consumer::push(), restore_stack(), and base_stack< T >::top().
Referenced by persist().
void xml_persistor::persistPI |
( |
|
) |
[protected] |
persists processing instruction
Definition at line 827 of file persxml.cpp.
References xml_node::_decl, _element_stack, namedNode::_name, _stream, xml_value_node::cast_to_node_value(), ch_close_angle, ch_cr, ch_lf, ch_open_angle, ch_question, ch_space, byte_consumer::push(), restore_stack(), and base_stack< T >::top().
Referenced by persist().
void xml_persistor::persistEntityDecl |
( |
const entityDecl * |
decl = 0 |
) |
[protected] |
persists entity declaration
- Parameters:
-
decl |
optional external entity declaration |
Definition at line 333 of file persxml.cpp.
References xml_node::_decl, _element_stack, entityDecl::_is_encoded_char, entityDecl::_is_in_subset, entityDecl::_is_parameter, namedNode::_name, entityDecl::_notation, entityDecl::_publicId, _stream, entityDecl::_systemId, entityDecl::_value, ch_bang, ch_close_angle, ch_cr, ch_double_quote, ch_lf, ch_open_angle, ch_percent, ch_space, base_string< T >::length(), persistValue(), byte_consumer::push(), restore_stack(), str_ENTITY, str_NDATA, str_PUBLIC, str_SYSTEM, and base_stack< T >::top().
Referenced by persist(), and persistDocType().
void xml_persistor::persistNotationDecl |
( |
const notationDecl * |
decl = 0 |
) |
[protected] |
persists notation declaration
- Parameters:
-
decl |
optional external notation declaration |
Definition at line 425 of file persxml.cpp.
References xml_node::_decl, _element_stack, namedNode::_name, notationDecl::_publicId, _stream, notationDecl::_systemId, ch_bang, ch_close_angle, ch_cr, ch_lf, ch_open_angle, ch_space, base_string< T >::length(), byte_consumer::push(), restore_stack(), str_NOTATION, str_PUBLIC, str_SYSTEM, and base_stack< T >::top().
Referenced by persist(), and persistDocType().
void xml_persistor::persistElementDecl |
( |
const elementDecl * |
decl = 0 |
) |
[protected] |
persists element declaration
- Parameters:
-
decl |
optional external element declaration |
Definition at line 458 of file persxml.cpp.
References elementDecl::_attributes, elementDecl::_content, xml_node::_decl, _element_stack, dfa_token::_first, namedNode::_name, dfa_token::_rule, _stream, elementDecl::_token, base_map< K, T, Pr, M >::begin(), ch_asterisk, ch_bang, ch_close_angle, ch_close_paren, ch_cr, ch_lf, ch_open_angle, ch_open_paren, ch_plus, ch_question, ch_space, base_map< size_t, attributeDecl, less< size_t >, M >::const_iterator, CONTENT_ANY, CONTENT_CHILDREN, CONTENT_EMPTY, CONTENT_MIXED, DFA_ASTERISK, DFA_LEAF, DFA_PLUS, DFA_QUESTION, base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::end(), persistAttributeDecl(), persistChildren(), persistMixed(), byte_consumer::push(), restore_stack(), str_ANY, str_ATTRLIST, str_ELEMENT, str_EMPTY, and base_stack< T >::top().
Referenced by persist(), and persistDocType().
void xml_persistor::persistAttributeDecl |
( |
const attributeDecl & |
decl |
) |
[protected] |
persists
- Parameters:
-
decl |
optional external attribute declaration |
Definition at line 638 of file persxml.cpp.
References attributeDecl::_atype, attributeDecl::_defval, attributeDecl::_enum, namedNode::_name, attributeDecl::_rule, _stream, ATTR_RULE_DEFAULT, ATTR_RULE_FIXED, ATTR_RULE_IMPLIED, ATTR_RULE_REQUIRED, ATTR_TYPE_CDATA, ATTR_TYPE_ENTITIES, ATTR_TYPE_ENTITY, ATTR_TYPE_ENUMERATION, ATTR_TYPE_ID, ATTR_TYPE_IDREF, ATTR_TYPE_IDREFS, ATTR_TYPE_NMTOKEN, ATTR_TYPE_NMTOKENS, ATTR_TYPE_NOTATION, base_list< T >::begin(), ch_close_paren, ch_cr, ch_double_quote, ch_lf, ch_open_paren, ch_pipe, ch_pound, ch_space, base_list< T >::empty(), base_list< T >::end(), base_string< T >::length(), byte_consumer::push(), str_CDATA, str_ENTITIES, str_ENTITY, str_FIXED, str_ID, str_IDREF, str_IDREFS, str_IMPLIED, str_NMTOKEN, str_NMTOKENS, str_NOTATION, and str_REQUIRED.
Referenced by persistElementDecl().
void xml_persistor::persistMixed |
( |
const dfa_token * |
parent |
) |
[protected] |
persists mixed element content
- Parameters:
-
parent |
DFA element pointer |
Definition at line 551 of file persxml.cpp.
References dfa_token::_decl, dfa_token::_first, dfa_token::_last, namedNode::_name, dfa_token::_rule, _stream, ch_asterisk, 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__PCDATA.
Referenced by persistElementDecl().
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::restore_stack |
( |
bool |
makeShift = true |
) |
[protected] |
restores element stack
- Parameters:
-
makeShift |
flag to make a shift |
Definition at line 153 of file persxml.cpp.
References xml_node::_decl, _element_stack, _in_doc_type, namedNode::_name, xml_tree_node::_right, _save_doc_type, _stack_allocator, _stream, ch_close_angle, ch_close_square, ch_cr, ch_forward_slash, ch_hor_tab, ch_lf, ch_open_angle, DOCUMENT_TYPE_NODE, ELEMENT_NODE, base_stack< T >::empty(), nodeDecl::get_type(), xml_container::has_children(), _stack< T, A >::pop(), _stack< T, A >::push(), byte_consumer::push(), byte_allocator::reset(), _stack< T, A >::size(), and base_stack< T >::top().
Referenced by persistCDATA(), persistComment(), persistDocType(), persistDocument(), persistElement(), persistElementDecl(), persistEntityDecl(), persistNotationDecl(), persistPI(), and persistText().
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
output byte stream
Definition at line 129 of file persxml.h.
Referenced by persist(), persistAttributeDecl(), persistAttributes(), persistCDATA(), persistChildren(), persistComment(), persistDocType(), persistDocument(), persistElement(), persistElementDecl(), persistEntityDecl(), persistMixed(), persistNotationDecl(), persistPI(), persistValue(), and restore_stack().
xml element stack
Definition at line 133 of file persxml.h.
Referenced by persist(), persistAttributes(), persistCDATA(), persistComment(), persistDocType(), persistDocument(), persistElement(), persistElementDecl(), persistEntityDecl(), persistNotationDecl(), persistPI(), persistText(), and restore_stack().
The documentation for this class was generated from the following files:
|
|