This is a lightweight wrap for Google's Brotli compression library, in C++ style.
It is very simple. Just see the example.
# include <brotli-cpp.hpp>
# include <iostream>
int main()
{
std::string origin = "hello world!";
std::string compressed = brotli::compress(origin);
std::string decompressed = brotli::decompress(compressed);
std::cout << std::boolalpha << (origin == decompressed);
return 0;
}
When compile, do not forget to add -lbrotlienc -lbrotlidec
.