| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <mbgl/style/expression/expression.hpp> |
| 4 | #include <mbgl/style/conversion.hpp> |
| 5 | #include <mbgl/style/expression/parsing_context.hpp> |
| 6 | |
| 7 | #include <memory> |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace mbgl { |
| 11 | namespace style { |
| 12 | namespace expression { |
| 13 | |
| 14 | class Length : public Expression { |
| 15 | public: |
| 16 | Length(std::unique_ptr<Expression> input); |
| 17 | |
| 18 | static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx); |
| 19 | |
| 20 | EvaluationResult evaluate(const EvaluationContext& params) const override; |
| 21 | void eachChild(const std::function<void(const Expression&)>& visit) const override; |
| 22 | bool operator==(const Expression& e) const override; |
| 23 | std::vector<optional<Value>> possibleOutputs() const override; |
| 24 | std::string getOperator() const override { return "length"; } |
| 25 | |
| 26 | private: |
| 27 | std::unique_ptr<Expression> input; |
| 28 | }; |
| 29 | |
| 30 | } // namespace expression |
| 31 | } // namespace style |
| 32 | } // namespace mbgl |
| 33 |
