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

dversion.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 
00048 #include "dversion.h"
00049 
00050 using namespace libsvx;
00051 
00054 DVersion::DVersion(TiXmlElement & Element)
00055  :ElementName(Element,"compatible")
00056  ,m_A_compatible(NULL)
00057 {
00058   assert(Element.Value().compare("dversion") == 0);
00059 
00060   // attributes
00061   if (Element.Attribute("compatible") != NULL)
00062   {
00063     m_A_compatible = new Attribute(*Element.Attribute("compatible"),"compatible");
00064   }
00065 }
00066 
00070 DVersion::DVersion(const DVersion & a_item)
00071  :ElementName(a_item)
00072 {
00073   if (a_item.m_A_compatible != NULL)
00074     m_A_compatible = new Attribute(*a_item.m_A_compatible);
00075   else
00076     m_A_compatible = a_item.m_A_compatible;
00077 }
00078 
00082 DVersion::~DVersion()
00083 {
00084   if (m_A_compatible != NULL)
00085     delete m_A_compatible;
00086 }
00087 
00091 bool DVersion::IsValid() const
00092 {
00093   return (m_A_name != NULL && m_A_compatible != NULL && 
00094         (m_A_compatible->String().compare("true") == 0 ||
00095          m_A_compatible->String().compare("false") == 0 ));
00096 }
00097 
00098 TiXmlElement & DVersion::XmlElement()
00099 {
00100   ElementName::XmlElement(*m_Node);
00101 
00102   if (m_A_compatible != NULL)
00103     m_A_compatible->XmlElement(*m_Node);
00104 
00105   return *m_Node;
00106 }
00107 

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