MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / setOptions

Method setOptions

src/QLPredicate.actor.cpp:475–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475void RegExPredicate::setOptions(const std::string& _options) {
476 // According to http://docs.mongodb.org/manual/reference/operator/query/regex/
477 // Options can be only "i", "x", "m" and "s"
478 options = pcrecpp::RE_Options();
479 options.set_caseless(_options.find('i') != std::string::npos);
480 options.set_multiline(_options.find('m') != std::string::npos);
481 options.set_extended(_options.find('x') != std::string::npos);
482 options.set_dotall(_options.find('s') != std::string::npos);
483
484 const auto& pattern = re->pattern();
485 re.reset(new pcrecpp::RE(pattern, options));
486
487 // we need to recalculate this after each change of options
488 calculateRange();
489}
490
491Future<bool> RegExPredicate::evaluate(const Reference<IReadContext>& context) {
492 Future<DataValue> fdv = getMaybeRecursive(context, StringRef());

Callers 1

valueQueryToPredicatesFunction · 0.80

Calls 2

findMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected