This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
36 lines
793 B
C++
36 lines
793 B
C++
#ifndef MBGL_STORAGE_DEFAULT_FILE_SOURCE
|
|
#define MBGL_STORAGE_DEFAULT_FILE_SOURCE
|
|
|
|
#include <mbgl/storage/file_source.hpp>
|
|
|
|
namespace mbgl {
|
|
|
|
class SQLiteCache;
|
|
|
|
class DefaultFileSource : public FileSource {
|
|
public:
|
|
DefaultFileSource(const std::string& cachePath, const std::string& assetRoot);
|
|
~DefaultFileSource() override;
|
|
|
|
void setAccessToken(const std::string&);
|
|
std::string getAccessToken() const;
|
|
|
|
void setMaximumCacheSize(uint64_t size);
|
|
void setMaximumCacheEntrySize(uint64_t size);
|
|
|
|
std::unique_ptr<FileRequest> request(const Resource&, Callback) override;
|
|
|
|
// For testing purposes only.
|
|
SQLiteCache& getCache();
|
|
|
|
private:
|
|
class Impl;
|
|
friend class DefaultFileRequest;
|
|
|
|
const std::unique_ptr<Impl> impl;
|
|
};
|
|
|
|
} // namespace mbgl
|
|
|
|
#endif
|