MCPcopy Create free account
hub / github.com/Kitware/VTK / eval_boolean

Method eval_boolean

ThirdParty/pugixml/vtkpugixml/src/pugixml.cpp:10862–11000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

compare_eqMethod · 0.80
evaluate_booleanMethod · 0.80

Calls 15

equal_toClass · 0.85
lessClass · 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
nodeMethod · 0.80
get_booleanMethod · 0.80

Tested by

no test coverage detected