blob: d9e90507f9a59cfaa8b6c201f75306f13464af48 (
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
|
#pragma once
#include "json_element.hpp"
#include <mapbox/geometry.hpp>
#include <jni/jni.hpp>
namespace mbgl {
namespace android {
namespace gson {
class JsonPrimitive : public JsonElement {
public:
using value = mapbox::util::variant<mapbox::geometry::null_value_t, bool, uint64_t, int64_t, double, std::string>;
static constexpr auto Name() { return "com/google/gson/JsonPrimitive"; };
static jni::Object<JsonPrimitive> New(jni::JNIEnv&, const value&);
static value convert(JNIEnv&, jni::Object<JsonPrimitive>);
static bool isBoolean(JNIEnv&, jni::Object<JsonPrimitive>);
static bool isString(JNIEnv&, jni::Object<JsonPrimitive>);
static bool isNumber(JNIEnv&, jni::Object<JsonPrimitive>);
static bool getAsBoolean(JNIEnv&, jni::Object<JsonPrimitive>);
static std::string getAsString(JNIEnv&, jni::Object<JsonPrimitive>);
static double getAsDouble(JNIEnv&, jni::Object<JsonPrimitive>);
static void registerNative(jni::JNIEnv&);
};
} // namespace gson
} // namespace android
} // namespace mbgl
|