#pragma once #include #include namespace mbgl { namespace style { namespace expression { struct FormatExpressionSection { explicit FormatExpressionSection(std::unique_ptr content_); void setTextSectionOptions(optional> fontScale_, optional> textFont_, optional> textColor_); // Content can be expression that evaluates to String or Image. std::shared_ptr content; // Text related section options. optional> fontScale; optional> textFont; optional> textColor; }; class FormatExpression final : public Expression { public: explicit 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 }; } const std::vector& getSections() const { return sections; } mbgl::Value serialize() const override; std::string getOperator() const override { return "format"; } private: std::vector sections; }; } // namespace expression } // namespace style } // namespace mbgl