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