@@ -478,6 +478,41 @@ class SimpleEvaluator {
478
478
evaluate (EvaluationContext& context) const BSLS_KEYWORD_OVERRIDE;
479
479
};
480
480
481
+ // ---
482
+ // Exists
483
+ // ---
484
+
485
+ class Exists : public Expression {
486
+ private:
487
+ // DATA
488
+
489
+ // The name of the property.
490
+ bsl::string d_name;
491
+
492
+ public:
493
+ // CREATORS
494
+
495
+ // / Create an object that evaluates property `name`, in the
496
+ // / evaluation context, as a boolean.
497
+ explicit Exists (const bsl::string& name);
498
+
499
+ #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \
500
+ defined (BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
501
+ // / Create an object that evaluates property `name`, in the
502
+ // / evaluation context, as a boolean.
503
+ explicit Exists(bsl::string&& name) noexcept ;
504
+ #endif
505
+
506
+ // ACCESSORS
507
+
508
+ // / Evaluate `expression` passed to the constructor. If it is a
509
+ // / boolean, return the negated value as a boolean Datum.
510
+ // / Otherwise, set the error in the context to e_TYPE, stop the
511
+ // / evaluation, and return a null datum.
512
+ bdld::Datum
513
+ evaluate (EvaluationContext& context) const BSLS_KEYWORD_OVERRIDE;
514
+ };
515
+
481
516
private:
482
517
// SimpleEvaluator(const SimpleEvaluator& other) BSLS_KEYWORD_DELETED;
483
518
// SimpleEvaluator& operator=(const SimpleEvaluator& other)
@@ -549,6 +584,7 @@ class SimpleEvaluator {
549
584
friend class SimpleEvaluatorScanner ; // for access to Expression hierarchy
550
585
friend class CompilationContext ; // for access to ExpressionPtr
551
586
};
587
+
552
588
// ========================
553
589
// class CompilationContext
554
590
// ========================
0 commit comments