MCPcopy Create free account
hub / github.com/assimp/assimp / eval_boolean

Method eval_boolean

contrib/pugixml/src/pugixml.cpp:10861–10999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10859 }
10860
10861 bool eval_boolean(const xpath_context& c, const xpath_stack& stack)
10862 {
10863 switch (_type)
10864 {
10865 case ast_op_or:
10866 return _left->eval_boolean(c, stack) || _right->eval_boolean(c, stack);
10867
10868 case ast_op_and:
10869 return _left->eval_boolean(c, stack) && _right->eval_boolean(c, stack);
10870
10871 case ast_op_equal:
10872 return compare_eq(_left, _right, c, stack, equal_to());
10873
10874 case ast_op_not_equal:
10875 return compare_eq(_left, _right, c, stack, not_equal_to());
10876
10877 case ast_op_less:
10878 return compare_rel(_left, _right, c, stack, less());
10879
10880 case ast_op_greater:
10881 return compare_rel(_right, _left, c, stack, less());
10882
10883 case ast_op_less_or_equal:
10884 return compare_rel(_left, _right, c, stack, less_equal());
10885
10886 case ast_op_greater_or_equal:
10887 return compare_rel(_right, _left, c, stack, less_equal());
10888
10889 case ast_func_starts_with:
10890 {
10891 xpath_allocator_capture cr(stack.result);
10892
10893 xpath_string lr = _left->eval_string(c, stack);
10894 xpath_string rr = _right->eval_string(c, stack);
10895
10896 return starts_with(lr.c_str(), rr.c_str());
10897 }
10898
10899 case ast_func_contains:
10900 {
10901 xpath_allocator_capture cr(stack.result);
10902
10903 xpath_string lr = _left->eval_string(c, stack);
10904 xpath_string rr = _right->eval_string(c, stack);
10905
10906 return find_substring(lr.c_str(), rr.c_str()) != nullptr;
10907 }
10908
10909 case ast_func_boolean:
10910 return _left->eval_boolean(c, stack);
10911
10912 case ast_func_not:
10913 return !_left->eval_boolean(c, stack);
10914
10915 case ast_func_true:
10916 return true;
10917
10918 case ast_func_false:

Callers 3

compare_eqMethod · 0.80
evaluate_booleanMethod · 0.80

Calls 15

not_equal_toClass · 0.85
lessClass · 0.85
less_equalClass · 0.85
starts_withFunction · 0.85
find_substringFunction · 0.85
tolower_asciiFunction · 0.85
strequalFunction · 0.85
is_xpath_attributeFunction · 0.85
eval_stringMethod · 0.80
nodeMethod · 0.80
parentMethod · 0.80

Tested by

no test coverage detected