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

Method cloneData

Tools/EditorFramework/DataUtility.cpp:55–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 void DataUtility::cloneData(DataPtr _target, DataPtr _prototype)
56 {
57 MYGUI_ASSERT(_target != _prototype, "Error clone self");
58 MYGUI_ASSERT(_target->getType() == _prototype->getType(), "Error clone different types");
59 MYGUI_ASSERT(_target->getChilds().empty(), "Target not empty");
60
61 copyProperty(_target, _prototype);
62
63 for (Data::VectorData::const_iterator child = _prototype->getChilds().begin();
64 child != _prototype->getChilds().end();
65 child++)
66 {
67 DataPtr data = Data::CreateInstance();
68 data->setType((*child)->getType());
69
70 _target->addChild(data);
71
72 cloneData(data, *child);
73 }
74 }
75
76 void DataUtility::copyProperty(DataPtr _target, DataPtr _prototype)
77 {

Callers

nothing calls this directly

Calls 6

getTypeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setTypeMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected