7 #ifndef __MYGUI_VERSION_H__
8 #define __MYGUI_VERSION_H__
21 Version(
unsigned int _major = 0,
unsigned int _minor = 0,
unsigned int _patch = 0) :
30 return (a.mMajor < b.mMajor) ?
true : (a.mMinor < b.mMinor);
50 return !(a < b) && !(a > b);
58 friend std::ostream& operator << (std::ostream& _stream,
const Version& _value)
60 _stream << _value.
print();
64 friend std::istream& operator >> (std::istream& _stream,
Version& _value)
68 _value = parse(value);
72 unsigned int getMajor()
const
77 unsigned int getMinor()
const
82 unsigned int getPatch()
const
87 std::string print()
const
94 static Version parse(
const std::string& _value)
100 unsigned int major = utility::parseValue<unsigned int>(vec[0]);
101 unsigned int minor = vec.size() > 1 ? utility::parseValue<unsigned int>(vec[1]) : 0;
102 unsigned int patch = vec.size() > 2 ? utility::parseValue<unsigned int>(vec[2]) : 0;
104 return Version(major, minor, patch);
110 unsigned mPatch : 16;
115 #endif // __MYGUI_VERSION_H__