libcxml
 All Classes Functions
Public Member Functions | Protected Attributes | List of all members
cxml::Node Class Reference

A wrapper for a xmlpp::Node which simplifies parsing. More...

#include <cxml.h>

Inheritance diagram for cxml::Node:
cxml::Document

Public Member Functions

 Node (xmlpp::Node *node)
 
std::string name () const
 
std::string string_child (std::string c) const
 
boost::optional< std::string > optional_string_child (std::string) const
 
bool bool_child (std::string) const
 
boost::optional< bool > optional_bool_child (std::string) const
 
template<class T >
number_child (std::string c) const
 
template<class T >
boost::optional< T > optional_number_child (std::string c) const
 
void ignore_child (std::string) const
 
void done () const
 
std::string string_attribute (std::string) const
 
boost::optional< std::string > optional_string_attribute (std::string) const
 
bool bool_attribute (std::string) const
 
boost::optional< bool > optional_bool_attribute (std::string) const
 
template<class T >
number_attribute (std::string c) const
 
template<class T >
boost::optional< T > optional_number_attribute (std::string c) const
 
std::string content () const
 
std::string namespace_uri () const
 
std::string namespace_prefix () const
 
boost::shared_ptr< Nodenode_child (std::string) const
 
boost::shared_ptr< Nodeoptional_node_child (std::string) const
 
std::list< boost::shared_ptr
< Node > > 
node_children (std::string) const
 
xmlpp::Node * node () const
 

Protected Attributes

xmlpp::Node * _node
 

Detailed Description

A wrapper for a xmlpp::Node which simplifies parsing.

Constructor & Destructor Documentation

cxml::Node::Node ( xmlpp::Node *  node)

Construct a Node from an xmlpp::Node. This class will not destroy the xmlpp::Node.

Parameters
nodexmlpp::Node.

Member Function Documentation

string cxml::Node::content ( ) const
Returns
The content of this node
void cxml::Node::done ( ) const

Check whether all children of this Node have been looked up or passed to ignore_child(). If not, an exception is thrown.

void cxml::Node::ignore_child ( std::string  ) const

This will mark a child as to be ignored when calling done()

string cxml::Node::namespace_prefix ( ) const
Returns
namespace prefix of this node
string cxml::Node::namespace_uri ( ) const
Returns
namespace URI of this node

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