#pragma once #include #include #include namespace mbgl { namespace style { namespace expression { class IndexOf : public Expression { public: IndexOf(std::unique_ptr keyword_, std::unique_ptr input_, std::unique_ptr fromIndex_); static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx); EvaluationResult evaluate(const EvaluationContext& params) const override; void eachChild(const std::function&) const override; bool operator==(const Expression& e) const noexcept override; std::vector> possibleOutputs() const override; std::string getOperator() const override { return "index-of"; } private: EvaluationResult evaluateForArrayInput(const std::vector& array, const Value& keyword, size_t fromIndex) const; EvaluationResult evaluateForStringInput(const std::string& string, const Value& keyword, size_t fromIndex) const; private: std::unique_ptr keyword; std::unique_ptr input; std::unique_ptr fromIndex; }; } // namespace expression } // namespace style } // namespace mbgl