本文整理汇总了C++中xml::Attribute::AsUint方法的典型用法代码示例。如果您正苦于以下问题:C++ Attribute::AsUint方法的具体用法?C++ Attribute::AsUint怎么用?C++ Attribute::AsUint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Attribute
的用法示例。
在下文中一共展示了Attribute::AsUint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProtoDeSerializeProperties
void WorldProxy::ProtoDeSerializeProperties(const XML::Node& SelfRoot)
{
XML::Attribute CurrAttrib;
XML::Node PropertiesNode = SelfRoot.GetChild( WorldProxy::GetSerializableName() + "Properties" );
if( !PropertiesNode.Empty() ) {
if(PropertiesNode.GetAttribute("Version").AsInt() == 1) {
CurrAttrib = PropertiesNode.GetAttribute("ProxyID");
if( !CurrAttrib.Empty() )
this->ProxyID = static_cast<UInt32>( CurrAttrib.AsUint() );
XML::Node PositionNode = PropertiesNode.GetChild("Location").GetFirstChild();
if( !PositionNode.Empty() ) {
Vector3 Loc(PositionNode);
this->SetLocation(Loc);
}
XML::Node OrientationNode = PropertiesNode.GetChild("Orientation").GetFirstChild();
if( !PositionNode.Empty() ) {
Quaternion Rot(OrientationNode);
this->SetOrientation(Rot);
}
XML::Node ScaleNode = PropertiesNode.GetChild("Scale").GetFirstChild();
if( !PositionNode.Empty() ) {
Vector3 Scale(ScaleNode);
this->SetScale(Scale);
}
}else{
MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + (WorldProxy::GetSerializableName() + "Properties" ) + ": Not Version 1.");
}
}else{
MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,WorldProxy::GetSerializableName() + "Properties" + " was not found in the provided XML node, which was expected.");
}
}
示例2: ProtoDeSerializeStateGroupBindings
void Widget::ProtoDeSerializeStateGroupBindings(const XML::Node& SelfRoot)
{
this->StateGroupBindings.clear();
XML::Attribute CurrAttrib;
XML::Node BindingsNode = SelfRoot.GetChild( "StateGroupBindings" );
if( !BindingsNode.Empty() ) {
if( BindingsNode.GetAttribute("Version").AsInt() == 1 ) {
for( XML::NodeIterator BindingNodeIt = BindingsNode.begin() ; BindingNodeIt != BindingsNode.end() ; ++BindingNodeIt )
{
if( (*BindingNodeIt).GetAttribute("Version").AsInt() == 1 ) {
UInt32 StateID = 0;
CurrAttrib = (*BindingNodeIt).GetAttribute("StateID");
if( !CurrAttrib.Empty() )
StateID = CurrAttrib.AsUint();
CurrAttrib = (*BindingNodeIt).GetAttribute("LayerGroupID");
if( !CurrAttrib.Empty() ) {
UInt16 LayerGroupID = CurrAttrib.AsUint();
RenderLayerGroup* NamedGroup = this->GetRenderLayerGroup( LayerGroupID );
if( NamedGroup != NULL ) {
this->StateGroupBindings.insert( std::pair<UInt32,RenderLayerGroup*>(StateID,NamedGroup) );
}else{
StringStream ExceptionStream;
ExceptionStream << "Named RenderLayerGroup \"" << LayerGroupID << "\" not found when deserializing Widget named \"" << this->GetName() << "\".";
MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,ExceptionStream.str());
}
}
}else{
MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("StateGroupBindings") + ": Not Version 1.");
}
}
}else{
MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("StateGroupBindings") + ": Not Version 1.");
}
}
}
示例3: ProtoDeSerializeButtonBindings
void TabSet::ProtoDeSerializeButtonBindings(const XML::Node& SelfRoot)
{
this->SubSetBindings.clear();
XML::Attribute CurrAttrib;
XML::Node BindingsNode = SelfRoot.GetChild( "SubSetBindings" );
if( !BindingsNode.Empty() ) {
if( BindingsNode.GetAttribute("Version").AsInt() == 1 ) {
for( XML::NodeIterator BindingNodeIt = BindingsNode.begin() ; BindingNodeIt != BindingsNode.end() ; ++BindingNodeIt )
{
if( (*BindingNodeIt).GetAttribute("Version").AsInt() == 1 ) {
UInt16 ConfigID = 0;
String ButtonName;
CurrAttrib = (*BindingNodeIt).GetAttribute("ConfigID");
if( !CurrAttrib.Empty() )
ConfigID = static_cast<UInt16>( CurrAttrib.AsUint() );
CurrAttrib = (*BindingNodeIt).GetAttribute("ButtonName");
if( !CurrAttrib.Empty() )
ButtonName = CurrAttrib.AsString();
if( !ButtonName.empty() ) {
Widget* NamedButton = this->ParentScreen->GetWidget(ButtonName);
if( NamedButton != NULL && NamedButton->GetTypeName() == StackButton::TypeName ) {
this->SetButtonConfig(ConfigID,static_cast<StackButton*>(NamedButton));
}else{
StringStream ExceptionStream;
ExceptionStream << "Named StackButton \"" << ButtonName << "\" not found when deserializing Widget named \"" << this->GetName() << "\".";
MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,ExceptionStream.str());
}
}
}else{
MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("SubSetBindings") + ": Not Version 1.");
}
}
}else{
MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("SubSetBindings") + ": Not Version 1.");
}
}
}