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

31 lines
577 B
C++
Raw Normal View History

2023-03-06 15:40:07 -05:00
#pragma once
#include <string>
#include <unordered_map>
#define CHUNK 16384u
2023-11-10 16:52:20 -05:00
namespace utilities::compression
2023-03-06 15:40:07 -05:00
{
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);
}
};