Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

element_evolution.cxx

Go to the documentation of this file.
00001 /******************************************************************************
00002 
00003                            Copyright Notice.
00004 
00005                Licensed material - Property of Steve Lhomme
00006 
00007 This source file is part of Steve Lhomme's libSVX.
00008 (C) Copyright Steve Lhomme, France, 2001-2002.
00009 All rights reserved. Modifications (C) copyrighted by their respective
00010 contributors, all rights reserved.
00011 
00012 The contents of this file are subject to the Bixoft Public License
00013 Version 1.0 (the "License"); you may not use this file in any way except
00014 in compliance with the License. You should have received a copy of the
00015 License with this source; see <file or member name>. You may also obtain
00016 a copy of the License at http://www.bixoft.nl/english/license.htm
00017 or http://mukoli.free.fr/BXAPL/
00018 
00019 ANY USE OF THE SOFTWARE CONSTITUTES ACCEPTANCE OF THE LICENSE.
00020 
00021 Anything distributed under the License is distributed on an "AS IS" basis,
00022 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
00023 the specific language governing rights and limitations under the License.
00024 
00025 Definitions required by the License:
00026 Copyright Holder: Steve Lhomme, France
00027           e-mail: steve.lhomme@free.fr
00028 Country: France, i.e. the laws of France apply.
00029 Court  : ????
00030 Programming Tool status: This source is not a Programming Tool.
00031 
00032 Contributor(s):                      Contribution:
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   // attributes
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 }

Generated on Tue Apr 9 21:41:11 2002 for libsvx by doxygen1.2.15