----------------------------------------------------------------------------- VController::readDataTable( pElement ); Read the DataTable from a TinyXML document. -----------------------------------------------------------------------------
| 646 | // |
| 647 | //----------------------------------------------------------------------------- |
| 648 | bool 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 | // |
no test coverage detected