23 #ifndef __MYGUI_VERSION_H__
24 #define __MYGUI_VERSION_H__
39 explicit Version(
const std::string& _value) : value(parse(_value).value) { }
49 friend std::ostream& operator << ( std::ostream& _stream,
const Version& _value )
51 _stream << _value.
print();
55 friend std::istream& operator >> ( std::istream& _stream,
Version& _value )
70 std::string print()
const
76 static Version parse(
const std::string& _value)
79 if (vec.empty())
return Version();
80 uint8 major = (
uint8)utility::parseValue<int>(vec[0]);
81 uint8 minor = vec.size() > 1 ? (
uint8)utility::parseValue<int>(vec[1]) :
uint8(0);
83 return Version(major, minor, patch);
96 #endif // __MYGUI_VERSION_H__