summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/format_expression.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/expression/format_expression.hpp')
-rw-r--r--include/mbgl/style/expression/format_expression.hpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/include/mbgl/style/expression/format_expression.hpp b/include/mbgl/style/expression/format_expression.hpp
index b00674a88e..180df0139d 100644
--- a/include/mbgl/style/expression/format_expression.hpp
+++ b/include/mbgl/style/expression/format_expression.hpp
@@ -1,11 +1,7 @@
#pragma once
#include <mbgl/style/expression/expression.hpp>
-#include <mbgl/style/expression/formatted.hpp>
#include <mbgl/style/expression/parsing_context.hpp>
-#include <mbgl/style/conversion.hpp>
-
-#include <memory>
namespace mbgl {
namespace style {
@@ -14,16 +10,18 @@ namespace expression {
struct FormatExpressionSection {
FormatExpressionSection(std::unique_ptr<Expression> text_,
optional<std::unique_ptr<Expression>> fontScale_,
- optional<std::unique_ptr<Expression>> textFont_);
+ optional<std::unique_ptr<Expression>> textFont_,
+ optional<std::unique_ptr<Expression>> textColor_);
std::shared_ptr<Expression> text;
optional<std::shared_ptr<Expression>> fontScale;
optional<std::shared_ptr<Expression>> textFont;
+ optional<std::shared_ptr<Expression>> textColor;
};
-class FormatExpression : public Expression {
+class FormatExpression final : public Expression {
public:
- FormatExpression(std::vector<FormatExpressionSection> sections);
+ explicit FormatExpression(std::vector<FormatExpressionSection> sections);
EvaluationResult evaluate(const EvaluationContext&) const override;
static ParseResult parse(const mbgl::style::conversion::Convertible&, ParsingContext&);
@@ -38,13 +36,12 @@ public:
return { nullopt };
}
+ const std::vector<FormatExpressionSection>& getSections() const { return sections; }
+
mbgl::Value serialize() const override;
std::string getOperator() const override { return "format"; }
private:
std::vector<FormatExpressionSection> sections;
- std::unique_ptr<Expression> text;
- optional<std::unique_ptr<Expression>> fontScale;
- optional<std::unique_ptr<Expression>> textFont;
};
} // namespace expression