xml::impl Namespace Reference


Classes

struct  cbfo_node_compare
struct  sort_callback
class  ait_impl
 the class that does all the work behind xml::attributes::iterator and xml::attributes::const_iterator. More...
struct  doc_impl
class  dtd_impl
struct  epimpl
struct  node_impl
struct  node_cmp
struct  nipimpl
class  iter_advance_functor
class  node_iterator
struct  nset_impl
class  pimpl_base
struct  tree_impl
class  xmlchar_helper

Functions

xmlAttrPtr find_prop (xmlNodePtr xmlnode, const char *name)
xmlAttributePtr find_default_prop (xmlNodePtr xmlnode, const char *name)
bool operator== (const ait_impl &lhs, const ait_impl &rhs)
bool operator!= (const ait_impl &lhs, const ait_impl &rhs)
xmlNodePtr node_insert (xmlNodePtr parent, xmlNodePtr before, xmlNodePtr to_add)
 Insert a node somewhere in the child list of a parent node.
xmlNodePtr node_replace (xmlNodePtr old_node, xmlNodePtr new_node)
 Replace a node with another one.
xmlNodePtr node_erase (xmlNodePtr to_erase)
 Erase a node from the child list, and then free it from memory.
void set_children_default_ns (xmlNodePtr node, xmlNsPtr default_ns)
 Set the node and its children default namespace to the given.
bool has_default_ns_definition (xmlNodePtr node)
 Check if the node holds default namespace definition.
bool is_ns_used (xmlNodePtr node, xmlNsPtr ns)
 Check if the node, attributes and children use the namespace.
void update_children_default_ns (xmlNodePtr node, xmlNsPtr newns)
 Replaces the node and its children default namespace with the given.
void erase_ns_definition (xmlNodePtr node, xmlNsPtr definition)
 Erases namespace definition in the node.
xmlNsPtr lookup_ns_definition (xmlNodePtr node, const char *prefix)
 Searches for a namspace definition in the given node.
void replace_ns (xmlNodePtr node, xmlNsPtr oldNs, xmlNsPtr newNs)
 Replaces old namspace with a new one in nodes and attributes all the way down in the hierarchy.
void printf2string (std::string &s, const char *message, va_list ap)


Function Documentation

void xml::impl::erase_ns_definition xmlNodePtr  node,
xmlNsPtr  definition
 

Erases namespace definition in the node.

libxml2 namespace is freed. The function does not check whether the namespace is used.

Parameters:
node The node to delete from.
definition The namespace to be erased
Author:
Sergey Satskiy, NCBI

Definition at line 160 of file node_manip.cpp.

Referenced by xml::node::erase_duplicate_ns_defs_single_node(), xml::node::erase_namespace_definition(), and xml::node::erase_unused_ns_defs().

xmlAttributePtr xml::impl::find_default_prop xmlNodePtr  xmlnode,
const char *  name
 

Definition at line 371 of file ait_impl.cpp.

Referenced by xml::attributes::find().

xmlAttrPtr xml::impl::find_prop xmlNodePtr  xmlnode,
const char *  name
 

Definition at line 359 of file ait_impl.cpp.

Referenced by xml::attributes::find().

bool xml::impl::has_default_ns_definition xmlNodePtr  node  ) 
 

Check if the node holds default namespace definition.

Parameters:
node The node to be checked.
Returns:
true if the node holds default namespace definition.
Author:
Sergey Satskiy, NCBI

Definition at line 119 of file node_manip.cpp.

Referenced by set_children_default_ns(), and update_children_default_ns().

bool xml::impl::is_ns_used xmlNodePtr  node,
xmlNsPtr  ns
 

Check if the node, attributes and children use the namespace.

Parameters:
node The node to be checked.
ns The namespace to match (pointer comparison is used)
Returns:
true if the namespace is used
Author:
Sergey Satskiy, NCBI

Definition at line 129 of file node_manip.cpp.

Referenced by xml::node::erase_namespace_definition(), and xml::node::erase_unused_ns_defs().

xmlNsPtr xml::impl::lookup_ns_definition xmlNodePtr  node,
const char *  prefix
 

Searches for a namspace definition in the given node.

Parameters:
node The node to search in.
prefix The namespace definition prefix
Returns:
pointer to the namespace definition or NULL if not found
Author:
Sergey Satskiy, NCBI

Definition at line 175 of file node_manip.cpp.

Referenced by xml::node::erase_namespace_definition().

xmlNodePtr xml::impl::node_erase xmlNodePtr  to_erase  ) 
 

Erase a node from the child list, and then free it from memory.

Parameters:
to_erase The node to remove and free.
Returns:
The node that was after to_erase (may be 0 (null) if to_erase was the last node in the list)
Author:
Peter Jones

Definition at line 98 of file node_manip.cpp.

Referenced by xml::node::erase(), and xml::document::erase().

xmlNodePtr xml::impl::node_insert xmlNodePtr  parent,
xmlNodePtr  before,
xmlNodePtr  to_add
 

Insert a node somewhere in the child list of a parent node.

Parameters:
parent The parent who's child list will be inserted into.
before Insert to_add before this node, or, if this node is 0 (null), insert at the end of the child list.
to_add The node to be copied and then inserted into the child list.
Returns:
The new node that was inserted into the child list.
Author:
Peter Jones

Definition at line 56 of file node_manip.cpp.

References set_children_default_ns().

Referenced by xml::node::insert(), xml::document::insert(), xml::node::push_back(), and xml::document::push_back().

xmlNodePtr xml::impl::node_replace xmlNodePtr  old_node,
xmlNodePtr  new_node
 

Replace a node with another one.

The node being replaced will be freed from memory.

Parameters:
old_node The old node to remove and free.
new_node The new node to copy and insert where old node was.
Returns:
The new node that was crated from copying new_node and inserted into the child list where old_node was.
Author:
Peter Jones

Definition at line 77 of file node_manip.cpp.

References set_children_default_ns().

Referenced by xml::node::replace().

bool xml::impl::operator!= const ait_impl lhs,
const ait_impl rhs
 

Definition at line 415 of file ait_impl.cpp.

bool xml::impl::operator== const ait_impl lhs,
const ait_impl rhs
 

Definition at line 410 of file ait_impl.cpp.

References xml::impl::ait_impl::fake_, and xml::impl::ait_impl::xmlattr_.

void xml::impl::printf2string std::string &  s,
const char *  message,
va_list  ap
 

Definition at line 57 of file utility.cpp.

References buffer, size, and vsnprintf.

Referenced by cb_error(), cb_tree_error(), cb_warning(), dtd_error(), and error_cb().

void xml::impl::replace_ns xmlNodePtr  node,
xmlNsPtr  oldNs,
xmlNsPtr  newNs
 

Replaces old namspace with a new one in nodes and attributes all the way down in the hierarchy.

Parameters:
node The node to start with.
oldNs The old namespace
newNs The new namespace
Author:
Sergey Satskiy, NCBI

Definition at line 188 of file node_manip.cpp.

Referenced by xml::node::erase_duplicate_ns_defs_single_node().

void xml::impl::set_children_default_ns xmlNodePtr  node,
xmlNsPtr  default_ns
 

Set the node and its children default namespace to the given.

It is necessary to do when a node is inserted into a document which has a default namespace declared.

Parameters:
node The node to start from.
default_ns The pointer to the document default namespace
Author:
Sergey Satskiy, NCBI

Definition at line 107 of file node_manip.cpp.

References has_default_ns_definition().

Referenced by node_insert(), and node_replace().

void xml::impl::update_children_default_ns xmlNodePtr  node,
xmlNsPtr  newns
 

Replaces the node and its children default namespace with the given.

It is required when a default namespace definition is added to the node.

Parameters:
node The node to start from.
newns The namespace to be set
Author:
Sergey Satskiy, NCBI

Definition at line 147 of file node_manip.cpp.

References has_default_ns_definition().

Referenced by xml::node::add_namespace_def().


Generated on Mon Dec 7 16:19:14 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:40 2009 by modify_doxy.py rev. 173732