separate SQLiteCache::Impl header from implementation file

This commit is contained in:
Konstantin Käfer
2015-04-13 18:38:39 +02:00
parent 352ff64e06
commit 1066504008
2 changed files with 45 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
#include <mbgl/storage/sqlite_cache.hpp>
#include "sqlite_cache_impl.hpp"
#include <mbgl/storage/request.hpp>
#include <mbgl/storage/response.hpp>
@@ -13,33 +13,6 @@
namespace mbgl {
class SQLiteCache::Impl : public util::RunLoop {
friend class util::Thread<SQLiteCache::Impl>;
public:
Impl(const std::string &path = ":memory:");
~Impl();
public:
void processGet(const Resource& resource, Callback callback);
void processPut(const Resource& resource, std::shared_ptr<const Response> response);
void processRefresh(const Resource& resource, int64_t expires);
private:
void createDatabase();
void createSchema();
private:
const std::string path;
std::unique_ptr<::mapbox::sqlite::Database> db;
std::unique_ptr<::mapbox::sqlite::Statement> getStmt;
std::unique_ptr<::mapbox::sqlite::Statement> putStmt;
std::unique_ptr<::mapbox::sqlite::Statement> refreshStmt;
bool schema = false;
};
std::string removeAccessTokenFromURL(const std::string &url) {
const size_t token_start = url.find("access_token=");
// Ensure that token exists, isn't at the front and is preceded by either & or ?.