本文整理汇总了C++中IDeserializer::BeginCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ IDeserializer::BeginCommand方法的具体用法?C++ IDeserializer::BeginCommand怎么用?C++ IDeserializer::BeginCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDeserializer
的用法示例。
在下文中一共展示了IDeserializer::BeginCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool IObjectMapPropertyType<KeyType, ValueType>::DoDeserialize(
BidirectionalSerializer &bidi, KeyType &key, ValueType &value)
{
IDeserializer *deserializer = bidi.Deserializer();
Command item;
if(deserializer->BeginCommand(item))
{
OrkAssert(item.Type() == Command::EITEM);
if(item.Type() != Command::EITEM)
{
deserializer->EndCommand(item);
bidi.Fail();
return false;
}
Command attribute;
deserializer->BeginCommand(attribute);
OrkAssert(attribute.Type() == Command::EATTRIBUTE);
OrkAssert(attribute.Name() == "key");
if(attribute.Type() != Command::EATTRIBUTE || attribute.Name() != "key")
{
deserializer->EndCommand(attribute);
bidi.Fail();
return false;
}
deserializer->Hint("map_key");
bidi | key;
deserializer->EndCommand(attribute);
deserializer->Hint("map_value");
bidi | value;
deserializer->EndCommand(item);
return true;
}
return false;
}
示例2: Deserialize
bool AccessorObjectPropertyObject::Deserialize(IDeserializer &serializer, Object *object) const
{
Object *object_property = (object->*mObjectAccessor)();
Command command;
serializer.BeginCommand(command);
OrkAssertI(command.Type() == Command::EOBJECT,
"AccessorObjectPropertyObject::Deserialize::Expected an Object command!\n");
if(command.Type() == Command::EOBJECT)
{
object_property->Deserialize(serializer);
}
serializer.EndCommand(command);
return true;
}