MCPcopy Create free account
hub / github.com/WheretIB/nullc / string_value

Function string_value

external/pugixml/pugixml.cpp:5412–5460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5410 }
5411
5412 xpath_string string_value(const xpath_node& na, xpath_allocator* alloc)
5413 {
5414 if (na.attribute())
5415 return xpath_string_const(na.attribute().value());
5416 else
5417 {
5418 const xml_node& n = na.node();
5419
5420 switch (n.type())
5421 {
5422 case node_pcdata:
5423 case node_cdata:
5424 case node_comment:
5425 case node_pi:
5426 return xpath_string_const(n.value());
5427
5428 case node_document:
5429 case node_element:
5430 {
5431 xpath_string result;
5432
5433 xml_node cur = n.first_child();
5434
5435 while (cur && cur != n)
5436 {
5437 if (cur.type() == node_pcdata || cur.type() == node_cdata)
5438 result.append(xpath_string_const(cur.value()), alloc);
5439
5440 if (cur.first_child())
5441 cur = cur.first_child();
5442 else if (cur.next_sibling())
5443 cur = cur.next_sibling();
5444 else
5445 {
5446 while (!cur.next_sibling() && cur != n)
5447 cur = cur.parent();
5448
5449 if (cur != n) cur = cur.next_sibling();
5450 }
5451 }
5452
5453 return result;
5454 }
5455
5456 default:
5457 return xpath_string();
5458 }
5459 }
5460 }
5461
5462 unsigned int node_height(xml_node n)
5463 {

Callers 4

compare_eqMethod · 0.85
compare_relMethod · 0.85
eval_numberMethod · 0.85
eval_stringMethod · 0.85

Calls 10

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

Tested by

no test coverage detected