MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
collator_expression.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #include <memory>
8 
9 namespace mbgl {
10 namespace style {
11 namespace expression {
12 
14 public:
15  CollatorExpression(std::unique_ptr<Expression> caseSensitive,
16  std::unique_ptr<Expression> diacriticSensitive,
17  std::optional<std::unique_ptr<Expression>> locale);
18 
21 
22  void eachChild(const std::function<void(const Expression&)>&) const override;
23 
24  bool operator==(const Expression& e) const override;
25 
26  std::vector<std::optional<Value>> possibleOutputs() const override {
27  // Technically the set of possible outputs is the combinatoric set of Collators produced
28  // by all possibleOutputs of locale/caseSensitive/diacriticSensitive
29  // But for the primary use of Collators in comparison operators, we ignore the Collator's
30  // possibleOutputs anyway, so we can get away with leaving this undefined for now.
31  return { std::nullopt };
32  }
33 
34  mbgl::Value serialize() const override;
35  std::string getOperator() const override { return "collator"; }
36 private:
37  std::unique_ptr<Expression> caseSensitive;
38  std::unique_ptr<Expression> diacriticSensitive;
39  std::optional<std::unique_ptr<Expression>> locale;
40 };
41 
42 } // namespace expression
43 } // namespace style
44 } // namespace mbgl
EvaluationResult evaluate(const EvaluationContext &) const override
mbgl::Value serialize() const override
static ParseResult parse(const mbgl::style::conversion::Convertible &, ParsingContext &)
void eachChild(const std::function< void(const Expression &)> &) const override
std::vector< std::optional< Value > > possibleOutputs() const override
bool operator==(const Expression &e) const override
CollatorExpression(std::unique_ptr< Expression > caseSensitive, std::unique_ptr< Expression > diacriticSensitive, std::optional< std::unique_ptr< Expression >> locale)
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
std::optional< std::unique_ptr< Expression > > ParseResult
Definition: actor.hpp:15
mapbox::base::Value Value
Definition: feature.hpp:11