00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00044 #include "../tinyxml/tinyxml.h"
00045
00046 #include "element_pcdata.h"
00047
00048 using namespace libsvx;
00049
00052 ElementPCData::ElementPCData(TiXmlElement & a_Element, const std::string the_name)
00053 :Element(a_Element,the_name)
00054 ,m_PcDataNode("")
00055 {
00056 if (a_Element.FirstChild() != NULL)
00057 {
00058 m_Value = a_Element.FirstChild()->Value();
00059 }
00060 else
00061 {
00062 m_Value = "";
00063 }
00064
00065 m_PcDataNode.SetValue(m_Value);
00066
00067 m_Node->InsertEndChild(m_PcDataNode);
00068 }
00069
00070 ElementPCData::ElementPCData(const ElementPCData & a_element)
00071 :Element(a_element)
00072 ,m_PcDataNode("")
00073 {
00074 m_Value = a_element.m_Value;
00075
00076 m_PcDataNode.SetValue(m_Value);
00077 m_Node->InsertEndChild(m_PcDataNode);
00078 }
00079
00083 ElementPCData::~ElementPCData()
00084 {
00085 }
00086
00087
00088 TiXmlElement & ElementPCData::XmlElement()
00089 {
00090 assert(m_Node != NULL);
00091
00092 return *m_Node;
00093 }
00094
00095 ElementPCData & ElementPCData::operator+=(const ElementPCData & the_object_to_add)
00096 {
00097
00098
00099
00100 {
00101
00102 static_cast<Element&>(*this) += the_object_to_add;
00103
00104 m_PcDataNode = the_object_to_add.m_PcDataNode;
00105 }
00106
00107 return *this;
00108 }
00109
00110 bool ElementPCData::operator!=(const ElementPCData & the_object_to_compare) const
00111 {
00112
00113 bool result = false;
00114
00115 result = result || (static_cast<const Element&>(*this) != the_object_to_compare);
00116 result = result || (m_Value.compare(the_object_to_compare.m_Value) == 0);
00117
00118 return result;
00119 }