diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-08-17 15:38:47 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-08-19 13:09:16 +0200 |
commit | 112bbc7ab289298094d6e6593437a71ec8029caa (patch) | |
tree | 229af7a6d7610e20edea65d565adbff9c9cd5f06 /include/mbgl/style/conversion/function.hpp | |
parent | 9df9f5fe2089a0dcd0d039115dec5cc63010603a (diff) | |
download | qtlocation-mapboxgl-112bbc7ab289298094d6e6593437a71ec8029caa.tar.gz |
[core] make style/conversion.hpp implementation private
Diffstat (limited to 'include/mbgl/style/conversion/function.hpp')
-rw-r--r-- | include/mbgl/style/conversion/function.hpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/include/mbgl/style/conversion/function.hpp b/include/mbgl/style/conversion/function.hpp index 49825a3410..ba9acd7a3b 100644 --- a/include/mbgl/style/conversion/function.hpp +++ b/include/mbgl/style/conversion/function.hpp @@ -1,8 +1,8 @@ #pragma once #include <mbgl/style/property_expression.hpp> -#include <mbgl/style/conversion.hpp> #include <mbgl/style/conversion/constant.hpp> +#include <mbgl/style/conversion.hpp> #include <mbgl/style/expression/expression.hpp> #include <mbgl/style/expression/value.hpp> @@ -16,25 +16,7 @@ std::unique_ptr<expression::Expression> convertTokenStringToExpression(const std optional<std::unique_ptr<expression::Expression>> convertFunctionToExpression(expression::type::Type, const Convertible&, Error&, bool convertTokens); template <class T> -optional<PropertyExpression<T>> convertFunctionToExpression(const Convertible& value, Error& error, bool convertTokens) { - auto expression = convertFunctionToExpression(expression::valueTypeToExpressionType<T>(), value, error, convertTokens); - if (!expression) { - return nullopt; - } - - optional<T> defaultValue; - - auto defaultValueValue = objectMember(value, "default"); - if (defaultValueValue) { - defaultValue = convert<T>(*defaultValueValue, error); - if (!defaultValue) { - error.message = R"(wrong type for "default": )" + error.message; - return nullopt; - } - } - - return PropertyExpression<T>(std::move(*expression), defaultValue); -} +optional<PropertyExpression<T>> convertFunctionToExpression(const Convertible& value, Error& error, bool convertTokens); } // namespace conversion } // namespace style |