MCPcopy Create free account
hub / github.com/MyGUI/mygui / parse

Method parse

Common/MessageBox/MessageBoxStyle.h:160–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 4

splitFunction · 0.85
EnumEnum · 0.70
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected