t8-mod/source/shared-code/utilities/compression.hpp
2023-11-10 13:52:20 -08:00

31 lines
577 B
C++

#pragma once
#include <string>
#include <unordered_map>
#define CHUNK 16384u
namespace utilities::compression
{
namespace zlib
{
std::string compress(const std::string& data);
std::string decompress(const std::string& data);
}
namespace zip
{
class archive
{
public:
void add(std::string filename, std::string data);
bool write(const std::string& filename, const std::string& comment = {});
private:
std::unordered_map<std::string, std::string> files_;
};
std::unordered_map<std::string, std::string> extract(const std::string& data);
}
};