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 "attribute.h"
00047 #include "text.h"
00048
00049 #include "element_evolution.h"
00050
00051 using namespace libsvx;
00052
00055 ElementEvolution::ElementEvolution(TiXmlElement & Element, const std::string the_name)
00056 :ElementText(Element,the_name)
00057 ,m_A_priority(NULL)
00058 ,m_A_user(NULL)
00059 {
00060
00061 if (Element.Attribute("priority") != NULL)
00062 {
00063 m_A_priority = new Attribute(*Element.Attribute("priority"),"priority");
00064 }
00065
00066 if (Element.Attribute("user") != NULL)
00067 {
00068 m_A_user = new Attribute(*Element.Attribute("user"),"user");
00069 }
00070 }
00071
00075 ElementEvolution::ElementEvolution(const ElementEvolution & a_item)
00076 :ElementText(a_item)
00077 {
00078 if (a_item.m_A_priority != NULL)
00079 m_A_priority = new Attribute(*a_item.m_A_priority);
00080 else
00081 m_A_priority = a_item.m_A_priority;
00082
00083 if (a_item.m_A_user != NULL)
00084 m_A_user = new Attribute(*a_item.m_A_user);
00085 else
00086 m_A_user = a_item.m_A_user;
00087 }
00088
00092 ElementEvolution::~ElementEvolution()
00093 {
00094 if (m_A_priority != NULL)
00095 delete m_A_priority;
00096 if (m_A_user != NULL)
00097 delete m_A_priority;
00098 }
00099
00103 bool ElementEvolution::IsValid() const
00104 {
00105 return (m_List_Text.size() > 0);
00106 }
00107
00108 void ElementEvolution::XmlElement(TiXmlElement & the_element_to_fill)
00109 {
00110 ElementText::XmlElement(the_element_to_fill);
00111
00112 if (m_A_priority != NULL)
00113 m_A_priority->XmlElement(*m_Node);
00114 if (m_A_user != NULL)
00115 m_A_user->XmlElement(*m_Node);
00116 }