00001
00002
00003
00004
00005
00006
00007 #ifndef _MIMETIC_VERSION_H_
00008 #define _MIMETIC_VERSION_H_
00009 #include <string>
00010 #include <iostream>
00011
00012 namespace mimetic
00013 {
00014 struct Version;
00015
00016
00017
00018 extern const Version version;
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 struct Version
00033 {
00034 typedef unsigned int ver_type;
00035 Version();
00036 Version(const std::string&);
00037 Version(ver_type, ver_type, ver_type build = 0);
00038 void maj(ver_type);
00039 void min(ver_type);
00040 void build(ver_type);
00041 ver_type maj() const;
00042 ver_type min() const;
00043 ver_type build() const;
00044
00045 void set(ver_type, ver_type, ver_type build = 0);
00046 void set(const std::string&);
00047 std::string str() const;
00048
00049 bool operator==(const Version&) const;
00050 bool operator!=(const Version&) const;
00051 bool operator<(const Version&) const;
00052 bool operator>(const Version&) const;
00053 bool operator<=(const Version&) const;
00054 bool operator>=(const Version&) const;
00055 friend std::ostream& operator<<(std::ostream&, const Version&);
00056 protected:
00057 ver_type m_maj, m_min, m_build;
00058 };
00059
00060 }
00061
00062 #endif
00063