summaryrefslogtreecommitdiff
path: root/include/mbgl/storage/online_file_source.hpp
blob: b52dce35f087ee52ad6d998ec2e63658b0393fd1 (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
#ifndef MBGL_STORAGE_ONLINE_FILE_SOURCE
#define MBGL_STORAGE_ONLINE_FILE_SOURCE

#include <mbgl/storage/file_source.hpp>

namespace mbgl {

namespace util {
template <typename T> class Thread;
} // namespace util

class OnlineFileSource : public FileSource {
public:
    OnlineFileSource();
    ~OnlineFileSource() override;

    void setAccessToken(const std::string& t) { accessToken = t; }
    std::string getAccessToken() const { return accessToken; }

    std::unique_ptr<AsyncRequest> request(const Resource&, Callback) override;

private:
    friend class OnlineFileRequestImpl;

    class Impl;
    const std::unique_ptr<util::Thread<Impl>> thread;
    std::string accessToken;
};

} // namespace mbgl

#endif