当前位置: 首页>>代码示例>>C++>>正文


C++ Node::AppendAttribute方法代码示例

本文整理汇总了C++中xml::Node::AppendAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::AppendAttribute方法的具体用法?C++ Node::AppendAttribute怎么用?C++ Node::AppendAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xml::Node的用法示例。


在下文中一共展示了Node::AppendAttribute方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProtoSerialize

    void ActorRigid::ProtoSerialize(XML::Node& CurrentRoot) const
    {
        XML::Node ActorNode = CurrentRoot.AppendChild("ActorRigid");
        if (!ActorNode) { ThrowSerialError("create ActorRigidNode");}

        XML::Attribute Version = ActorNode.AppendAttribute("Version");
        if (Version)
            { Version.SetValue(1); }
        else
            { SerializeError("Create set Version on ActorRigid node", SerializableName()); }

        XML::Attribute ActorName = ActorNode.AppendAttribute("Name");
            ActorName.SetValue(this->GetName());
        XML::Attribute ActorFile = ActorNode.AppendAttribute("File");
            ActorFile.SetValue(this->GraphicsObject->getMesh()->getName());
        XML::Attribute ActorGroup = ActorNode.AppendAttribute("Group");
            ActorGroup.SetValue(this->GraphicsObject->getMesh()->getGroup());
        if( !(ActorName && ActorFile && ActorGroup) )
            { ThrowSerialError("creating ActorRigid Attributes");}

        XML::Node LinearMovementFactor = ActorNode.AppendChild("LinearMovementFactor");
        if (!LinearMovementFactor) { ThrowSerialError("create LinearMovementFactor Node"); }
        this->GetLinearMovementFactor().ProtoSerialize(LinearMovementFactor);

        XML::Node AngularMovementFactor = ActorNode.AppendChild("AngularMovementFactor");
        if (!AngularMovementFactor) { ThrowSerialError("create AngularMovementFactor Node"); }
        this->GetAngularMovementFactor().ProtoSerialize(AngularMovementFactor);

        ActorBase::ProtoSerialize(ActorNode);
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:30,代码来源:actorrigid.cpp

示例2: ProtoSerialize

        void CapsuleCollisionShape::ProtoSerialize(XML::Node& CurrentRoot) const
        {
            XML::Node CollisionNode = CurrentRoot.AppendChild(this->CapsuleCollisionShape::SerializableName());
            if (!CollisionNode) { SerializeError("create CollisionNode",this->CapsuleCollisionShape::SerializableName());}

            XML::Attribute Version = CollisionNode.AppendAttribute("Version");
            if (Version)
                { Version.SetValue(1); }
            else
                { SerializeError("Create Version Attribute", SerializableName()); }
/*
            XML::Attribute RadiusAttr = CollisionNode.AppendAttribute("Radius");
            if (RadiusAttr)
                { RadiusAttr.SetValue(this->GetCleanRadius()); }
            else
                { SerializeError("Create RadiusAttr Attribute", SerializableName()); }

            XML::Attribute HeightAttr = CollisionNode.AppendAttribute("Height");
            if (HeightAttr)
                { HeightAttr.SetValue(this->GetCleanHeight()); }
            else
                { SerializeError("Create HeightAttr Attribute", SerializableName()); }
*/
            XML::Attribute AxisAttr = CollisionNode.AppendAttribute("Axis");
            if (AxisAttr)
                { AxisAttr.SetValue(this->GetUpStandardAxis()); }
            else
                { SerializeError("Create AxisAttr Attribute", SerializableName()); }

            this->PrimitiveCollisionShape::ProtoSerialize(CollisionNode);
        }
开发者ID:zester,项目名称:Mezzanine,代码行数:31,代码来源:capsulecollisionshape.cpp

示例3: ProtoSerialize

    void WorldObject::ProtoSerialize(XML::Node& CurrentRoot) const
    {
        XML::Node WorldObjectNode = CurrentRoot.AppendChild("WorldObject");
        if (!WorldObjectNode) { ThrowSerialError("create WorldObjectNode");}

        XML::Node LocationNode = WorldObjectNode.AppendChild("Location");
        if (!LocationNode) { ThrowSerialError("create LocationNode"); }
        this->GetLocation().ProtoSerialize(LocationNode);

        XML::Node ScalingNode = WorldObjectNode.AppendChild("Scaling");
        if (!ScalingNode) { ThrowSerialError("create ScalingNode"); }
        this->GetScaling().ProtoSerialize(ScalingNode);

        this->GetGraphicsSettings()->ProtoSerialize(WorldObjectNode);
        this->GetPhysicsSettings()->ProtoSerialize(WorldObjectNode);

        XML::Attribute WorldObjectName = WorldObjectNode.AppendAttribute("Name");
            WorldObjectName.SetValue(this->GetName());
        XML::Attribute WorldObjectVersion = WorldObjectNode.AppendAttribute("Version");
            WorldObjectVersion.SetValue(1);
        XML::Attribute WorldObjectIsInWorld = WorldObjectNode.AppendAttribute("IsInWorld");
            WorldObjectIsInWorld.SetValue(this->IsInWorld());
        if ( !(WorldObjectName && WorldObjectVersion && WorldObjectIsInWorld) )
            { ThrowSerialError("create WorldObjectNode Attributes"); }

        /*XML::Attribute WorldObjectSoundSetName = WorldObjectNode.AppendAttribute("SoundSet");
        if(this->GetSounds())
        {
            WorldObjectSoundSetName.SetValue(this->GetSounds()->GetName());
        }else{
            WorldObjectSoundSetName.SetValue("");
        }//*/
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:33,代码来源:worldobject.cpp

示例4: ProtoSerializeProperties

        void SliderConstraint::ProtoSerializeProperties(XML::Node& SelfRoot) const
        {
            this->Constraint::ProtoSerializeProperties(SelfRoot);

            XML::Node PropertiesNode = SelfRoot.AppendChild( SliderConstraint::GetSerializableName() + "Properties" );

            if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
                PropertiesNode.AppendAttribute("UseFrameOffset").SetValue( this->GetUseFrameOffset() ) &&
                PropertiesNode.AppendAttribute("UpperLinLimit").SetValue( this->GetUpperLinLimit() ) &&
                PropertiesNode.AppendAttribute("UpperAngLimit").SetValue( this->GetUpperAngLimit() ) &&
                PropertiesNode.AppendAttribute("LowerLinLimit").SetValue( this->GetLowerLinLimit() ) &&
                PropertiesNode.AppendAttribute("LowerAngLimit").SetValue( this->GetLowerAngLimit() ) &&
                PropertiesNode.AppendAttribute("PoweredLinMotor").SetValue( this->GetPoweredLinMotor() ) &&
                PropertiesNode.AppendAttribute("PoweredAngMotor").SetValue( this->GetPoweredAngMotor() ) &&
                PropertiesNode.AppendAttribute("TargetLinMotorVelocity").SetValue( this->GetTargetLinMotorVelocity() ) &&
                PropertiesNode.AppendAttribute("TargetAngMotorVelocity").SetValue( this->GetTargetAngMotorVelocity() ) &&
                PropertiesNode.AppendAttribute("MaxLinMotorForce").SetValue( this->GetMaxLinMotorForce() ) &&
                PropertiesNode.AppendAttribute("MaxAngMotorForce").SetValue( this->GetMaxAngMotorForce() ) &&
                PropertiesNode.AppendAttribute("SoftnessLimLin").SetValue( this->GetSoftnessLimLin() ) &&
                PropertiesNode.AppendAttribute("SoftnessLimAng").SetValue( this->GetSoftnessLimAng() ) &&
                PropertiesNode.AppendAttribute("SoftnessOrthoLin").SetValue( this->GetSoftnessOrthoLin() ) &&
                PropertiesNode.AppendAttribute("SoftnessOrthoAng").SetValue( this->GetSoftnessOrthoAng() ) )
            {
                return;
            }else{
                SerializeError("Create XML Attribute Values",SliderConstraint::GetSerializableName() + "Properties",true);
            }
        }
开发者ID:,项目名称:,代码行数:28,代码来源:

示例5: ProtoSerialize

    void WorldProxy::ProtoSerialize(XML::Node& ParentNode) const
    {
        XML::Node SelfRoot = ParentNode.AppendChild(this->GetDerivedSerializableName());
        if( !SelfRoot.AppendAttribute("InWorld").SetValue( this->IsInWorld() ? "true" : "false" ) ) {
            SerializeError("Create XML Attribute Values",WorldProxy::GetSerializableName(),true);
        }

        this->ProtoSerializeImpl(SelfRoot);
    }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例6: ProtoSerialize

    void AreaEffect::ProtoSerialize(XML::Node& CurrentRoot) const
    {
        XML::Node AreaEffectNode = CurrentRoot.AppendChild("AreaEffect");
        if (!AreaEffectNode) { ThrowSerialError("create AreaEffectNode");}

        XML::Attribute AreaEffectVersion = AreaEffectNode.AppendAttribute("Version");
        AreaEffectVersion.SetValue(1);

        NonStaticWorldObject::ProtoSerialize(AreaEffectNode);
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:10,代码来源:areaeffect.cpp

示例7: AppendCurrentSettings

 void GraphicsManager::AppendCurrentSettings(XML::Node& SettingsRootNode)
 {
     // Create the Group node to be returned
     XML::Node CurrentSettings = SettingsRootNode.AppendChild("Current");
     // Create and initialize the rendersystem settings
     XML::Node RenderSystemNode = CurrentSettings.AppendChild("RenderSystem");
     RenderSystemNode.AppendAttribute("Name").SetValue( this->GetShortenedRenderSystemName(CurrRenderSys) );
     // Create and initialize the window configuration
     for( GameWindowIterator WinIt = this->BeginGameWindow() ; WinIt != this->EndGameWindow() ; ++WinIt )
         { (*WinIt)->ProtoSerialize(CurrentSettings); }
 }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例8: ProtoSerializeEvents

        void Widget::ProtoSerializeEvents(XML::Node& SelfRoot) const
        {
            XML::Node EventsNode = SelfRoot.AppendChild( "Events" );

            if( EventsNode.AppendAttribute("Version").SetValue("1") ) {
                for( ConstEventIterator EvIt = this->Events.begin() ; EvIt != this->Events.end() ; ++EvIt )
                {
                    XML::Node BindingNode = EventsNode.AppendChild( "Event" );

                    if( BindingNode.AppendAttribute("Version").SetValue("1") &&
                        BindingNode.AppendAttribute("Name").SetValue( (*EvIt).first ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","Event",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","Events",true);
            }
        }
开发者ID:,项目名称:,代码行数:21,代码来源:

示例9: ProtoSerializeStateGroupBindings

        void Widget::ProtoSerializeStateGroupBindings(XML::Node& SelfRoot) const
        {
            XML::Node BindingsNode = SelfRoot.AppendChild( "StateGroupBindings" );

            if( BindingsNode.AppendAttribute("Version").SetValue("1") ) {
                for( ConstStateLayerGroupIterator BindingIt = this->StateGroupBindings.begin() ; BindingIt != this->StateGroupBindings.end() ; ++BindingIt )
                {
                    XML::Node BindingNode = BindingsNode.AppendChild( "StateGroupBinding" );

                    if( BindingNode.AppendAttribute("Version").SetValue("1") &&
                        BindingNode.AppendAttribute("StateID").SetValue( (*BindingIt).first ) &&
                        BindingNode.AppendAttribute("LayerGroupID").SetValue( (*BindingIt).second->GetGroupID() ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","StateGroupBinding",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","StateGroupBindings",true);
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例10: ProtoSerializeButtonBindings

        void TabSet::ProtoSerializeButtonBindings(XML::Node& SelfRoot) const
        {
            XML::Node BindingsNode = SelfRoot.AppendChild( "SubSetBindings" );

            if( BindingsNode.AppendAttribute("Version").SetValue("1") ) {
                for( ConstTabbedSubSetIterator BindingIt = this->SubSetBindings.begin() ; BindingIt != this->SubSetBindings.end() ; ++BindingIt )
                {
                    XML::Node BindingNode = BindingsNode.AppendChild( "SubSetBinding" );

                    if( BindingNode.AppendAttribute("Version").SetValue("1") &&
                        BindingNode.AppendAttribute("ConfigID").SetValue( (*BindingIt).second ) &&
                        BindingNode.AppendAttribute("ButtonName").SetValue( (*BindingIt).first->GetName() ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","SubSetBinding",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","SubSetBindings",true);
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例11: ProtoSerializeCustomParameters

        void ParticleAffector::ProtoSerializeCustomParameters(XML::Node& SelfRoot) const
        {
            XML::Node CustomParametersNode = SelfRoot.AppendChild( "CustomParameters" );

            if( CustomParametersNode.AppendAttribute("Version").SetValue("1") )
            {
                for( NameValuePairMap::const_iterator ParamIt = this->CustomAffectorParameters.begin() ; ParamIt != this->CustomAffectorParameters.end() ; ++ParamIt )
                {
                    XML::Node CustomParamNode = CustomParametersNode.AppendChild( "CustomParam" );
                    if( CustomParamNode.AppendAttribute("Version").SetValue("1") &&
                        CustomParamNode.AppendAttribute("ParamName").SetValue( (*ParamIt).first ) &&
                        CustomParamNode.AppendAttribute("ParamValue").SetValue( (*ParamIt).second ) )
                    {
                        return;
                    }else{
                        SerializeError("Create XML Attribute Values",ParticleAffector::GetSerializableName() + "CustomParameters",true);
                    }
                }
            }else{
                SerializeError("Create XML Attribute Values",ParticleAffector::GetSerializableName() + "CustomParameters",true);
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例12: ProtoSerialize

    void Transform::ProtoSerialize(XML::Node& CurrentRoot) const
    {
        XML::Node TransformNode = CurrentRoot.AppendChild(SerializableName());                     // The base node all the base constraint stuff will go in
        if (!TransformNode)
            { SerializeError("Create TransformNode", SerializableName()); }

        Mezzanine::XML::Attribute Version = TransformNode.AppendAttribute("Version");                            // Version
        if (!Version)
            { SerializeError("Create Version", SerializableName()); }
        Version.SetValue(1);

        this->Location.ProtoSerialize(TransformNode);
        this->Rotation.ProtoSerialize(TransformNode);
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:14,代码来源:transform.cpp

示例13: ProtoSerializeGroupButtons

        void RadioButton::ProtoSerializeGroupButtons(XML::Node& SelfRoot) const
        {
            XML::Node ButtonsNode = SelfRoot.AppendChild( "GroupButtons" );

            if( ButtonsNode.AppendAttribute("Version").SetValue("1") ) {
                RadioButtonGroup::ConstRadioButtonIterator ButBeg = this->ButtonGroup->RadioButtonBegin();
                RadioButtonGroup::ConstRadioButtonIterator ButEnd = this->ButtonGroup->RadioButtonEnd();
                for( RadioButtonGroup::ConstRadioButtonIterator ButIt = ButBeg ; ButIt != ButEnd ; ++ButIt )
                {
                    XML::Node ButtonNode = ButtonsNode.AppendChild( "GroupButton" );

                    if( ButtonNode.AppendAttribute("Version").SetValue("1") &&
                        ButtonNode.AppendAttribute("GroupButtonName").SetValue( (*ButIt)->GetName() ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","GroupButton",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","GroupButtons",true);
            }
        }
开发者ID:,项目名称:,代码行数:23,代码来源:

示例14: SaveShapesToXMLFile

        void CollisionShapeManager::SaveShapesToXMLFile(const String& FileName, ShapeVector& ShapesToSave)
        {
            XML::Document ShapesDoc;
            XML::Node DeclNode = ShapesDoc.AppendChild(XML::NodeDeclaration);
            XML::Attribute VerAttrib = DeclNode.AppendAttribute("version");

            if( DeclNode.SetName("xml") && VerAttrib.SetValue("1.0") ) {
                XML::Node ShapesRoot = ShapesDoc.AppendChild( "ShapesRoot" );
                for( ShapeVectorIterator ShapeIt = ShapesToSave.begin() ; ShapeIt != ShapesToSave.end() ; ++ShapeIt )
                {
                    (*ShapeIt)->ProtoSerialize( ShapesRoot );
                }

                /// @todo Replace this stack allocated stream for one initialized from the Resource Manager, after the system is ready.
                Resource::FileStream SettingsStream(FileName,".",Resource::SF_Truncate | Resource::SF_Write);
                ShapesDoc.Save(SettingsStream,"\t",XML::FormatIndent);
            }else{
                MEZZ_EXCEPTION(ExceptionBase::INVALID_STATE_EXCEPTION,"Failed to create XML document declaration for file \"" + FileName + "\".");
            }
        }
开发者ID:,项目名称:,代码行数:20,代码来源:


注:本文中的xml::Node::AppendAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。