summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-08-25 14:02:40 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-09-24 16:12:02 +0200
commit28446bed24689b2bac7c8bfbd37741a7fa4fa6be (patch)
tree96f8fd7a68025ec79516d83c5ef6e92209d9473f /include/mbgl
parent83fe11e0fc03dc7851f1e74974bbeb0ee3e37e21 (diff)
downloadqtlocation-mapboxgl-28446bed24689b2bac7c8bfbd37741a7fa4fa6be.tar.gz
compress data and store type
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/util/compression.hpp15
-rw-r--r--include/mbgl/util/filesource.hpp14
2 files changed, 22 insertions, 7 deletions
diff --git a/include/mbgl/util/compression.hpp b/include/mbgl/util/compression.hpp
new file mode 100644
index 0000000000..a33b2476a7
--- /dev/null
+++ b/include/mbgl/util/compression.hpp
@@ -0,0 +1,15 @@
+#ifndef MBGL_UTIL_COMPRESSION
+#define MBGL_UTIL_COMPRESSION
+
+#include <string>
+
+namespace mbgl {
+namespace util {
+
+std::string compress(const std::string &raw);
+std::string decompress(const std::string &raw);
+
+}
+}
+
+#endif
diff --git a/include/mbgl/util/filesource.hpp b/include/mbgl/util/filesource.hpp
index bc0a2927de..ccff4b5122 100644
--- a/include/mbgl/util/filesource.hpp
+++ b/include/mbgl/util/filesource.hpp
@@ -18,11 +18,11 @@ struct Response;
}
enum class ResourceType : uint8_t {
- Unknown,
- Tile,
- Glyphs,
- Image,
- JSON
+ Unknown = 0,
+ Tile = 1,
+ Glyphs = 2,
+ Image = 3,
+ JSON = 4
};
class FileSource : private util::noncopyable, public std::enable_shared_from_this<FileSource> {
@@ -38,8 +38,8 @@ public:
private:
void closeDatabase();
void createSchema();
- bool loadFile(const std::string &url, std::function<void(platform::Response *)> callback);
- void saveFile(const std::string &url, platform::Response *res);
+ bool loadFile(ResourceType type, const std::string &url, std::function<void(platform::Response *)> callback);
+ void saveFile(ResourceType type, const std::string &url, platform::Response *res);
private:
// Stores a URL that is used as a base for loading resources with relative path.