MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / NavigateToNodeWithAttribute

Method NavigateToNodeWithAttribute

ogsr_engine/xrCore/XML_Parser/xrXMLParser.cpp:206–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204XML_NODE* CXml::NavigateToNode(LPCSTR path, int index) { return NavigateToNode(GetLocalRoot() ? GetLocalRoot() : GetRoot(), path, index); }
205
206XML_NODE* CXml::NavigateToNodeWithAttribute(LPCSTR tag_name, LPCSTR attrib_name, LPCSTR attrib_value)
207{
208 XML_NODE* root = GetLocalRoot() ? GetLocalRoot() : GetRoot();
209 const int tabsCount = GetNodesNum(root, tag_name);
210
211 for (int i = 0; i < tabsCount; ++i)
212 {
213 LPCSTR result = ReadAttrib(root, tag_name, i, attrib_name, "");
214 if (result && xr_strcmp(result, attrib_value) == 0)
215 {
216 return NavigateToNode(root, tag_name, i);
217 }
218 }
219 return NULL;
220}
221
222bool CXml::HasNode(LPCSTR path, int index)
223{

Callers 4

load_sharedMethod · 0.80
AddPhraseMethod · 0.80
LoadMethod · 0.80
InitializeMethod · 0.80

Calls 3

GetLocalRootFunction · 0.85
GetRootFunction · 0.85
xr_strcmpFunction · 0.50

Tested by

no test coverage detected