| 228 | //----------------------------------------------------------------------------- |
| 229 | |
| 230 | inline void TamlJSONReader::parseField( rapidjson::Value::ConstMemberIterator& memberItr, SimObject* pSimObject ) |
| 231 | { |
| 232 | // Debug Profiling. |
| 233 | PROFILE_SCOPE(TamlJSONReader_ParseField); |
| 234 | |
| 235 | // Fetch name and value. |
| 236 | const rapidjson::Value& name = memberItr->name; |
| 237 | const rapidjson::Value& value = memberItr->value; |
| 238 | |
| 239 | // Insert the field name. |
| 240 | StringTableEntry fieldName = StringTable->insert( name.GetString() ); |
| 241 | |
| 242 | // Ignore if this is a Taml attribute. |
| 243 | if ( fieldName == tamlRefIdName || |
| 244 | fieldName == tamlRefToIdName || |
| 245 | fieldName == tamlNamedObjectName ) |
| 246 | return; |
| 247 | |
| 248 | // Get field value. |
| 249 | char valueBuffer[4096]; |
| 250 | if ( !parseStringValue( valueBuffer, sizeof(valueBuffer), value, fieldName ) ) |
| 251 | { |
| 252 | // Warn. |
| 253 | Con::warnf( "Taml::parseField() Could not interpret value for field '%s'", fieldName ); |
| 254 | return; |
| 255 | } |
| 256 | |
| 257 | // Set field. |
| 258 | pSimObject->setPrefixedDataField(fieldName, NULL, valueBuffer); |
| 259 | } |
| 260 | |
| 261 | //----------------------------------------------------------------------------- |
| 262 |
nothing calls this directly
no test coverage detected