4#include "Stroika/Foundation/StroikaPreComp.h"
14using namespace Database;
15using namespace Database::Document;
22bool FilterElements::Equals::Matches (
const Database::Document::Document& doc)
const
24 if (optional<VariantValue> elt = doc.Lookup (fLHS)) {
26 optional<VariantValue> rhsValue = Memory::OptionalFromNullable (get_if<Value> (&fRHS));
29 rhsValue = doc.Lookup (get<FieldName> (fRHS));
31 return *elt == rhsValue;
36String FilterElements::Equals::ToString ()
const
40 sb <<
"op: EQUALS "sv;
41 sb <<
", lhs: "sv << fLHS;
42 sb <<
", rhs: "sv << fRHS;
52bool FilterElements::Matches (
const Operation& op,
const Database::Document::Document& doc)
54 if (
auto ei = get_if<Equals> (&op)) {
55 return ei->Matches (doc);
66bool Filter::Matches (
const Database::Document::Document& doc)
const
69 if (not FilterElements::Matches (op, doc)) {
80 sb <<
", conjunction: "sv << fConjunction_;
#define AssertNotReached()
variant< Equals > Operation
Similar to String, but intended to more efficiently construct a String. Mutable type (String is large...
String is like std::u32string, except it is much easier to use, often much more space efficient,...
nonvirtual String ToString() const