|
1 | 1 | #include "common/xml/XMLNode.hpp" |
2 | 2 | #include <storm/String.hpp> |
3 | 3 |
|
4 | | -XMLNode::XMLNode() { |
5 | | - // TODO |
| 4 | +XMLNode::XMLNode(XMLNode* parent, const char* name) { |
| 5 | + this->m_parent = parent; |
| 6 | + this->m_name.Copy(name); |
| 7 | + |
| 8 | + if (this->m_parent && this->m_parent->m_body) { |
| 9 | + this->m_next = nullptr; |
| 10 | + this->m_userData = nullptr; |
| 11 | + this->m_offset = this->m_parent->m_bodyLen; |
| 12 | + } else { |
| 13 | + this->m_offset = 0; |
| 14 | + this->m_next = nullptr; |
| 15 | + this->m_userData = nullptr; |
| 16 | + } |
6 | 17 | } |
7 | 18 |
|
8 | 19 | XMLNode::~XMLNode() { |
@@ -55,26 +66,6 @@ const XMLNode* XMLNode::GetSibling() const { |
55 | 66 | return this->m_next; |
56 | 67 | } |
57 | 68 |
|
58 | | -void XMLNode::Init(XMLNode* parent, const char* name) { |
59 | | - RCString(this->m_name); |
60 | | - TSGrowableArray<XMLAttribute>(this->m_attributes); |
61 | | - this->m_parent = parent; |
62 | | - this->m_child = nullptr; |
63 | | - this->m_name.Copy(name); |
64 | | - this->m_body = nullptr; |
65 | | - this->m_bodyLen = 0; |
66 | | - |
67 | | - if (this->m_parent && this->m_parent->m_body) { |
68 | | - this->m_next = nullptr; |
69 | | - this->m_userData = nullptr; |
70 | | - this->m_offset = this->m_parent->m_bodyLen; |
71 | | - } else { |
72 | | - this->m_offset = 0; |
73 | | - this->m_next = nullptr; |
74 | | - this->m_userData = nullptr; |
75 | | - } |
76 | | -} |
77 | | - |
78 | 69 | void XMLNode::SetAttribute(const char* name, const char* value) { |
79 | 70 | auto attributeCount = this->m_attributes.Count(); |
80 | 71 |
|
|
0 commit comments