#pragma once #include #include namespace mbgl { class Blob { public: Blob(); Blob(std::shared_ptr bytes, bool gzip); Blob(std::string&& bytes, bool compressed); // Return uncompressed/compressed data. std::shared_ptr uncompressedData() const; std::shared_ptr compressedData() const; // Transform the blob to being uncompressed. void uncompress(); bool isCompressed() const { return compressed; } explicit operator bool() const { return (bool)bytes; } private: std::shared_ptr bytes; bool compressed; }; } // namespace mbgl