MCPcopy Create free account
hub / github.com/MyGUI/mygui / apply_predicate

Method apply_predicate

Tools/EditorFramework/pugixml.cpp:8323–8347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8321 }
8322
8323 void apply_predicate(xpath_node_set_raw& ns, size_t first, xpath_ast_node* expr, const xpath_stack& stack)
8324 {
8325 assert(ns.size() >= first);
8326
8327 size_t i = 1;
8328 size_t size = ns.size() - first;
8329
8330 xpath_node* last = ns.begin() + first;
8331
8332 // remove_if... or well, sort of
8333 for (xpath_node* it = last; it != ns.end(); ++it, ++i)
8334 {
8335 xpath_context c(*it, i, size);
8336
8337 if (expr->rettype() == xpath_type_number)
8338 {
8339 if (expr->eval_number(c, stack) == i)
8340 *last++ = *it;
8341 }
8342 else if (expr->eval_boolean(c, stack))
8343 *last++ = *it;
8344 }
8345
8346 ns.truncate(last);
8347 }
8348
8349 void apply_predicates(xpath_node_set_raw& ns, size_t first, const xpath_stack& stack)
8350 {

Callers

nothing calls this directly

Calls 7

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
rettypeMethod · 0.45
eval_numberMethod · 0.45
eval_booleanMethod · 0.45
truncateMethod · 0.45

Tested by

no test coverage detected