versionned.h

Go to the documentation of this file.
00001 /* -*- Mode: c++ -*- */
00002 /*
00003  *  this is part of Spm
00004  *
00005  *  Copyright (c) 2008 Guillaume Chevallereau
00006  *
00007  *  This program is free software. You can redistribute it and/or modify it 
00008  *  under the terms of the GNU General Public License as published by the 
00009  *  Free Software Foundation. Either version 2 of the license or (at your 
00010  *  option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be usefull but WITHOUT
00013  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
00014  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
00015  *  more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License along 
00018  *  with this program; if not, write to the Free Software Foundation, Inc., 
00019  *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
00020  */
00021 #ifndef VERSIONNED_H
00022 #define VERSIONNED_H
00023 
00024 #include <util/object.h>
00025 #include <util/propertyList.h>
00026 
00027 namespace Spm
00028 {
00029   namespace Core
00030   {
00031     class Element;
00032 
00033     class Versionned : public Util::Object,
00034                        public Util::PropertyList
00035     {
00036     protected:
00037       Element * element_;
00038     public :
00039       static void formatName (miniXml::ustring & version);
00047       static void splitVersion(const miniXml::ustring & name,
00048                                miniXml::ustring & major,
00049                                miniXml::ustring & minor,
00050                                miniXml::ustring & micro,
00051                                miniXml::ustring & extra);
00052       static const miniXml::ustring PROPERTY_MAJOR;
00053       static const miniXml::ustring PROPERTY_MINOR;
00054       Versionned (Element * element) : element_(element)
00055       {
00056       }
00057 
00058       Versionned () : element_(0)
00059       {
00060       }
00061 
00062       virtual ~Versionned ()
00063       {
00064         element_ = 0;
00065       }
00066       
00070       Element * getElement ()
00071       {
00072         return element_;
00073       }
00074 
00078       const Element * getElement () const
00079       {
00080         return element_;
00081       }
00085       void setMinor (const miniXml::ustring & aMinor);
00086 
00090       void setMajor (const miniXml::ustring & aMajor);
00091       
00095       virtual const miniXml::ustring & getName ();
00096 
00100       const miniXml::ustring getMajor () const;
00101 
00105       const miniXml::ustring getMinor () const;
00106 
00110       virtual const miniXml::ustring & getName () const;
00111     };
00112 
00113     struct equalVersionnedByName : public std::binary_function<Versionned *,
00114                                                                miniXml::ustring,
00115                                                                bool>
00116     {
00117       bool operator() (const Versionned * v,
00118                        const miniXml::ustring & str) const;
00119     };
00120   }
00121 }
00122 #endif

Generated on Sat Mar 21 17:00:14 2009 for libSpm by  doxygen 1.5.2