acme
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages Concepts
node.h
1#pragma once
2
3
4//
5
6//#include "acme/prototype/prototype/payload.h"
7//#include "acme/prototype/collection/pointer_array.h"
8
9
10namespace data
11{
12
13
14 enum enum_node
15 {
16
17 e_node_none,
18 e_node_xml_element, // general node '<matter>...</matter>' or <matter/>
19 e_node_xml_pi, // <?xml version="1.0" ?>
20 e_node_xml_comment, // <!-- comment -->
21 e_node_xml_cdata, // <![CDATA[ cdata ]]>
22 e_node_xml_document, // internal virtual root
23 e_node_xml_text // special node_element - final node matter
24
25 };
26
27
28 class CLASS_DECL_ACME node :
29 virtual public ::particle
30 {
31
32 public:
33
34
35 typedef pointer_array < node > array;
36
37 ::xml::node * m_pxmlnode;
38 node * m_pnodeParent;
39 enum_node m_enode;
40 string m_strName;
41 string m_strValue;
42 property_set m_set;
43 node::array m_nodea;
44
45 node();
46 ~node() override;
47
48
49 string name() const { return m_strName; }
50 void set_name(const ::scoped_string & scopedstrName) { m_strName = scopedstrName; }
51
52
53 string value() const { return m_strValue; }
54 void set_value(const ::scoped_string & scopedstrValue) { m_strValue = scopedstrValue; }
55
56
57 inline enum_node get_type() const { return m_enode; }
58 inline void set_type(enum_node enode) { m_enode = enode; }
59
60 inline ::xml::node* get_xml_node() const { return m_pxmlnode; }
61
62 virtual ::xml::document* get_xml_document() const;
63
64
65
66 payload attribute(const ::scoped_string & scopedstr) const { return m_set[scopedstr]; }
67 ::property& attribute(const ::scoped_string & scopedstr) { return m_set[scopedstr]; }
68
69
70
71 node* node_at(::collection::index i) { return m_nodea[i]; }
72 ::collection::count get_node_count() const { return m_nodea.get_count(); }
73
74
75 };
76
77
78 inline ::xml::node* __xml(::data::node* pnode) { return pnode == nullptr ? nullptr : pnode->get_xml_node(); }
79
80} // namespace acme
81
82
83
Definition property.h:16
Definition payload.h:53
Definition property_set.h:17