7 #ifndef __MYGUI_LOG_LEVEL_H__
8 #define __MYGUI_LOG_LEVEL_H__
36 static LogLevel parse(
const std::string& _value)
42 const char* name = type.getValueName(value);
43 if (strcmp(name,
"") == 0 || name == _value)
47 type.mValue = (
Enum)value;
53 return a.mValue < b.mValue;
73 return !(a < b) && !(a > b);
81 friend std::ostream& operator << (std::ostream& _stream,
const LogLevel& _value)
83 _stream << _value.getValueName(_value.mValue);
87 friend std::istream& operator >> (std::istream& _stream,
LogLevel& _value)
91 _value = parse(value);
95 std::string print()
const
97 return getValueName(mValue);
106 const char* getValueName(
int _index)
const
108 static const char* values[MAX + 1] = {
"Info",
"Warning",
"Error",
"Critical",
"" };
109 return values[(_index < MAX && _index >= 0) ? _index : MAX];
118 #endif // __MYGUI_LOG_LEVEL_H__