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

vendor.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 "email.h"
00048 #include "url.h"
00049 
00050 #include "vendor.h"
00051 
00052 using namespace libsvx;
00053 
00056 Vendor::Vendor(TiXmlElement & Element)
00057  :ElementName(Element,"vendor")
00058  ,m_Email(NULL)
00059  ,m_Url(NULL)
00060 {
00061   assert(Element.Value().compare("vendor") == 0);
00062 
00063   if (Element.FirstChildElement("email") != NULL)
00064   {
00065     m_Email = new Email(*Element.FirstChildElement("email"));
00066   }
00067 
00068   if (Element.FirstChildElement("url") != NULL)
00069   {
00070     m_Url = new Url(*Element.FirstChildElement("url"));
00071   }
00072 }
00073 
00074 Vendor::Vendor(const Vendor & a_vendor)
00075  :ElementName(a_vendor)
00076 {
00077   if (a_vendor.m_Email != NULL)
00078   {
00079     m_Email = new Email(*a_vendor.m_Email);
00080   }
00081   if (a_vendor.m_Url != NULL)
00082   {
00083     m_Url = new Url(*a_vendor.m_Url);
00084   }
00085 }
00086 
00090 Vendor::~Vendor()
00091 {
00092   if (m_Email != NULL)
00093     delete m_Email;
00094   if (m_Url != NULL)
00095     delete m_Url;
00096 }
00097 
00101 bool Vendor::IsValid() const
00102 {
00103   return (m_A_name != NULL);
00104 }
00105 
00106 TiXmlElement & Vendor::XmlElement()
00107 {
00108   assert(m_Node != NULL);
00109 
00110   ElementName::XmlElement(*m_Node);
00111 
00112   if (m_Email != NULL)
00113     m_Node->InsertEndChild(m_Email->XmlElement());
00114 
00115   if (m_Url != NULL)
00116     m_Node->InsertEndChild(m_Url->XmlElement());
00117 
00118   return *m_Node;
00119 }
00120 

Generated on Sat Apr 13 15:45:48 2002 for libsvx by doxygen1.2.15