MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenImageIO / eval_boolean

Method eval_boolean

src/include/pugixml.cpp:8025–8152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8023 }
8024
8025 bool eval_boolean(const xpath_context& c, const xpath_stack& stack)
8026 {
8027 switch (_type)
8028 {
8029 case ast_op_or:
8030 return _left->eval_boolean(c, stack) || _right->eval_boolean(c, stack);
8031
8032 case ast_op_and:
8033 return _left->eval_boolean(c, stack) && _right->eval_boolean(c, stack);
8034
8035 case ast_op_equal:
8036 return compare_eq(_left, _right, c, stack, equal_to());
8037
8038 case ast_op_not_equal:
8039 return compare_eq(_left, _right, c, stack, not_equal_to());
8040
8041 case ast_op_less:
8042 return compare_rel(_left, _right, c, stack, less());
8043
8044 case ast_op_greater:
8045 return compare_rel(_right, _left, c, stack, less());
8046
8047 case ast_op_less_or_equal:
8048 return compare_rel(_left, _right, c, stack, less_equal());
8049
8050 case ast_op_greater_or_equal:
8051 return compare_rel(_right, _left, c, stack, less_equal());
8052
8053 case ast_func_starts_with:
8054 {
8055 xpath_allocator_capture cr(stack.result);
8056
8057 xpath_string lr = _left->eval_string(c, stack);
8058 xpath_string rr = _right->eval_string(c, stack);
8059
8060 return starts_with(lr.c_str(), rr.c_str());
8061 }
8062
8063 case ast_func_contains:
8064 {
8065 xpath_allocator_capture cr(stack.result);
8066
8067 xpath_string lr = _left->eval_string(c, stack);
8068 xpath_string rr = _right->eval_string(c, stack);
8069
8070 return find_substring(lr.c_str(), rr.c_str()) != 0;
8071 }
8072
8073 case ast_func_boolean:
8074 return _left->eval_boolean(c, stack);
8075
8076 case ast_func_not:
8077 return !_left->eval_boolean(c, stack);
8078
8079 case ast_func_true:
8080 return true;
8081
8082 case ast_func_false:

Callers 3

compare_eqMethod · 0.80
apply_predicateMethod · 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
eval_stringMethod · 0.80
nodeMethod · 0.80
parentMethod · 0.80
get_booleanMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected