t8-mod/source/shared-code/utils/compression.hpp

31 lines
573 B
C++
Raw Normal View History

2023-03-06 15:40:07 -05:00
#pragma once
#include <string>
#include <unordered_map>
#define CHUNK 16384u
namespace utils::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);
}
};