[core] Implement 'in' expression. (#16162)
* Implement in.cpp * Fix review comments. * Add expression_equality test for 'in' * Fix review comments. * [core] Update changelog. * [core] Update mapbox-gl-js * [core] Ignore render-tests/debug/padding * [core] Update baseline.
This commit is contained in:
@@ -168,6 +168,7 @@ enum class Kind : int32_t {
|
||||
FormatSectionOverride,
|
||||
NumberFormat,
|
||||
ImageExpression,
|
||||
In,
|
||||
Within
|
||||
};
|
||||
|
||||
|
||||
33
include/mbgl/style/expression/in.hpp
Normal file
33
include/mbgl/style/expression/in.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/conversion.hpp>
|
||||
#include <mbgl/style/expression/expression.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace mbgl {
|
||||
namespace style {
|
||||
namespace expression {
|
||||
|
||||
class In final : public Expression {
|
||||
public:
|
||||
In(std::unique_ptr<Expression> needle_, std::unique_ptr<Expression> haystack_);
|
||||
|
||||
static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx);
|
||||
|
||||
EvaluationResult evaluate(const EvaluationContext& params) const override;
|
||||
void eachChild(const std::function<void(const Expression&)>&) const override;
|
||||
|
||||
bool operator==(const Expression& e) const override;
|
||||
|
||||
std::vector<optional<Value>> possibleOutputs() const override;
|
||||
|
||||
std::string getOperator() const override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Expression> needle;
|
||||
std::unique_ptr<Expression> haystack;
|
||||
};
|
||||
|
||||
} // namespace expression
|
||||
} // namespace style
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user