summaryrefslogtreecommitdiff
path: root/platform/android/src/storage/default_file_source_peer.hpp
blob: c0f60447b309ebd53e4b8fb99f0b78a47d3b5141 (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
#pragma once

#include <jni/jni.hpp>

#include <memory>

namespace mbgl {

class DefaultFileSource;

namespace android {

class DefaultFileSourcePeer {
public:
    static constexpr auto Name() { return "com/mapbox/mapboxsdk/storage/DefaultFileSource"; }
    static jni::Class<DefaultFileSourcePeer> javaClass;
    static void registerNative(jni::JNIEnv&);

    DefaultFileSourcePeer(jni::JNIEnv&,
                          jni::String cachePath,
                          jni::String assetRoot,
                          jni::jlong maximumCacheSize);
    ~DefaultFileSourcePeer();

    void setAPIBaseURL(jni::JNIEnv&, jni::String);
    jni::String getAPIBaseURL(jni::JNIEnv&);

    void setAccessToken(jni::JNIEnv&, jni::String);
    jni::String getAccessToken(jni::JNIEnv&);

    DefaultFileSource& getFileSource() {
      return *native;
    }

private:
    const std::unique_ptr<DefaultFileSource> native;
};

} // namespace android
} // namespace mbgl