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

class supports xml parsing, navigating, construction, and persistence More...

#include <xmlaccss.h>

Inheritance diagram for xml_designer:

xml_designer_impl

List of all members.

Public Member Functions

virtual ~xml_designer ()
 destructor
virtual bool load (const char *name, const char *grammar)=0
 loads xml from file if the name is not null and the grammar is not null then parses external xml according to the provided external grammar if the name is not null and the grammar is null then parses external xml according to the internal grammar if specified if the name is null and the grammar is not null then parses external grammar and clear internal document if the name is null and the grammar is not null
virtual bool load (const void *buffer, size_t length, const char *grammar)=0
 loads xml from memory DTD data comes from file
virtual bool load (const char *name, const void *grammar, size_t grammar_length)=0
 loads xml from file DTD data comes from memory
virtual bool load (const void *buffer, size_t length, const void *grammar, size_t grammar_length)=0
 loads xml from memory DTD data comes from memory
virtual const char * error () const =0
 returns the last error
virtual void select_document () const =0
 resets navigator to the document
virtual bool select_root () const =0
 resets navigator to the root element
virtual bool has_children () const =0
 checks the presence of children
virtual bool select_first_child () const =0
 navigates to the next level looking for the first child
virtual bool select_last_child () const =0
 navigates to the next level looking for the last child
virtual bool select_parent () const =0
 navigates up a level
virtual bool has_attributes () const =0
 checks attributes presence
virtual bool select_first_attribute () const =0
 navigates to the first attribute
virtual bool select_last_attribute () const =0
 navigates to the last attribute
virtual bool select_attribute_by_name (const char *name) const =0
 navigates to the attribute by name
virtual bool select_next_sibling () const =0
 navigates through the same level go to the next node for attributes and nodes
virtual bool select_prev_sibling () const =0
 navigates through the same level go to the previous node for attributes and nodes
virtual xmlNodeType get_type () const =0
 returns type of the current node
virtual const char * get_name () const =0
 returns name of the current node text, comment, cdata - name == null element, attribute - name == name document, doc_type - document name processing instruction - name == target
virtual const char * get_value () const =0
 returns value of the current node for attributes this is an attribute value for element this is a text for processing instruction - instruction text for cdata, comment - text NB!!! value is allocated on temporary allocator char pointer will be valid until next function call
virtual const char * get_xpath () const =0
 returns the xpath (a/b/c format, where a root element c is current element) of the current node NB!!! value is allocated on temporary allocator char pointer will be valid until next function call
virtual bool select_xpath (const char *path) const =0
 global navigation looking for element specified according to format (a/b/c)
virtual bool save (const char *name, bool add_doc_type) const =0
 save xml to file adding DTD is optional
virtual bool save (void *buffer, size_t &length, bool add_doc_type) const =0
 saves xml to memory adding DTD is optional if buffer is null function returns the required memory size through length
virtual bool add_child (xmlNodeType type, const char *name, const char *value, bool dont_move)=0
 add node as a child to the current node
virtual bool insert_sibling (xmlNodeType type, const char *name, const char *value, bool dont_move)=0
 inserts node before current node beneath the same parent
virtual bool append_sibling (xmlNodeType type, const char *name, const char *value, bool dont_move)=0
 appends node after current node beneath the same parent
virtual bool remove_node ()=0
 removes the current node
virtual bool update_value (const char *value)=0
 update the current node attribute value == value processing instruction value = text cdata, text, comment value == text
virtual bool merge (const xml_designer *x, bool recursive)=0
 adds, beneath the current node, an external xml fragment starting with the current node
virtual bool validate (bool recursive)=0
 validates the xml node accorging to the current grammar


Detailed Description

class supports xml parsing, navigating, construction, and persistence

Definition at line 35 of file xmlaccss.h.


Constructor & Destructor Documentation

virtual xml_designer::~xml_designer (  )  [inline, virtual]

destructor

Definition at line 40 of file xmlaccss.h.


Member Function Documentation

virtual bool xml_designer::load ( const char *  name,
const char *  grammar 
) [pure virtual]

loads xml from file if the name is not null and the grammar is not null then parses external xml according to the provided external grammar if the name is not null and the grammar is null then parses external xml according to the internal grammar if specified if the name is null and the grammar is not null then parses external grammar and clear internal document if the name is null and the grammar is not null

Parameters:
name  xml file name
grammar  external DTD file

Implemented in xml_designer_impl.

Referenced by xml_designer_creator::activate(), var_object_repository::process_error(), var_object_repository::process_query(), and vardatabase::process_xml_request().

virtual bool xml_designer::load ( const void *  buffer,
size_t  length,
const char *  grammar 
) [pure virtual]

loads xml from memory DTD data comes from file

Parameters:
buffer  memory buffer
length  buffer length
grammar  external DTD file

Implemented in xml_designer_impl.

virtual bool xml_designer::load ( const char *  name,
const void *  grammar,
size_t  grammar_length 
) [pure virtual]

loads xml from file DTD data comes from memory

Parameters:
name  xml file name
grammar  DTD memory buffer
grammar_length  buffer length

Implemented in xml_designer_impl.

virtual bool xml_designer::load ( const void *  buffer,
size_t  length,
const void *  grammar,
size_t  grammar_length 
) [pure virtual]

loads xml from memory DTD data comes from memory

Parameters:
buffer  xml memory buffer
length  xml buffer length
grammar  DTD memory buffer
grammar_length  DTD buffer length

Implemented in xml_designer_impl.

virtual const char* xml_designer::error (  )  const [pure virtual]

returns the last error

Implemented in xml_designer_impl.

Referenced by vardatabase::process_xml_request().

virtual void xml_designer::select_document (  )  const [pure virtual]

resets navigator to the document

Implemented in xml_designer_impl.

virtual bool xml_designer::select_root (  )  const [pure virtual]

resets navigator to the root element

Implemented in xml_designer_impl.

Referenced by msg_communicator::init(), and vardatabase::process_xml_request().

virtual bool xml_designer::has_children (  )  const [pure virtual]

checks the presence of children

Implemented in xml_designer_impl.

Referenced by msg_communicator::init(), and msg_communicator::parse_listener().

virtual bool xml_designer::select_last_child (  )  const [pure virtual]

navigates to the next level looking for the last child

Implemented in xml_designer_impl.

virtual bool xml_designer::has_attributes (  )  const [pure virtual]

checks attributes presence

attribute navigation

Implemented in xml_designer_impl.

Referenced by msg_communicator::init().

virtual bool xml_designer::select_first_attribute (  )  const [pure virtual]

navigates to the first attribute

Implemented in xml_designer_impl.

Referenced by xml_designer_impl::merge().

virtual bool xml_designer::select_last_attribute (  )  const [pure virtual]

navigates to the last attribute

Implemented in xml_designer_impl.

virtual bool xml_designer::select_next_sibling (  )  const [pure virtual]

virtual bool xml_designer::select_prev_sibling (  )  const [pure virtual]

navigates through the same level go to the previous node for attributes and nodes

Implemented in xml_designer_impl.

virtual const char* xml_designer::get_name (  )  const [pure virtual]

returns name of the current node text, comment, cdata - name == null element, attribute - name == name document, doc_type - document name processing instruction - name == target

Implemented in xml_designer_impl.

Referenced by msg_communicator::init(), xml_designer_impl::merge(), msg_communicator::parse_listener(), var_object_repository::process_group(), var_object_repository::process_where(), and vardatabase::process_xml_request().

virtual const char* xml_designer::get_value (  )  const [pure virtual]

returns value of the current node for attributes this is an attribute value for element this is a text for processing instruction - instruction text for cdata, comment - text NB!!! value is allocated on temporary allocator char pointer will be valid until next function call

Implemented in xml_designer_impl.

Referenced by vardatabase::fill_schema(), msg_communicator::init(), xml_designer_impl::merge(), msg_communicator::parse_connection(), msg_communicator::parse_listener(), var_object_repository::process_condition(), var_object_repository::process_group(), var_object_repository::process_query(), var_object_repository::process_returns(), var_object_repository::process_values(), and vardatabase::process_xml_request().

virtual const char* xml_designer::get_xpath (  )  const [pure virtual]

returns the xpath (a/b/c format, where a root element c is current element) of the current node NB!!! value is allocated on temporary allocator char pointer will be valid until next function call

Implemented in xml_designer_impl.

virtual bool xml_designer::select_xpath ( const char *  path  )  const [pure virtual]

global navigation looking for element specified according to format (a/b/c)

Parameters:
path  xpath

Implemented in xml_designer_impl.

Referenced by var_object_repository::process_query().

virtual bool xml_designer::save ( const char *  name,
bool  add_doc_type 
) const [pure virtual]

save xml to file adding DTD is optional

Parameters:
name  file name
add_doc_type  flag save the grammar to the output xml

Implemented in xml_designer_impl.

virtual bool xml_designer::save ( void *  buffer,
size_t &  length,
bool  add_doc_type 
) const [pure virtual]

saves xml to memory adding DTD is optional if buffer is null function returns the required memory size through length

Parameters:
buffer  output buffer
length  buffer length
add_doc_type  flag save the grammar to the output xml

Implemented in xml_designer_impl.

virtual bool xml_designer::add_child ( xmlNodeType  type,
const char *  name,
const char *  value,
bool  dont_move 
) [pure virtual]

add node as a child to the current node

node management element, attribute - name == name text, cdata, comment - name is ignored processing instruction - name == target

Parameters:
type  xml node type
name  name
value  value
dont_move  do not navigate from current position

Implemented in xml_designer_impl.

Referenced by var_object_repository::process_error(), var_object_repository::process_query(), and vardatabase::process_xml_request().

virtual bool xml_designer::insert_sibling ( xmlNodeType  type,
const char *  name,
const char *  value,
bool  dont_move 
) [pure virtual]

inserts node before current node beneath the same parent

Parameters:
type  xml node type
name  name
value  value
dont_move  do not navigate from current position

Implemented in xml_designer_impl.

virtual bool xml_designer::append_sibling ( xmlNodeType  type,
const char *  name,
const char *  value,
bool  dont_move 
) [pure virtual]

appends node after current node beneath the same parent

Parameters:
type  xml node type
name  name
value  value
dont_move  do not navigate from current position

Implemented in xml_designer_impl.

virtual bool xml_designer::remove_node (  )  [pure virtual]

removes the current node

Implemented in xml_designer_impl.

virtual bool xml_designer::update_value ( const char *  value  )  [pure virtual]

update the current node attribute value == value processing instruction value = text cdata, text, comment value == text

Parameters:
value  value

Implemented in xml_designer_impl.

virtual bool xml_designer::merge ( const xml_designer x,
bool  recursive 
) [pure virtual]

adds, beneath the current node, an external xml fragment starting with the current node

Parameters:
x  source xml document
recursive  merge recursively

Implemented in xml_designer_impl.

virtual bool xml_designer::validate ( bool  recursive  )  [pure virtual]

validates the xml node accorging to the current grammar

Parameters:
recursive  validate recursively

Implemented in xml_designer_impl.


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


© Copyright Terimber 2003-.