MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / parseField

Method parseField

Engine/source/persistence/taml/json/tamlJSONReader.cpp:230–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228//-----------------------------------------------------------------------------
229
230inline 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

Callers

nothing calls this directly

Calls 4

warnfFunction · 0.85
setPrefixedDataFieldMethod · 0.80
insertMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected