MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
number_format.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace mbgl {
7 namespace style {
8 namespace expression {
9 
10 class NumberFormat final : public Expression {
11 public:
12  NumberFormat(std::unique_ptr<Expression> number_,
13  std::unique_ptr<Expression> locale_,
14  std::unique_ptr<Expression> currency_,
15  std::unique_ptr<Expression> minFractionDigits_,
16  std::unique_ptr<Expression> maxFractionDigits_);
17 
18  ~NumberFormat() override;
19 
21 
22  EvaluationResult evaluate(const EvaluationContext& params) const override;
23  void eachChild(const std::function<void(const Expression&)>& visit) const override;
24  bool operator==(const Expression& e) const override;
25  std::vector<std::optional<Value>> possibleOutputs() const override;
26 
27  mbgl::Value serialize() const override;
28  std::string getOperator() const override { return "number-format"; }
29 
30 private:
31  std::unique_ptr<Expression> number;
32  std::unique_ptr<Expression> locale;
33  std::unique_ptr<Expression> currency;
34  std::unique_ptr<Expression> minFractionDigits;
35  std::unique_ptr<Expression> maxFractionDigits;
36 };
37 
38 } // namespace expression
39 } // namespace style
40 } // namespace mbgl
EvaluationResult evaluate(const EvaluationContext &params) const override
mbgl::Value serialize() const override
NumberFormat(std::unique_ptr< Expression > number_, std::unique_ptr< Expression > locale_, std::unique_ptr< Expression > currency_, std::unique_ptr< Expression > minFractionDigits_, std::unique_ptr< Expression > maxFractionDigits_)
std::vector< std::optional< Value > > possibleOutputs() const override
std::string getOperator() const override
bool operator==(const Expression &e) const override
static ParseResult parse(const mbgl::style::conversion::Convertible &value, ParsingContext &ctx)
void eachChild(const std::function< void(const Expression &)> &visit) const override
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