Lines 31-37
Link Here
|
31 |
|
31 |
|
32 |
+ |
32 |
+ |
33 |
class XMLElement; |
33 |
class XMLElement; |
34 |
+shared_ptr<XMLElement> make_shared_XMLElement(XMLElement *e); |
34 |
+shared_ptr<XMLElement> make_shared_XMLElement(XMLElement e); |
35 |
+class XMLElementP { |
35 |
+class XMLElementP { |
36 |
+ public: |
36 |
+ public: |
37 |
+ XMLElementP() {} |
37 |
+ XMLElementP() {} |
Lines 61-67
Link Here
|
61 |
-XMLElement::addElement(const XMLElement& element) { |
61 |
-XMLElement::addElement(const XMLElement& element) { |
62 |
- XMLElementList::iterator it = _elements.insert(make_pair(element.getElementName(), element)); |
62 |
- XMLElementList::iterator it = _elements.insert(make_pair(element.getElementName(), element)); |
63 |
+XMLElement::addElement(XMLElement& element) { |
63 |
+XMLElement::addElement(XMLElement& element) { |
64 |
+ XMLElementList::iterator it = _elements.insert(make_pair(element.getElementName(), make_shared_XMLElement(&element))); |
64 |
+ XMLElementList::iterator it = _elements.insert(make_pair(element.getElementName(), make_shared_XMLElement(element))); |
65 |
return it; |
65 |
return it; |
66 |
} |
66 |
} |
67 |
|
67 |
|