9 #ifndef anna_xml_Node_hpp 10 #define anna_xml_Node_hpp 57 struct NamespaceByName {
58 static const std::string& value(
const Namespace* ns) {
return ns->
getName(); }
78 Node(
const char* name);
89 const char*
getName()
const {
return a_name.c_str(); }
117 const Attribute*
getAttribute(
const char* name,
const bool exceptionWhenNotFound =
true)
const noexcept(
false);
179 const_child_iterator
child_begin()
const {
return a_children.begin(); }
191 const_namespace_iterator
namespace_begin()
const {
return a_root->a_namespaces->begin(); }
206 const_child_iterator
child_end()
const {
return a_children.end(); }
218 const_attribute_iterator
attribute_end()
const {
return a_attributes.end(); }
224 const_namespace_iterator
namespace_end()
const {
return a_root->a_namespaces->end(); }
243 const Node*
find(
const char* childName,
const bool exceptionWhenNotFound =
true)
const 330 std::string _name(name);
355 const std::string _name(name);
399 static Node*
node(child_iterator& ii) {
return *ii; }
406 static const Node*
node(const_child_iterator& ii) {
return *ii; }
432 const Node* a_parent;
435 Attributes a_attributes;
440 namespace_container* a_namespaces;
448 node_pool* a_node_pool;
449 attribute_pool* a_attribute_pool;
450 text_pool* a_text_pool;
451 namespace_pool* a_namespace_pool;
456 void setRoot(
Node* root) { a_root = root; }
457 void setName(
const char* name) { a_name = name; }
459 static const Attribute*
find(
const char* attrName, const_attribute_iterator, const_attribute_iterator) ;
463 attribute_iterator
attribute_end() {
return a_attributes.end(); }
container::iterator iterator
Definition: SortedVector.hpp:33
Definition: Compiler.hpp:28
std::vector< Attribute * > Attributes
Definition: Node.hpp:66
std::vector< Node * > Children
Definition: Node.hpp:62
xml::Attribute * createAttribute(const char *name, const char *value, const Namespace *_namespace=NULL)
const_child_iterator child_begin() const
Definition: Node.hpp:179
static const Node * node(const_child_iterator &ii)
Definition: Node.hpp:406
xml::Text * createText(const std::string &text) noexcept(false)
Definition: Node.hpp:313
const_attribute_iterator attribute_begin() const
Definition: Node.hpp:185
void setNamespace(const Namespace *_namespace)
Definition: Node.hpp:348
const Namespace * namespace_find(const char *name, const bool exceptionWhenNotFound=true) const noexcept(false)
Definition: Node.hpp:369
Node * createChild(const char *name)
xml::Attribute * createAttribute(const char *name, const std::string &value, const Namespace *_namespace=NULL)
Definition: Node.hpp:262
xml::Attribute Attribute
Definition: Attribute.hpp:21
xml::Attribute * createAttribute(const char *name, const S64 *value, const Namespace *_namespace=NULL)
Definition: Node.hpp:285
namespace_container::const_iterator const_namespace_iterator
Definition: Node.hpp:72
const Node * getParent() const
Definition: Node.hpp:101
const Text * getText() const
Definition: Node.hpp:123
SortedVector< Namespace, NamespaceByName, std::string > namespace_container
Definition: Node.hpp:70
Definition: Decompressor.hpp:30
static T * data(iterator ii)
Definition: SortedVector.hpp:132
Children::const_iterator const_child_iterator
Definition: Node.hpp:64
Attributes::iterator attribute_iterator
Definition: Node.hpp:67
child_iterator child_begin()
Definition: Node.hpp:154
int64_t S64
Definition: defines.hpp:84
Definition: SortedVector.hpp:30
std::string asString() const
static std::string asString(const int number)
static const Attribute * attribute(const_attribute_iterator &ii)
Definition: Node.hpp:413
Attributes::const_iterator const_attribute_iterator
Definition: Node.hpp:68
const_attribute_iterator attribute_end() const
Definition: Node.hpp:218
static const Namespace * xnamespace(const_namespace_iterator &ii)
Definition: Node.hpp:420
Definition: Namespace.hpp:30
xml::Text * createText(const char *text) noexcept(false)
Definition: Parser.hpp:63
xml::Attribute * createAttribute(const char *name, const U64 *value, const Namespace *_namespace=NULL)
Definition: Node.hpp:297
Definition: Attribute.hpp:35
Node * getParent()
Definition: Node.hpp:107
Definition: Allocator.hpp:19
const std::string & getNameAsString() const
Definition: Node.hpp:95
int namespace_size() const
Definition: Node.hpp:230
const Namespace * namespace_find(const std::string &name, const bool exceptionWhenNotFound=true) const noexcept(false)
Definition: Node.hpp:377
const_namespace_iterator namespace_end() const
Definition: Node.hpp:224
Definition: Recycler.hpp:30
child_iterator child_end()
Definition: Node.hpp:199
const Attribute * getAttribute(const char *name, const bool exceptionWhenNotFound=true) const noexcept(false)
xml::Attribute * createAttribute(const char *name, const int value, const Namespace *_namespace=NULL)
Definition: Node.hpp:273
container::const_iterator const_iterator
Definition: SortedVector.hpp:34
const char * getName() const
Definition: Node.hpp:89
uint64_t U64
Definition: defines.hpp:81
int child_size() const
Definition: Node.hpp:212
const_child_iterator child_end() const
Definition: Node.hpp:206
const std::string & getName() const
Definition: Namespace.hpp:36
const Node * find(const char *childName, const bool exceptionWhenNotFound=true) const noexcept(false)
const Namespace * getNamespace() const
Definition: Node.hpp:129
Namespace * namespace_find(const char *name, const bool exceptionWhenNotFound=true) noexcept(false)
Definition: Node.hpp:354
const_namespace_iterator namespace_begin() const
Definition: Node.hpp:191
static Attribute * attribute(attribute_iterator &ii)
Definition: Node.hpp:428
const Namespace * createNamespace(const char *name, const char *reference) noexcept(false)
Definition: Node.hpp:329
Children::iterator child_iterator
Definition: Node.hpp:63
static Node * node(child_iterator &ii)
Definition: Node.hpp:399
namespace_container::iterator namespace_iterator
Definition: Node.hpp:71