MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / readDataTable

Method readDataTable

Engine/modules/Verve/Core/VController.cpp:648–670  ·  view source on GitHub ↗

----------------------------------------------------------------------------- VController::readDataTable( pElement ); Read the DataTable from a TinyXML document. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

646//
647//-----------------------------------------------------------------------------
648bool VController::readDataTable( TiXmlElement *pElement )
649{
650 TiXmlElement *dataTableRoot = pElement->FirstChildElement( "DataTable" );
651 if ( dataTableRoot )
652 {
653 for ( TiXmlElement *child = dataTableRoot->FirstChildElement(); child != NULL; child = child->NextSiblingElement() )
654 {
655 // Get Field Data.
656 const char *fieldType = child->Attribute( "Type" );
657 const char *fieldName = child->Attribute( "Name" );
658 const char *fieldValue = child->Attribute( "Value" );
659
660 // Add Data Item.
661 mDataTable.insert( VDataTable::getDataTypeEnum( fieldType ), fieldName );
662
663 // Set Field Value.
664 setDataField( StringTable->insert( fieldName ), NULL, fieldValue );
665 }
666 }
667
668 // Valid Read.
669 return true;
670}
671
672//-----------------------------------------------------------------------------
673//

Callers 1

readFunction · 0.45

Calls 4

FirstChildElementMethod · 0.80
NextSiblingElementMethod · 0.80
AttributeMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected