MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / pushFirstChildElement

Method pushFirstChildElement

engine/source/persistence/SimXMLDocument.cpp:191–223  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Get true if first child element was successfully pushed onto stack. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

189// Get true if first child element was successfully pushed onto stack.
190// -----------------------------------------------------------------------------
191bool SimXMLDocument::pushFirstChildElement(const char* rName)
192{
193 // Clear the current attribute pointer
194 m_CurrentAttribute = 0;
195
196 // Push the first element found under the current element of the given name
197 TiXmlElement* pElement;
198 if(!m_paNode.empty())
199 {
200 const int iLastElement = m_paNode.size() - 1;
201 TiXmlElement* pNode = m_paNode[iLastElement];
202 if(!pNode)
203 {
204 return false;
205 }
206 pElement = pNode->FirstChildElement(rName);
207 }
208 else
209 {
210 if(!m_qDocument)
211 {
212 return false;
213 }
214 pElement = m_qDocument->FirstChildElement(rName);
215 }
216
217 if(!pElement)
218 {
219 return false;
220 }
221 m_paNode.push_back(pElement);
222 return true;
223}
224
225// -----------------------------------------------------------------------------
226// Get true if first child element was successfully pushed onto stack.

Callers 1

Calls 4

emptyMethod · 0.45
sizeMethod · 0.45
FirstChildElementMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected