MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onTamlCustomRead

Method onTamlCustomRead

Engine/source/assets/assetQuery.cpp:80–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78//-----------------------------------------------------------------------------
79
80void AssetQuery::onTamlCustomRead( const TamlCustomNodes& customNodes )
81{
82 // Call parent.
83 Parent::onTamlCustomRead( customNodes );
84
85 // Find custom node name.
86 const TamlCustomNode* pResultsNode = customNodes.findNode( ASSETQUERY_RESULTS_NODE_NAME );
87
88 // Finish if we don't have a results name.
89 if ( pResultsNode == NULL )
90 return;
91
92 // Fetch node name.
93 StringTableEntry assetNodeName = StringTable->insert( ASSETQUERY_ASSETNODE_NAME );
94
95 // Fetch children asset nodes.
96 const TamlCustomNodeVector& assetNodes = pResultsNode->getChildren();
97
98 // Iterate asset nodes.
99 for( TamlCustomNodeVector::const_iterator assetNodeItr = assetNodes.begin(); assetNodeItr != assetNodes.end(); ++assetNodeItr )
100 {
101 // Fetch asset node.
102 const TamlCustomNode* pAssetNode = *assetNodeItr;
103
104 // Skip if an unknown node name.
105 if ( pAssetNode->getNodeName() != assetNodeName )
106 continue;
107
108 // Fetch field.
109 const TamlCustomField* pField = pAssetNode->findField( ASSETQUERY_ASSETID_FIELD_NAME );
110
111 // Do we find the field?
112 if ( pField == NULL )
113 {
114 // No, so warn.
115 Con::warnf( "AssetQuery::onTamlCustomRead() - Could not find '%s' field.", ASSETQUERY_ASSETID_FIELD_NAME );
116 continue;
117 }
118
119 // Store asset.
120 mAssetList.push_back(pField->getFieldValue());
121 }
122}

Callers

nothing calls this directly

Calls 10

getNodeNameMethod · 0.80
warnfFunction · 0.50
findNodeMethod · 0.45
insertMethod · 0.45
getChildrenMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findFieldMethod · 0.45
push_backMethod · 0.45
getFieldValueMethod · 0.45

Tested by

no test coverage detected