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

Method eval_boolean

Source/ThirdParty/pugixml/pugixml.cpp:9234–9370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9232 }
9233
9234 bool eval_boolean(const xpath_context& c, const xpath_stack& stack)
9235 {
9236 switch (_type)
9237 {
9238 case ast_op_or:
9239 return _left->eval_boolean(c, stack) || _right->eval_boolean(c, stack);
9240
9241 case ast_op_and:
9242 return _left->eval_boolean(c, stack) && _right->eval_boolean(c, stack);
9243
9244 case ast_op_equal:
9245 return compare_eq(_left, _right, c, stack, equal_to());
9246
9247 case ast_op_not_equal:
9248 return compare_eq(_left, _right, c, stack, not_equal_to());
9249
9250 case ast_op_less:
9251 return compare_rel(_left, _right, c, stack, less());
9252
9253 case ast_op_greater:
9254 return compare_rel(_right, _left, c, stack, less());
9255
9256 case ast_op_less_or_equal:
9257 return compare_rel(_left, _right, c, stack, less_equal());
9258
9259 case ast_op_greater_or_equal:
9260 return compare_rel(_right, _left, c, stack, less_equal());
9261
9262 case ast_func_starts_with:
9263 {
9264 xpath_allocator_capture cr(stack.result);
9265
9266 xpath_string lr = _left->eval_string(c, stack);
9267 xpath_string rr = _right->eval_string(c, stack);
9268
9269 return starts_with(lr.c_str(), rr.c_str());
9270 }
9271
9272 case ast_func_contains:
9273 {
9274 xpath_allocator_capture cr(stack.result);
9275
9276 xpath_string lr = _left->eval_string(c, stack);
9277 xpath_string rr = _right->eval_string(c, stack);
9278
9279 return find_substring(lr.c_str(), rr.c_str()) != 0;
9280 }
9281
9282 case ast_func_boolean:
9283 return _left->eval_boolean(c, stack);
9284
9285 case ast_func_not:
9286 return !_left->eval_boolean(c, stack);
9287
9288 case ast_func_true:
9289 return true;
9290
9291 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
lessClass · 0.85
less_equalClass · 0.85
starts_withFunction · 0.85
find_substringFunction · 0.85
tolower_asciiFunction · 0.85
is_xpath_attributeFunction · 0.85
eval_stringMethod · 0.80
attributeMethod · 0.80
nodeMethod · 0.80

Tested by

no test coverage detected