7#ifndef MYGUI_LOG_LEVEL_H_
8#define MYGUI_LOG_LEVEL_H_
45 std::string_view name = type.getValueName(value);
46 if (name.empty() || name == _value)
50 type.mValue =
static_cast<Enum>(value);
56 return a.mValue < b.mValue;
76 return !(a < b) && !(a > b);
86 _stream << _value.getValueName(_value.mValue);
94 _value =
parse(value);
100 return getValueName(mValue);
109 std::string_view getValueName(
int _index)
const
111 if (_index < 0 || _index >= MAX)
113 static const std::string_view values[MAX] = {
"Info",
"Warning",
"Error",
"Critical"};
114 return values[_index];
friend std::ostream & operator<<(std::ostream &_stream, const LogLevel &_value)
friend bool operator<(LogLevel const &a, LogLevel const &b)
friend bool operator>(LogLevel const &a, LogLevel const &b)
friend bool operator==(LogLevel const &a, LogLevel const &b)
friend bool operator!=(LogLevel const &a, LogLevel const &b)
static LogLevel parse(std::string_view _value)
friend bool operator>=(LogLevel const &a, LogLevel const &b)
friend bool operator<=(LogLevel const &a, LogLevel const &b)
friend std::istream & operator>>(std::istream &_stream, LogLevel &_value)
std::string_view print() const