summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-01-30 16:57:38 +0100
committerKonstantin Käfer <mail@kkaefer.com>2014-01-30 16:57:38 +0100
commit04c855bd649ce8589c81d653455e8b1e3e5900b2 (patch)
tree5c5e46c9e07ef33c1afbbba4bf4a17f5c0b8f6ea /include
parentbc07cb4b2615ba0f622189fdc30092a021750598 (diff)
downloadqtlocation-mapboxgl-04c855bd649ce8589c81d653455e8b1e3e5900b2.tar.gz
add request_http() function
refs #23
Diffstat (limited to 'include')
-rw-r--r--include/llmr/platform/platform.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llmr/platform/platform.hpp b/include/llmr/platform/platform.hpp
index 75d491cb09..ae34dc7ba9 100644
--- a/include/llmr/platform/platform.hpp
+++ b/include/llmr/platform/platform.hpp
@@ -2,6 +2,8 @@
#define LLMR_PLATFORM_IOS
#include <memory>
+#include <functional>
+#include <string>
namespace llmr {
@@ -18,6 +20,19 @@ void restart(void *obj);
// Then, call map.tileLoaded(tile); or map.tileFailed(tile); in the main thread.
void request(void *obj, std::shared_ptr<Tile> tile);
+
+struct Response {
+ Response(int16_t code, const char *body, size_t length)
+ : code(code),
+ body(body),
+ length(length) {}
+ int16_t code;
+ const char *body;
+ size_t length;
+};
+
+void request_http(std::string url, std::function<void(const Response&)> func);
+
// Returns a relative timestamp in seconds. This value must be monotonic.
double time();