Version.h++
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __ccxx_Version_hxx
00024 #define __ccxx_Version_hxx
00025
00026 #include <commonc++/Common.h++>
00027 #include <commonc++/String.h++>
00028
00029 namespace ccxx {
00030
00056 class COMMONCPP_API Version
00057 {
00058 public:
00059
00066 Version(const String& version) throw();
00067
00076 Version(uint_t current = 0, uint_t revision = 0, uint_t age = 0) throw();
00077
00079 Version(const Version& other) throw();
00080
00082 virtual ~Version() throw();
00083
00093 bool satisfies(const Version& requested) const throw();
00094
00103 bool satisfiedBy(const Version& available) const throw();
00104
00106 inline uint_t getCurrent() const throw()
00107 { return(_current); }
00108
00110 inline uint_t getRevision() const throw()
00111 { return(_revision); }
00112
00114 inline uint_t getAge() const throw()
00115 { return(_age); }
00116
00118 void interfacesAdded() throw();
00119
00121 void interfacesRemoved() throw();
00122
00126 void interfacesChanged() throw();
00127
00129 void implementationChanged() throw();
00130
00134 String toString() const;
00135
00137 String toCRAString() const;
00138
00140 void fromString(const String& version) throw();
00141
00143 bool operator==(const Version& other) const throw();
00144
00146 inline bool operator!=(const Version& other) const throw()
00147 { return(! operator==(other)); }
00148
00150 bool operator<(const Version& other) const throw();
00151
00153 inline bool operator<=(const Version& other) const throw()
00154 { return(operator<(other) || operator==(other)); }
00155
00157 bool operator>(const Version& other) const throw();
00158
00160 inline bool operator>=(const Version& other) const throw()
00161 { return(operator>(other) || operator==(other)); }
00162
00164 Version& operator=(const Version& other) throw();
00165
00166 private:
00167
00168 uint_t _current;
00169 uint_t _revision;
00170 uint_t _age;
00171 mutable String _str;
00172 mutable String _vstr;
00173 };
00174
00175 inline std::ostream& operator<<(std::ostream& stream, const Version& v)
00176 { return(stream << v.toString().c_str()); }
00177
00178 };
00179
00180 #endif // __ccxx_Version_hxx
00181
00182