#pragma once #include #include #include #include #include namespace mbgl { namespace style { namespace expression { struct FormatExpressionSection { FormatExpressionSection(std::unique_ptr text_, optional> fontScale_, optional> textFont_); std::shared_ptr text; optional> fontScale; optional> textFont; }; class FormatExpression : public Expression { public: FormatExpression(std::vector sections); EvaluationResult evaluate(const EvaluationContext&) const override; static ParseResult parse(const mbgl::style::conversion::Convertible&, ParsingContext&); void eachChild(const std::function&) const override; bool operator==(const Expression& e) const override; std::vector> possibleOutputs() const override { // Technically the combinatoric set of all children // Usually, this.text will be undefined anyway return { nullopt }; } mbgl::Value serialize() const override; std::string getOperator() const override { return "format"; } private: std::vector sections; std::unique_ptr text; optional> fontScale; optional> textFont; }; } // namespace expression } // namespace style } // namespace mbgl