use filesource object for loading all http stuff

This commit is contained in:
Konstantin Käfer
2014-08-08 15:08:41 +02:00
parent 70a31baf5c
commit a045d9c9d4
9 changed files with 117 additions and 30 deletions

27
src/util/filesource.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include <mbgl/util/filesource.hpp>
#include <mbgl/platform/platform.hpp>
namespace mbgl {
FileSource::FileSource(const std::shared_ptr<uv::loop> &loop)
: loop(loop) {}
void FileSource::setBase(const std::string &value) {
base = value;
}
const std::string &FileSource::getBase() const {
return base;
}
void FileSource::load(ResourceType type, const std::string &url, std::function<void(platform::Response *)> callback) {
// convert relative URLs to absolute URLs
// try to load from disk (not yet)
// load from the internet
platform::request_http(url, callback, loop);
}
}