7#ifndef MYGUI_RESIZING_POLICY_H_
8#define MYGUI_RESIZING_POLICY_H_
28 ResizingPolicy(Enum _value = MAX) :
33 static ResizingPolicy parse(std::string_view _value)
39 std::string_view name = type.getValueName(value);
40 if (name.empty() || name == _value)
44 type.mValue =
Enum(value);
48 friend bool operator==(ResizingPolicy
const& a, ResizingPolicy
const& b)
50 return a.mValue == b.mValue;
53 friend bool operator!=(ResizingPolicy
const& a, ResizingPolicy
const& b)
55 return a.mValue != b.mValue;
58 friend std::ostream& operator<<(std::ostream& _stream,
const ResizingPolicy& _value)
60 _stream << _value.getValueName(_value.mValue);
64 friend std::istream& operator>>(std::istream& _stream, ResizingPolicy& _value)
68 _value = parse(value);
72 std::string_view print()
const
74 return getValueName(mValue);
83 std::string_view getValueName(
int _index)
const
85 if (_index < 0 || _index >= MAX)
87 static const std::string_view values[MAX] = {
"Auto",
"Fixed",
"Fill"};
88 return values[_index];