summaryrefslogtreecommitdiff
path: root/render-test/file_source.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'render-test/file_source.hpp')
-rw-r--r--render-test/file_source.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/render-test/file_source.hpp b/render-test/file_source.hpp
new file mode 100644
index 0000000000..58acf7b6ad
--- /dev/null
+++ b/render-test/file_source.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include <mbgl/storage/default_file_source.hpp>
+
+namespace mbgl {
+
+class ProxyFileSource : public DefaultFileSource {
+public:
+ ProxyFileSource(const std::string& cachePath, const std::string& assetPath, bool supportCacheOnlyRequests = true);
+ ProxyFileSource(const std::string& cachePath,
+ std::unique_ptr<FileSource>&& assetFileSource,
+ bool supportCacheOnlyRequests = true);
+ ~ProxyFileSource();
+
+ std::unique_ptr<AsyncRequest> request(const Resource&, Callback);
+
+ /**
+ * @brief Starts/stops metrics tracking.
+ */
+ static void setTrackingActive(bool);
+ /**
+ * @brief Returns metrics tracking status.
+ */
+ static bool isTrackingActive();
+ /**
+ * @brief Returns the total amount of requests.
+ *
+ * @return size_t
+ */
+ static size_t getRequestCount();
+
+ /**
+ * @brief Returns the size of transferred data (in bytes).
+ *
+ * @return size_t
+ */
+ static size_t getTransferredSize();
+};
+
+} // namespace mbgl