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 #ifndef _DEF_SVX_PRODUCT_H_ 00045 #define _DEF_SVX_PRODUCT_H_ 00046 00047 //#include <list> 00048 #include <vector> 00049 00050 #include "Mvector.h" 00051 #include "element_name.h" 00052 #include "element_uid.h" 00053 #include "element_license.h" 00054 #include "version.h" 00055 00056 namespace libsvx { 00057 00058 class Attribute; 00059 class Version; 00060 class Description; 00061 class Vendor; 00062 00067 class Product : public ElementName, public ElementUid, public ElementLicense 00068 { 00069 00070 public: 00072 Product(TiXmlElement & Element); 00073 ~Product(); 00074 00075 bool IsValid() const; 00076 00077 TiXmlElement & XmlElement(); 00078 00080 const Attribute * HREF() const {return m_A_href;} 00081 00082 // operators 00083 Product & operator+=(const Product & the_object_to_add); 00084 bool operator!=(const Product & the_object_to_compare) const; 00085 00086 00087 bool IsOldVersion(const std::string & the_version_to_check) const; 00088 const Version *GetLatestVersion(); 00089 00090 // Version searching routines 00091 00092 Version * FindVersion(const std::string & the_version_name); 00093 // Version * FindVersion(const Version & the_version); 00094 00095 void Iterate_Version_Begin(); 00096 bool Iterate_Version_IsBegin(); 00097 bool Iterate_Version_IsEnd(); 00098 const std::string & Iterate_Version_Next(); 00099 const std::string & Iterate_Version_Prev(); 00100 00101 protected: 00103 Attribute * m_A_href; 00105 Attribute * m_A_ihref; 00107 Vendor * m_Vendor; 00109 Description * m_Description; 00111 Mvector<Version> m_List_Version; 00112 00114 // std::list<Version *>::iterator m_Iterator_Version; 00115 size_t m_Iterator_Version; 00116 }; 00117 }; 00118 00119 #endif // _DEF_SVX_PRODUCT_H_