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

changes.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 "bugfix.h"
00047 #include "feature.h"
00048 #include "improvement.h"
00049 
00050 #include "changes.h"
00051 
00052 using namespace libsvx;
00053 
00056 Changes::Changes(TiXmlElement & a_Element)
00057  :Element(a_Element,"changes")
00058 {
00059   assert(a_Element.Value().compare("changes") == 0);
00060 
00061   TiXmlElement * txIterator;
00062 
00063   m_List_Bugfix.clear();
00064   txIterator = a_Element.FirstChildElement("bugfix");
00065 
00066   while (txIterator != NULL)
00067   {
00068     Bugfix * tmpBugfix = new Bugfix(*txIterator);
00069     m_List_Bugfix.push_back(tmpBugfix);
00070     txIterator = txIterator->NextSiblingElement("bugfix");
00071   }
00072 
00073   m_List_Feature.clear();
00074   txIterator = a_Element.FirstChildElement("feature");
00075 
00076   while (txIterator != NULL)
00077   {
00078     Feature * tmpFeature = new Feature(*txIterator);
00079     m_List_Feature.push_back(tmpFeature);
00080     txIterator = txIterator->NextSiblingElement("feature");
00081   }
00082 
00083   m_List_Improvement.clear();
00084   txIterator = a_Element.FirstChildElement("improvement");
00085 
00086   while (txIterator != NULL)
00087   {
00088     Improvement * tmpImprovement = new Improvement(*txIterator);
00089     m_List_Improvement.push_back(tmpImprovement);
00090     txIterator = txIterator->NextSiblingElement("improvement");
00091   }
00092 }
00093 
00097 Changes::Changes(const Changes & a_item)
00098  :Element(a_item)
00099 {
00100   for (size_t i = 0; i < a_item.m_List_Bugfix.size(); i++)
00101   {
00102     Bugfix * tmpText = new Bugfix(a_item.m_List_Bugfix[i]);
00103     m_List_Bugfix.push_back(tmpText);
00104   }
00105 
00106   for (size_t j = 0; j < a_item.m_List_Feature.size();j++)
00107   {
00108     Feature * tmpText = new Feature(a_item.m_List_Feature[j]);
00109     m_List_Feature.push_back(tmpText);
00110   }
00111 
00112   for (size_t k = 0; k < a_item.m_List_Improvement.size();k++)
00113   {
00114     Improvement * tmpText = new Improvement(a_item.m_List_Improvement[k]);
00115     m_List_Improvement.push_back(tmpText);
00116   }
00117 }
00118 
00122 Changes::~Changes()
00123 {
00124 /* done automatically
00125   while (m_List_Bugfix.size() != 0)
00126   {
00127     Bugfix * tmp = m_List_Bugfix.front();
00128     m_List_Bugfix.pop_front();
00129     delete tmp;
00130   }
00131 
00132   while (m_List_Feature.size() != 0)
00133   {
00134     Feature * tmp = m_List_Feature.front();
00135     m_List_Feature.pop_front();
00136     delete tmp;
00137   }
00138 
00139   while (m_List_Improvement.size() != 0)
00140   {
00141     Improvement * tmp = m_List_Improvement.front();
00142     m_List_Improvement.pop_front();
00143     delete tmp;
00144   }
00145 */
00146 }
00147 
00151 bool Changes::IsValid() const
00152 {
00153   return true;
00154 }
00155 
00156 TiXmlElement & Changes::XmlElement()
00157 {
00158   for (size_t i = 0; i < m_List_Bugfix.size();i++)
00159   {
00160     m_Node->InsertEndChild(m_List_Bugfix[i].XmlElement());
00161   }
00162   
00163   for (size_t j = 0; j < m_List_Feature.size();j++)
00164   {
00165     m_Node->InsertEndChild(m_List_Feature[j].XmlElement());
00166   }
00167   
00168   for (size_t k = 0; k < m_List_Improvement.size();k++)
00169   {
00170     m_Node->InsertEndChild(m_List_Improvement[k].XmlElement());
00171   }
00172   
00173   return *m_Node;
00174 }
00175 
00179 bool Changes::operator!=(const Changes & the_object_to_compare) const
00180 {
00181   bool result = !(IsValid() && the_object_to_compare.IsValid());
00182 
00183   result = result || (static_cast<const Element &>(*this) != the_object_to_compare);
00184   
00185   return result;
00186 }

Generated on Sat Apr 13 22:56:49 2002 for libsvx by doxygen1.2.15