NCBI C++ ToolKit
Classes | Functions
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  phantom_attr
 
struct  attr_instance
 
struct  node_private_data
 
struct  doc_impl
 
struct  dtd_impl
 
struct  epimpl
 
struct  node_impl
 
struct  node_cmp
 
struct  nipimpl
 
class  node_iterator
 
struct  nset_impl
 
class  pimpl_base
 
struct  schema_impl
 
class  xmlchar_helper
 
struct  ns_util
 

Functions

bool operator== (const ait_impl &lhs, const ait_impl &rhs)
 
void * get_ptr_to_attr_instance (void *)
 
node_private_dataattach_node_private_data (void *)
 
xmlAttrPtr find_prop (xmlNodePtr xmlnode, const char *name, const ns *nspace)
 
phantom_attrfind_default_prop (xmlNodePtr xmlnode, const char *name, const ns *nspace)
 
bool operator!= (const ait_impl &lhs, const ait_impl &rhs)
 
void cleanup_node (xmlNodePtr xmlnode)
 
void invalidate_default_attr_iterators (xmlNodePtr xmlnode)
 
void register_https_input (void)
 
void clear_https_messages (void)
 
void collect_https_messages (xml::error_messages &append_to)
 
void append_https_message (const std::string &msg, error_message::message_type msg_type, long line, const std::string &fname)
 
xmlNodePtr node_insert (xmlNodePtr parent, xmlNodePtr before, xmlNodePtr to_add)
 Insert a node somewhere in the child list of a parent node. More...
 
xmlNodePtr node_replace (xmlNodePtr old_node, xmlNodePtr new_node)
 Replace a node with another one. More...
 
xmlNodePtr node_erase (xmlNodePtr to_erase)
 Erase a node from the child list, and then free it from memory. More...
 
void set_children_default_ns (xmlNodePtr node, xmlNsPtr default_ns)
 Set the node and its children default namespace to the given. More...
 
bool has_default_ns_definition (xmlNodePtr node)
 Check if the node holds default namespace definition. More...
 
bool is_ns_used (xmlNodePtr node, xmlNsPtr ns)
 Check if the node, attributes and children use the namespace. More...
 
void update_children_default_ns (xmlNodePtr node, xmlNsPtr newns)
 Replaces the node and its children default namespace with the given. More...
 
void erase_ns_definition (xmlNodePtr node, xmlNsPtr definition)
 Erases namespace definition in the node. More...
 
xmlNsPtr lookup_ns_definition (xmlNodePtr node, const char *prefix)
 Searches for a namspace definition in the given node. More...
 
xmlNsPtr lookup_default_ns_above (xmlNodePtr node)
 Searches for a default namspace definition in the given node and above. More...
 
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. More...
 
void printf2string (std::string &s, const char *message, va_list ap)
 
int convert_to_libxml2_save_options (int options)
 
int save_to_stream_cb (void *ctx, const char *buf, int len)
 
int save_to_string_cb (void *ctx, const char *buf, int len)
 

Function Documentation

◆ append_https_message()

void xml::impl::append_https_message ( const std::string msg,
error_message::message_type  msg_type,
long  line,
const std::string fname 
)

Definition at line 143 of file https_input_impl.cpp.

◆ attach_node_private_data()

node_private_data * xml::impl::attach_node_private_data ( void *  )

◆ cleanup_node()

void xml::impl::cleanup_node ( xmlNodePtr  xmlnode)

◆ clear_https_messages()

void xml::impl::clear_https_messages ( void  )

◆ collect_https_messages()

void xml::impl::collect_https_messages ( xml::error_messages append_to)

◆ convert_to_libxml2_save_options()

int xml::impl::convert_to_libxml2_save_options ( int  options)

◆ erase_ns_definition()

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
nodeThe node to delete from.
definitionThe namespace to be erased
Author
Sergey Satskiy, NCBI

Definition at line 170 of file node_manip.cpp.

References prev().

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

◆ find_default_prop()

phantom_attr * xml::impl::find_default_prop ( xmlNodePtr  xmlnode,
const char *  name,
const ns nspace 
)

◆ find_prop()

xmlAttrPtr xml::impl::find_prop ( xmlNodePtr  xmlnode,
const char *  name,
const ns nspace 
)

Definition at line 512 of file ait_impl.cpp.

References column, NULL, prefix, and string.

Referenced by xml::attributes::erase(), and xml::attributes::find().

◆ get_ptr_to_attr_instance()

void * xml::impl::get_ptr_to_attr_instance ( void *  )

◆ has_default_ns_definition()

bool xml::impl::has_default_ns_definition ( xmlNodePtr  node)

Check if the node holds default namespace definition.

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

Definition at line 129 of file node_manip.cpp.

Referenced by set_children_default_ns(), and update_children_default_ns().

◆ invalidate_default_attr_iterators()

void xml::impl::invalidate_default_attr_iterators ( xmlNodePtr  xmlnode)

Definition at line 141 of file deref_impl.cpp.

References data, xml::impl::phantom_attr::def_prop_, xml::impl::phantom_attr::next, and NULL.

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

◆ is_ns_used()

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

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

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

Definition at line 139 of file node_manip.cpp.

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

◆ lookup_default_ns_above()

xmlNsPtr xml::impl::lookup_default_ns_above ( xmlNodePtr  node)

Searches for a default namspace definition in the given node and above.

Parameters
nodeThe node to start the search from.
Returns
pointer to the namespace definition or NULL if not found
Author
Sergey Satskiy, NCBI

Definition at line 198 of file node_manip.cpp.

References NULL, and xml::node::parent().

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

◆ lookup_ns_definition()

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

Searches for a namspace definition in the given node.

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

Definition at line 185 of file node_manip.cpp.

References NULL, and prefix.

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

◆ node_erase()

xmlNodePtr xml::impl::node_erase ( xmlNodePtr  to_erase)

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

Parameters
to_eraseThe 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 108 of file node_manip.cpp.

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

◆ node_insert()

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
parentThe parent who's child list will be inserted into.
beforeInsert to_add before this node, or, if this node is 0 (null), insert at the end of the child list.
to_addThe 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 54 of file node_manip.cpp.

References NULL, and set_children_default_ns().

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

◆ node_replace()

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_nodeThe old node to remove and free.
new_nodeThe 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 75 of file node_manip.cpp.

References NULL, and set_children_default_ns().

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

◆ operator!=()

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

Definition at line 656 of file ait_impl.cpp.

◆ operator==()

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

◆ printf2string()

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

Definition at line 79 of file utility.cpp.

References buffer, ncbi::grid::netcache::search::fields::size, and vsnprintf.

Referenced by cb_error(), cb_fatal_error(), and cb_warning().

◆ register_https_input()

void xml::impl::register_https_input ( void  )

Definition at line 110 of file https_input_impl.cpp.

Referenced by xml::init::init_library().

◆ replace_ns()

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
nodeThe node to start with.
oldNsThe old namespace
newNsThe new namespace
Author
Sergey Satskiy, NCBI

Definition at line 211 of file node_manip.cpp.

References NULL.

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

◆ save_to_stream_cb()

int xml::impl::save_to_stream_cb ( void *  ctx,
const char *  buf,
int  len 
)

Definition at line 177 of file utility.cpp.

References buf, ctx, and len.

Referenced by xml::operator<<(), and xml::document::save_to_stream().

◆ save_to_string_cb()

int xml::impl::save_to_string_cb ( void *  ctx,
const char *  buf,
int  len 
)

Definition at line 183 of file utility.cpp.

References buf, ctx, len, and string.

Referenced by xml::node::append_to_string(), and xml::document::save_to_string().

◆ set_children_default_ns()

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
nodeThe node to start from.
default_nsThe pointer to the document default namespace
Author
Sergey Satskiy, NCBI

Definition at line 117 of file node_manip.cpp.

References has_default_ns_definition().

Referenced by node_insert(), and node_replace().

◆ update_children_default_ns()

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
nodeThe node to start from.
newnsThe namespace to be set
Author
Sergey Satskiy, NCBI

Definition at line 157 of file node_manip.cpp.

References has_default_ns_definition().

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

Modified on Wed May 15 15:05:25 2024 by modify_doxy.py rev. 669887