diff options
Diffstat (limited to 'platform/android/src/style/conversion/types.hpp.ejs')
-rw-r--r-- | platform/android/src/style/conversion/types.hpp.ejs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/platform/android/src/style/conversion/types.hpp.ejs b/platform/android/src/style/conversion/types.hpp.ejs new file mode 100644 index 0000000000..de26d061f7 --- /dev/null +++ b/platform/android/src/style/conversion/types.hpp.ejs @@ -0,0 +1,40 @@ +<% + const properties = locals.properties; +-%> +// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`. +#pragma once + +#include "types_string_values.hpp" +#include "../../conversion/conversion.hpp" +#include "../../conversion/constant.hpp" + +#include <mbgl/style/types.hpp> +#include <mbgl/util/optional.hpp> +#include <jni/jni.hpp> + +#include <string> + +namespace mbgl { +namespace android { +namespace conversion { + +template <> +struct Converter<jni::jobject*, mbgl::style::VisibilityType> { + Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::VisibilityType& value) const { + return convert<jni::jobject*, std::string>(env, toString(value)); + } +}; + +<% for (const property of properties) { -%> +template <> +struct Converter<jni::jobject*, mbgl::style::<%- propertyNativeType(property) %>> { + Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::<%- propertyNativeType(property) %>& value) const { + return convert<jni::jobject*, std::string>(env, toString(value)); + } +}; + +<% } -%> + +} // namespace conversion +} // namespace android +} // namespace mbgl
\ No newline at end of file |