MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / xpath_string string_value

Function xpath_string string_value

src/pugiXML/pugixml.cpp:6031–6079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6029 }
6030
6031 PUGI__FN xpath_string string_value(const xpath_node& na, xpath_allocator* alloc)
6032 {
6033 if (na.attribute())
6034 return xpath_string_const(na.attribute().value());
6035 else
6036 {
6037 const xml_node& n = na.node();
6038
6039 switch (n.type())
6040 {
6041 case node_pcdata:
6042 case node_cdata:
6043 case node_comment:
6044 case node_pi:
6045 return xpath_string_const(n.value());
6046
6047 case node_document:
6048 case node_element:
6049 {
6050 xpath_string result;
6051
6052 xml_node cur = n.first_child();
6053
6054 while (cur && cur != n)
6055 {
6056 if (cur.type() == node_pcdata || cur.type() == node_cdata)
6057 result.append(xpath_string_const(cur.value()), alloc);
6058
6059 if (cur.first_child())
6060 cur = cur.first_child();
6061 else if (cur.next_sibling())
6062 cur = cur.next_sibling();
6063 else
6064 {
6065 while (!cur.next_sibling() && cur != n)
6066 cur = cur.parent();
6067
6068 if (cur != n) cur = cur.next_sibling();
6069 }
6070 }
6071
6072 return result;
6073 }
6074
6075 default:
6076 return xpath_string();
6077 }
6078 }
6079 }
6080
6081 PUGI__FN unsigned int node_height(xml_node n)
6082 {

Callers

nothing calls this directly

Calls 9

xpath_stringFunction · 0.85
attributeMethod · 0.80
valueMethod · 0.80
nodeMethod · 0.80
first_childMethod · 0.80
appendMethod · 0.80
next_siblingMethod · 0.80
parentMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected