summaryrefslogtreecommitdiff
path: root/platform/android/src/style/conversion/types.hpp.ejs
blob: de26d061f7479b471aea74dbfa29c402c297d17f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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