32#include <Pt/Xml/Api.h>
33#include <Pt/Xml/XmlError.h>
64 ProcessingInstruction = 9,
90T* nodeCast(Node* node)
94 if( node->type() == T::nodeId() )
95 e =
static_cast<T*
>(node);
102const T* nodeCast(
const Node* node)
106 if( node->type() == T::nodeId() )
107 e =
static_cast<const T*
>(node);
114T& nodeCast(
Node& node)
116 if( node.type() != T::nodeId() )
117 throw XmlError(
"unexpected node type");
119 return static_cast<T&
>(node);
124const T& nodeCast(
const Node& node)
126 if( node.type() != T::nodeId() )
127 throw XmlError(
"unexpected node type");
129 return static_cast<const T&
>(node);
XML document node.
Definition Node.h:51
Node(Type type)
Constructs a new Node object with the specified node type.
Definition Node.h:80
virtual ~Node()
Destructor.
Definition Node.h:69
Type type() const
Returns the type of the node.
Definition Node.h:74
XmlError(const std::string &what)
Construct with message.
Read and write XML ducuments.
Core module.
Definition Allocator.h:33