本文整理汇总了C++中SerializerElement::AddChild方法的典型用法代码示例。如果您正苦于以下问题:C++ SerializerElement::AddChild方法的具体用法?C++ SerializerElement::AddChild怎么用?C++ SerializerElement::AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializerElement
的用法示例。
在下文中一共展示了SerializerElement::AddChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeTo
void Layer::SerializeTo(SerializerElement& element) const {
element.SetAttribute("name", GetName());
element.SetAttribute("visibility", GetVisibility());
SerializerElement& camerasElement = element.AddChild("cameras");
camerasElement.ConsiderAsArrayOf("camera");
for (std::size_t c = 0; c < GetCameraCount(); ++c) {
SerializerElement& cameraElement = camerasElement.AddChild("camera");
cameraElement.SetAttribute("defaultSize", GetCamera(c).UseDefaultSize());
cameraElement.SetAttribute("width", GetCamera(c).GetWidth());
cameraElement.SetAttribute("height", GetCamera(c).GetHeight());
cameraElement.SetAttribute("defaultViewport",
GetCamera(c).UseDefaultViewport());
cameraElement.SetAttribute("viewportLeft", GetCamera(c).GetViewportX1());
cameraElement.SetAttribute("viewportTop", GetCamera(c).GetViewportY1());
cameraElement.SetAttribute("viewportRight", GetCamera(c).GetViewportX2());
cameraElement.SetAttribute("viewportBottom", GetCamera(c).GetViewportY2());
}
SerializerElement& effectsElement = element.AddChild("effects");
effectsElement.ConsiderAsArrayOf("effect");
for (std::size_t i = 0; i < GetEffectsCount(); ++i) {
SerializerElement& effectElement = effectsElement.AddChild("effect");
GetEffect(i).SerializeTo(effectElement);
}
}
示例2: SerializeTo
void RepeatEvent::SerializeTo(SerializerElement & element) const
{
element.AddChild("repeatExpression").SetValue(repeatNumberExpression.GetPlainString());
gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
示例3: SerializeTo
void ForEachEvent::SerializeTo(SerializerElement & element) const
{
element.AddChild("object").SetValue(objectsToPick.GetPlainString());
gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
示例4: SerializeTo
void WhileEvent::SerializeTo(SerializerElement & element) const
{
element.SetAttribute("infiniteLoopWarning", infiniteLoopWarning);
gd::EventsListSerialization::SaveConditions(whileConditions, element.AddChild("whileConditions"));
gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
示例5: SerializeTo
void LinkEvent::SerializeTo(SerializerElement & element) const
{
element.AddChild("include")
.SetAttribute("includeAll", IncludeAllEvents())
.SetAttribute("start", (int)GetIncludeStart())
.SetAttribute("end", (int)GetIncludeEnd());
element.AddChild("target").SetValue(GetTarget());
}
示例6: SerializeTo
void ExternalLayout::SerializeTo(SerializerElement & element) const
{
element.SetAttribute("name", name);
instances.SerializeTo(element.AddChild("instances"));
#if !defined(GD_NO_WX_GUI)
editionSettings.SerializeTo(element.AddChild("editionSettings"));
element.SetAttribute("associatedLayout", associatedLayout);
#endif
}
示例7: SerializeTo
void CommentEvent::SerializeTo(SerializerElement & element) const
{
element.AddChild("color")
.SetAttribute("r", r)
.SetAttribute("g", v)
.SetAttribute("b", b)
.SetAttribute("textR", textR)
.SetAttribute("textG", textG)
.SetAttribute("textB", textB);
element.AddChild("comment").SetValue(com1);
element.AddChild("comment2").SetValue(com2);
}
示例8: SerializeTo
void GroupEvent::SerializeTo(SerializerElement & element) const
{
element.SetAttribute("name", name);
element.SetAttribute("source", source);
element.SetAttribute("creationTime", (int)creationTime);
element.SetAttribute("colorR", (int)colorR);
element.SetAttribute("colorG", (int)colorG);
element.SetAttribute("colorB", (int)colorB);
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
gd::SerializerElement & parametersElement = element.AddChild("parameters");
parametersElement.ConsiderAsArrayOf("parameter");
for ( std::size_t i = 0;i < parameters.size();++i)
parametersElement.AddChild("parameter").SetValue(parameters[i]);
}
示例9: SerializeTo
void ExternalEvents::SerializeTo(SerializerElement & element) const
{
element.SetAttribute("name", name);
element.SetAttribute("associatedLayout", associatedScene);
element.SetAttribute("lastChangeTimeStamp", (int)lastChangeTimeStamp);
gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
示例10: SerializeTo
void LinkEvent::SerializeTo(SerializerElement & element) const
{
SerializerElement & includeElement = element.AddChild("include")
.SetAttribute("includeConfig", static_cast<int>(GetIncludeConfig()));
if(GetIncludeConfig() == INCLUDE_EVENTS_GROUP)
{
includeElement.SetAttribute("eventsGroup", GetEventsGroupName());
}
else if(GetIncludeConfig() == INCLUDE_BY_INDEX)
{
includeElement.SetAttribute("start", static_cast<int>(GetIncludeStart()));
includeElement.SetAttribute("end", static_cast<int>(GetIncludeEnd()));
}
element.AddChild("target").SetValue(GetTarget());
}
示例11: SerializeObjectsTo
void ClassWithObjects::SerializeObjectsTo(SerializerElement & element) const
{
element.ConsiderAsArrayOf("object");
for ( std::size_t j = 0;j < initialObjects.size();j++ )
{
initialObjects[j]->SerializeTo(element.AddChild("object"));
}
}
示例12: SerializeTo
void ResourcesManager::SerializeTo(SerializerElement & element) const
{
SerializerElement & resourcesElement = element.AddChild("resources");
resourcesElement.ConsiderAsArrayOf("resource");
for (std::size_t i = 0;i<resources.size();++i)
{
if ( resources[i] == std::shared_ptr<Resource>() ) break;
SerializerElement & resourceElement = resourcesElement.AddChild("resource");
resourceElement.SetAttribute("kind", resources[i]->GetKind());
resourceElement.SetAttribute("name", resources[i]->GetName());
resources[i]->SerializeTo(resourceElement);
}
SerializerElement & resourcesFoldersElement = element.AddChild("resourceFolders");
resourcesFoldersElement.ConsiderAsArrayOf("folder");
for (std::size_t i = 0;i<folders.size();++i)
folders[i].SerializeTo(resourcesFoldersElement.AddChild("folder"));
}
示例13: SerializeTo
void Object::SerializeTo(SerializerElement & element) const
{
element.SetAttribute( "name", GetName() );
element.SetAttribute( "type", GetType() );
objectVariables.SerializeTo(element.AddChild("variables"));
SerializerElement & behaviorsElement = element.AddChild("behaviors");
behaviorsElement.ConsiderAsArrayOf("behavior");
std::vector < gd::String > allBehaviors = GetAllBehaviorNames();
for (std::size_t i = 0;i<allBehaviors.size();++i)
{
SerializerElement & behaviorElement = behaviorsElement.AddChild("behavior");
behaviorElement.SetAttribute( "type", GetBehavior(allBehaviors[i]).GetTypeName() );
behaviorElement.SetAttribute( "name", GetBehavior(allBehaviors[i]).GetName() );
GetBehavior(allBehaviors[i]).SerializeTo(behaviorElement);
}
DoSerializeTo(element);
}
示例14: SerializeEventsTo
void EventsListSerialization::SerializeEventsTo(const EventsList & list, SerializerElement & events)
{
events.ConsiderAsArrayOf("event");
for ( unsigned int j = 0;j < list.size();j++ )
{
const gd::BaseEvent & event = list.GetEvent(j);
SerializerElement & eventElem = events.AddChild("event");
eventElem.SetAttribute( "disabled", event.IsDisabled());
eventElem.SetAttribute( "folded", event.folded);
eventElem.AddChild("type").SetValue(event.GetType());
event.SerializeTo(eventElem);
}
}
示例15: SerializeTo
void EventsFunctionsExtension::SerializeTo(SerializerElement& element) const {
element.SetAttribute("version", version);
element.SetAttribute("extensionNamespace", extensionNamespace);
element.SetAttribute("description", description);
element.SetAttribute("name", name);
element.SetAttribute("fullName", fullName);
gd::SerializerElement& eventsFunctionsElement =
element.AddChild("eventsFunctions");
eventsFunctionsElement.ConsiderAsArrayOf("eventsFunction");
for (const auto& eventsFunction : eventsFunctions) {
eventsFunction->SerializeTo(
eventsFunctionsElement.AddChild("eventsFunction"));
}
}