diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-09-30 10:46:53 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-09-30 17:29:09 +0200 |
commit | a9039cf5d75f4da667d9279d61f7549c43f7ea51 (patch) | |
tree | 90c9efa3c7e2c42a19d7124755a8d21200da2f8b /include | |
parent | 5d34c18c808f1fb077f74869b08ff3dc959cb638 (diff) | |
download | qtlocation-mapboxgl-a9039cf5d75f4da667d9279d61f7549c43f7ea51.tar.gz |
move file request baton to its own file
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/storage/file_request_baton.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/mbgl/storage/file_request_baton.hpp b/include/mbgl/storage/file_request_baton.hpp new file mode 100644 index 0000000000..0f1968ca13 --- /dev/null +++ b/include/mbgl/storage/file_request_baton.hpp @@ -0,0 +1,35 @@ +#ifndef MBGL_STORAGE_FILE_REQUEST_BATON +#define MBGL_STORAGE_FILE_REQUEST_BATON + +#include <mbgl/storage/file_request.hpp> + +#include <uv.h> + +namespace mbgl { + +struct FileRequestBaton { + FileRequestBaton(FileRequest *request_, const std::string &path, uv_loop_t *loop); + ~FileRequestBaton(); + + void cancel(); + static void file_opened(uv_fs_t *req); + static void file_stated(uv_fs_t *req); + static void file_read(uv_fs_t *req); + static void file_closed(uv_fs_t *req); + static void notify_error(uv_fs_t *req); + static void cleanup(uv_fs_t *req); + + const unsigned long thread_id; + FileRequest *request = nullptr; + uv_fs_t req; + uv_file fd = -1; + bool canceled = false; + std::string body; + uv_buf_t buffer; +}; + + +} + + +#endif |