Zcalanie ręczne. Jak git nie chce po dobroci to będzie siłą
This commit is contained in:
parent
690e5278c5
commit
3bf98ba472
22 changed files with 790 additions and 457 deletions
29
CompressionManager.h
Normal file
29
CompressionManager.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#define ZSTD_STATIC_LINKING_ONLY
|
||||
#include <zstd.h>
|
||||
|
||||
#if ZSTD_VERSION_NUMBER < 10400
|
||||
#error "Wymagane zstd >= 1.4.0 dla ZSTD_c_format / ZSTD_f_zstd1_magicless"
|
||||
#endif
|
||||
|
||||
#define COMPRESSION_LEVEL 3
|
||||
|
||||
class CompressionManager
|
||||
{
|
||||
public:
|
||||
CompressionManager();
|
||||
~CompressionManager();
|
||||
|
||||
std::vector<char> compress(const std::vector<char>&);
|
||||
std::vector<char> decompress(const std::vector<char>&, const size_t&);
|
||||
|
||||
private:
|
||||
ZSTD_CCtx* cctx;
|
||||
ZSTD_DCtx* dctx;
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue