2023-05-26 16:09:29 +02: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:
|
2023-05-26 19:19:43 +02:00
|
|
|
void add(const std::string& filename, const std::string& data);
|
2023-05-26 16:09:29 +02:00
|
|
|
bool write(const std::string& filename, const std::string& comment = {});
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unordered_map<std::string, std::string> files_;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|