----------------------------------------------------------------------------- VDataTable::getItem( pIndex, *pDataItem ); Return the item with the given index. This method will return false if there is no valid data entry with that index. -----------------------------------------------------------------------------
| 141 | // |
| 142 | //----------------------------------------------------------------------------- |
| 143 | bool VDataTable::getItem( const S32 &pIndex, sDataItem *pDataItem ) |
| 144 | { |
| 145 | if ( pIndex < 0 || pIndex >= mDataMap.size() ) |
| 146 | { |
| 147 | // Invalid Field. |
| 148 | return false; |
| 149 | } |
| 150 | |
| 151 | S32 index = 0; |
| 152 | for ( VDataMap::Iterator itr = mDataMap.begin(); itr != mDataMap.end(); ++itr ) |
| 153 | { |
| 154 | if ( index == pIndex ) |
| 155 | { |
| 156 | if ( pDataItem ) |
| 157 | { |
| 158 | // Store Reference. |
| 159 | *pDataItem = ( itr->value ); |
| 160 | } |
| 161 | |
| 162 | // Valid Field. |
| 163 | return true; |
| 164 | } |
| 165 | |
| 166 | // Increment. |
| 167 | ++index; |
| 168 | } |
| 169 | |
| 170 | // Invalid Field. |
| 171 | return false; |
| 172 | } |
| 173 | |
| 174 | //----------------------------------------------------------------------------- |
| 175 | // |