MCPcopy Create free account
hub / github.com/axmolengine/axmol / eval_boolean

Method eval_boolean

3rdparty/pugixml/pugixml.cpp:10526–10664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10524 }
10525
10526 bool eval_boolean(const xpath_context& c, const xpath_stack& stack)
10527 {
10528 switch (_type)
10529 {
10530 case ast_op_or:
10531 return _left->eval_boolean(c, stack) || _right->eval_boolean(c, stack);
10532
10533 case ast_op_and:
10534 return _left->eval_boolean(c, stack) && _right->eval_boolean(c, stack);
10535
10536 case ast_op_equal:
10537 return compare_eq(_left, _right, c, stack, equal_to());
10538
10539 case ast_op_not_equal:
10540 return compare_eq(_left, _right, c, stack, not_equal_to());
10541
10542 case ast_op_less:
10543 return compare_rel(_left, _right, c, stack, less());
10544
10545 case ast_op_greater:
10546 return compare_rel(_right, _left, c, stack, less());
10547
10548 case ast_op_less_or_equal:
10549 return compare_rel(_left, _right, c, stack, less_equal());
10550
10551 case ast_op_greater_or_equal:
10552 return compare_rel(_right, _left, c, stack, less_equal());
10553
10554 case ast_func_starts_with:
10555 {
10556 xpath_allocator_capture cr(stack.result);
10557
10558 xpath_string lr = _left->eval_string(c, stack);
10559 xpath_string rr = _right->eval_string(c, stack);
10560
10561 return starts_with(lr.c_str(), rr.c_str());
10562 }
10563
10564 case ast_func_contains:
10565 {
10566 xpath_allocator_capture cr(stack.result);
10567
10568 xpath_string lr = _left->eval_string(c, stack);
10569 xpath_string rr = _right->eval_string(c, stack);
10570
10571 return find_substring(lr.c_str(), rr.c_str()) != 0;
10572 }
10573
10574 case ast_func_boolean:
10575 return _left->eval_boolean(c, stack);
10576
10577 case ast_func_not:
10578 return !_left->eval_boolean(c, stack);
10579
10580 case ast_func_true:
10581 return true;
10582
10583 case ast_func_false:

Callers 3

compare_eqMethod · 0.80
evaluate_booleanMethod · 0.80

Calls 15

equal_toClass · 0.85
not_equal_toClass · 0.85
less_equalClass · 0.85
find_substringFunction · 0.85
tolower_asciiFunction · 0.85
strequalFunction · 0.85
is_xpath_attributeFunction · 0.85
eval_stringMethod · 0.80
attributeMethod · 0.80
parentMethod · 0.80
get_stringMethod · 0.80

Tested by

no test coverage detected