Element.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <exml/Node.hpp>
9 #include <vector>
10 #include <exml/AttributeList.hpp>
11 #include <exml/iterator.hpp>
12 
13 namespace exml {
14 
20  class ElementData {
21  private:
22  exml::Element* m_data;
23  public:
28  ElementData(exml::Element* _list);
29  public:
34  size_t size() const;
39  void add(const exml::Node& _node);
44  void remove(const std::string& _nodeName);
50  enum nodeType getType(int32_t _id) const;
56  exml::Node operator[] (int32_t _id);
62  const exml::Node operator[] (int32_t _id) const;
68  exml::Element operator[] (const std::string& _name);
74  const exml::Element operator[] (const std::string& _name) const;
75  public:
77 
81  iterator begin();
86  iterator end();
91  const iterator begin() const;
96  const iterator end() const;
97  };
101  class Element : public exml::AttributeList {
102  public:
104  public:
114  Element(const exml::Element& _obj);
119  Element(const std::string& _value="");
125  exml::Element& operator= (const exml::Element& _obj);
130  std::string getText() const;
131  public:
132  void clear() override;
133  };
134 }
135 
exml::Node operator[](int32_t _id)
get the Node pointer of the element id.
iterator begin()
Get iterator of the first sub nodes.
ElementData nodes
All Sub-nodes interface.
Definition: Element.hpp:103
iterator end()
Get iterator of the next of the last sub nodes.
Basic element Node of an XML document <YYYYY>.
Definition: Element.hpp:20
ElementData(exml::Element *_list)
constructor on the ElementData class
enum nodeType getType(int32_t _id) const
get the type of the element id.
List of all attribute element in a node.
Definition: AttributeList.hpp:107
exml namespace containing all function for XML interpretor
Definition: Attribute.hpp:11
Basic main object of all xml elements.
Definition: Node.hpp:30
size_t size() const
get the number of sub element in the node (can be exml::Comment ; exml::Element ; exml::Text :exml::D...
void clear()
Basic element Node of an XML document <YYYYY>.
Definition: Element.hpp:101
Definition: iterator.hpp:16
void add(const exml::Node &_node)
add a node at the element (not exml::Attribute (move in the attribute automaticly).
nodeType
Type of the XML elements.
Definition: nodeType.hpp:17