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

DTD rules internal presentation. More...

#include <sxs.h>

Inheritance diagram for xml_grammar:

xml_document

List of all members.

Public Member Functions

 xml_grammar (mem_pool_t &small_manager, mem_pool_t &big_manager, size_t xml_size)
 constructor
 ~xml_grammar ()
 destructor
xml_grammarcopy (const xml_grammar &x)
 makes a full copy of external gramma
elementDecladd_element_decl (const char *name, bool on_fly, bool fromDecl, bool modelAny)
 adds element declaration to the grammar
elementDeclfind_element_decl (const char *name)
 tries to find the element declaration by name
const elementDeclfind_element_decl (const char *name) const
 tries to find the const element declaration by name
notationDecladd_notation_decl (const char *name)
 adds the notation declaration to the grammar
const notationDeclfind_notation_decl (const char *name) const
 tries to find the const by name
entityDecladd_entity_decl (const char *name, bool &wasAdded)
 adds the entity declaration to the grammar
entityDeclfind_entity_decl (const char *name)
 finds the entity declaration by name
const entityDeclfind_entity_decl (const char *name) const
 finds the const entity declaration by name
attributeDecladd_attribute_decl (const elementDecl &decl, const char *name, bool mustPresent, bool &wasAdded)
 adds/finds the attribute declaration to the grammar
const attributeDeclfind_attribute_decl (const elementDecl &decl, const char *name) const
 finds the attribute by name and parent element declaration
attributeRefDecladd_reference_decl (const char *name, bool fromID)
 adds the reference to the declaration
attributeRefDeclfind_reference_decl (const char *name)
 finds the attribute refrence declaration
void resolve_references ()
 resolves all refrences to the their attribute
namedNodeDecladd_pi_decl (const char *name)
 adds PI declaration
const namedNodeDeclfind_pi_decl (const char *name) const
 tries to find the pi declaration by pi name
byte_allocatorget_data_allocator ()
 gets the data allocator
byte_allocatorget_tmp_allocator ()
 gets the temporary allocator
const namedNodeDeclget_document_decl () const
 gets the document declaration
const namedNodeDeclget_doctype_decl () const
 gets the DTD node declaration
const namedNodeDeclget_comment_decl () const
 gets the comment declaration
const namedNodeDeclget_cdata_decl () const
 gets the cdata declaration
void clear ()
 clears resources
const element_decl_map_tget_elementMap () const
 returns element map
const namednode_decl_map_tget_piMap () const
 returns pi map
const entity_decl_map_tget_entityMap () const
 returns entity map
const notation_decl_map_tget_notationMap () const
 gets the notation map

Public Attributes

string_t _doc_name
 document name
string_t _public_id
 public ident
string_t _system_id
 system ident

Protected Attributes

mem_pool_t_small_manager
 small memory pool
mem_pool_t_big_manager
 big memory pool
size_t _xml_size
 xml size - just a tip
byte_allocator_data_allocator
 data allocator
byte_allocator_tmp_allocator
 temporary allocator
element_decl_map_t _elementMap
 element map
notation_decl_map_t _notationMap
 notation map
entity_decl_map_t _entityMap
 entity map
attribute_ref_decl_map_t _attributeRefMap
 attribute refrence map
namednode_decl_map_t _piMap
 pi map
namedNodeDecl _document_decl
 node declaration we need as a single instance
namedNodeDecl _doctype_decl
 dtd node declaration
namedNodeDecl _text_decl
 text node declaration
namedNodeDecl _comment_decl
 comment node declaration
namedNodeDecl _cdata_decl
 cdata node declaration
bool _read_only
 flag read-only grammar

Private Member Functions

 xml_grammar (const xml_grammar &x)
 copy constructor
xml_grammaroperator= (const xml_grammar &x)
 assign operator
xml_forceinline void check_readonly ()
 checks if this grammar is read-only


Detailed Description

DTD rules internal presentation.

Definition at line 362 of file sxs.h.


Constructor & Destructor Documentation

xml_grammar::xml_grammar ( const xml_grammar x  )  [private]

copy constructor

prevent copy

xml_grammar::xml_grammar ( mem_pool_t small_manager,
mem_pool_t big_manager,
size_t  xml_size 
)

constructor

Parameters:
small_manager  small memory pool
big_manager  big memory pool
xml_size  xml size - just a tip

Definition at line 278 of file sxs.cpp.

xml_grammar::~xml_grammar (  ) 


Member Function Documentation

xml_grammar& xml_grammar::operator= ( const xml_grammar x  )  [private]

assign operator

xml_grammar & xml_grammar::copy ( const xml_grammar x  ) 

makes a full copy of external gramma

Parameters:
x  input value

Definition at line 304 of file sxs.cpp.

References _attributeRefMap, elementDecl::_attributes, attributeDecl::_atype, elementDecl::_content, attributeDecl::_ctype, _data_allocator, attributeRefDecl::_declared, attributeDecl::_defval, _doc_name, _elementMap, _entityMap, attributeDecl::_enum, enumNodeDecl::_id, entityDecl::_is_encoded_char, entityDecl::_is_in_subset, entityDecl::_is_parameter, entityDecl::_is_unparsed, namedNode::_name, entityDecl::_notation, _notationMap, _piMap, _public_id, entityDecl::_publicId, notationDecl::_publicId, _read_only, attributeRefDecl::_refered, attributeDecl::_rule, _system_id, entityDecl::_systemId, notationDecl::_systemId, elementDecl::_token, enumNodeDecl::_value, entityDecl::_value, byte_allocator::allocate(), dfa_token::assign(), base_map< K, T, Pr, M >::begin(), check_pointer(), base_map< K, T, Pr, M >::clear(), base_map< size_t, attributeDecl, less< size_t >, M >::const_iterator, base_map< size_t, elementDecl, less< size_t >, M >::const_iterator, base_map< size_t, namedNodeDecl, less< size_t >, M >::const_iterator, base_map< size_t, attributeRefDecl, less< size_t >, M >::const_iterator, base_map< size_t, entityDecl, less< size_t >, M >::const_iterator, base_map< size_t, notationDecl, less< size_t >, M >::const_iterator, base_map< K, T, Pr, M >::end(), _map< K, T, A, Pr, M >::insert(), PROCESSING_INSTRUCTION_NODE, and _list< T, A >::push_back().

Referenced by xml_document::xml_document().

elementDecl & xml_grammar::add_element_decl ( const char *  name,
bool  on_fly,
bool  fromDecl,
bool  modelAny 
)

elementDecl * xml_grammar::find_element_decl ( const char *  name  ) 

const elementDecl * xml_grammar::find_element_decl ( const char *  name  )  const

tries to find the const element declaration by name

Parameters:
name  element declaration name

Definition at line 439 of file sxs.cpp.

References _elementMap, base_map< size_t, elementDecl, less< size_t >, M >::const_iterator, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, os_minus_one, and pair< T1, T2 >::second.

notationDecl & xml_grammar::add_notation_decl ( const char *  name  ) 

const notationDecl * xml_grammar::find_notation_decl ( const char *  name  )  const

entityDecl & xml_grammar::add_entity_decl ( const char *  name,
bool &  wasAdded 
)

entityDecl * xml_grammar::find_entity_decl ( const char *  name  ) 

const entityDecl * xml_grammar::find_entity_decl ( const char *  name  )  const

finds the const entity declaration by name

Parameters:
name  entity declaration name

Definition at line 534 of file sxs.cpp.

References _entityMap, base_map< size_t, entityDecl, less< size_t >, M >::const_iterator, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, os_minus_one, and pair< T1, T2 >::second.

attributeDecl & xml_grammar::add_attribute_decl ( const elementDecl decl,
const char *  name,
bool  mustPresent,
bool &  wasAdded 
)

adds/finds the attribute declaration to the grammar

Parameters:
decl  parent element declaration
name  attibute name
mustPresent  flag attribute must be found
wasAdded  flag if attribute has been created

Definition at line 566 of file sxs.cpp.

References elementDecl::_attributes, elementDecl::_content, _data_allocator, namedNode::_name, ATTR_RULE_IMPLIED, ATTR_TYPE_CDATA, check_readonly(), CONTENT_ANY, do_hash(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, _map< K, T, A, Pr, M >::insert(), base_map< size_t, attributeDecl, less< size_t >, M >::iterator, os_minus_one, pair< T1, T2 >::second, vt_string, and xml_exception_throw().

Referenced by xml_document::add_attribute(), and dtd_processor::parseAttDef().

const attributeDecl * xml_grammar::find_attribute_decl ( const elementDecl decl,
const char *  name 
) const

attributeRefDecl & xml_grammar::add_reference_decl ( const char *  name,
bool  fromID 
)

attributeRefDecl * xml_grammar::find_reference_decl ( const char *  name  ) 

void xml_grammar::resolve_references (  ) 

const namedNodeDecl * xml_grammar::find_pi_decl ( const char *  name  )  const

byte_allocator & xml_grammar::get_data_allocator (  )  [inline]

gets the data allocator

Reimplemented in xml_document.

Definition at line 47 of file sxs.hpp.

References _data_allocator.

byte_allocator & xml_grammar::get_tmp_allocator (  )  [inline]

gets the temporary allocator

Reimplemented in xml_document.

Definition at line 54 of file sxs.hpp.

References _tmp_allocator.

const namedNodeDecl * xml_grammar::get_document_decl (  )  const [inline]

gets the document declaration

Definition at line 61 of file sxs.hpp.

References _document_decl.

Referenced by xml_document::clear().

const namedNodeDecl * xml_grammar::get_doctype_decl (  )  const [inline]

gets the DTD node declaration

Definition at line 68 of file sxs.hpp.

References _doctype_decl.

const namedNodeDecl * xml_grammar::get_comment_decl (  )  const [inline]

gets the comment declaration

Definition at line 75 of file sxs.hpp.

References _comment_decl.

const namedNodeDecl * xml_grammar::get_cdata_decl (  )  const [inline]

gets the cdata declaration

Definition at line 82 of file sxs.hpp.

References _cdata_decl.

void xml_grammar::clear (  )  [inline]

const element_decl_map_t & xml_grammar::get_elementMap (  )  const [inline]

returns element map

Definition at line 105 of file sxs.hpp.

References _elementMap.

Referenced by xml_persistor::persistDocType().

const namednode_decl_map_t & xml_grammar::get_piMap (  )  const [inline]

returns pi map

Definition at line 112 of file sxs.hpp.

References _piMap.

const entity_decl_map_t & xml_grammar::get_entityMap (  )  const [inline]

returns entity map

Definition at line 119 of file sxs.hpp.

References _entityMap.

Referenced by xml_persistor::persistDocType().

const notation_decl_map_t & xml_grammar::get_notationMap (  )  const [inline]

gets the notation map

Definition at line 126 of file sxs.hpp.

References _notationMap.

Referenced by xml_persistor::persistDocType().

xml_forceinline void xml_grammar::check_readonly (  )  [private]


Member Data Documentation

small memory pool

Definition at line 501 of file sxs.h.

Referenced by xml_document::get_small_manager(), and ~xml_grammar().

big memory pool

Definition at line 502 of file sxs.h.

Referenced by xml_document::get_big_manager(), and ~xml_grammar().

size_t xml_grammar::_xml_size [protected]

xml size - just a tip

Definition at line 503 of file sxs.h.

Referenced by ~xml_grammar().

element map

Definition at line 506 of file sxs.h.

Referenced by add_element_decl(), clear(), copy(), find_element_decl(), and get_elementMap().

notation map

Definition at line 507 of file sxs.h.

Referenced by add_notation_decl(), clear(), copy(), find_notation_decl(), and get_notationMap().

entity map

Definition at line 508 of file sxs.h.

Referenced by add_entity_decl(), clear(), copy(), find_entity_decl(), and get_entityMap().

attribute refrence map

Definition at line 509 of file sxs.h.

Referenced by add_reference_decl(), clear(), copy(), find_reference_decl(), and resolve_references().

pi map

Definition at line 510 of file sxs.h.

Referenced by add_pi_decl(), clear(), copy(), find_pi_decl(), and get_piMap().

node declaration we need as a single instance

document node declaration

Definition at line 513 of file sxs.h.

Referenced by get_document_decl().

dtd node declaration

Definition at line 514 of file sxs.h.

Referenced by xml_document::clear(), and get_doctype_decl().

text node declaration

Definition at line 515 of file sxs.h.

Referenced by xml_document::add_text().

comment node declaration

Definition at line 516 of file sxs.h.

Referenced by xml_document::add_comment(), and get_comment_decl().

cdata node declaration

Definition at line 517 of file sxs.h.

Referenced by xml_document::add_cdata(), and get_cdata_decl().

bool xml_grammar::_read_only [protected]

flag read-only grammar

Definition at line 518 of file sxs.h.

Referenced by check_readonly(), and copy().


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


© Copyright Terimber 2003-.