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

Method serialiseProperty

Tools/LayoutEditor/BackwardCompatibilityManager.cpp:141–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139 }
140
141 void BackwardCompatibilityManager::serialiseProperty(
142 MyGUI::xml::Element* _node,
143 std::string_view _widgetType,
144 const MyGUI::PairString& _property,
145 bool _compatibility)
146 {
147 std::string_view propertyName = _property.first;
148
149 if (_compatibility && getDefaultVersion() != getCurrentVersion())
150 {
151 std::string key = MyGUI::utility::toString(getCurrentVersion(), "-", propertyName);
152
153 MyGUI::MapString::const_iterator item = mPropertyNames.find(key);
154 if (item != mPropertyNames.end())
155 {
156 propertyName = (*item).second;
157 }
158 else
159 {
160 key = MyGUI::utility::toString(getCurrentVersion(), "-", _widgetType, "-", propertyName);
161
162 item = mPropertyNames.find(key);
163 if (item != mPropertyNames.end())
164 {
165 propertyName = (*item).second;
166 }
167 else
168 {
169 MYGUI_LOG(Warning, "Property key not found '" << key << "'");
170 }
171 }
172 }
173
174 MyGUI::xml::ElementPtr nodeProp = _node->createChild("Property");
175 nodeProp->addAttribute("key", propertyName);
176 nodeProp->addAttribute("value", _property.second);
177 }
178
179 const MyGUI::VectorString& BackwardCompatibilityManager::getVersions() const
180 {

Callers 1

serialiseWidgetMethod · 0.80

Calls 5

toStringFunction · 0.85
createChildMethod · 0.80
addAttributeMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected