| 158 | using MapAlign = std::map<std::string, int>; |
| 159 | |
| 160 | static MessageBoxStyle parse(std::string_view _value) |
| 161 | { |
| 162 | MessageBoxStyle result(MessageBoxStyle::Enum(0)); |
| 163 | const MapAlign& map_names = result.getValueNames(); |
| 164 | const std::vector<std::string>& vec = utility::split(_value); |
| 165 | for (const auto& type : vec) |
| 166 | { |
| 167 | MapAlign::const_iterator iter = map_names.find(type); |
| 168 | if (iter != map_names.end()) |
| 169 | { |
| 170 | result.mValue = Enum(int(result.mValue) | int(iter->second)); |
| 171 | } |
| 172 | else |
| 173 | { |
| 174 | MYGUI_LOG(Warning, "Cannot parse type '" << type << "'"); |
| 175 | } |
| 176 | } |
| 177 | return result; |
| 178 | } |
| 179 | |
| 180 | private: |
| 181 | const MapAlign& getValueNames() |