BuildCache
compressor.hpp
1 //--------------------------------------------------------------------------------------------------
2 // Copyright (c) 2018 Marcus Geelnard
3 //
4 // This software is provided 'as-is', without any express or implied warranty. In no event will the
5 // authors be held liable for any damages arising from the use of this software.
6 //
7 // Permission is granted to anyone to use this software for any purpose, including commercial
8 // applications, and to alter it and redistribute it freely, subject to the following restrictions:
9 //
10 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote
11 // the original software. If you use this software in a product, an acknowledgment in the
12 // product documentation would be appreciated but is not required.
13 //
14 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as
15 // being the original software.
16 //
17 // 3. This notice may not be removed or altered from any source distribution.
18 //--------------------------------------------------------------------------------------------------
19 
20 #ifndef BUILDCACHE_COMPRESSOR_HPP_
21 #define BUILDCACHE_COMPRESSOR_HPP_
22 
23 #include <string>
24 
25 namespace bcache {
26 namespace comp {
30 std::string compress(const std::string& str);
31 
35 std::string decompress(const std::string& str);
36 
41 void compress_file(const std::string& from_path, const std::string& to_path);
42 
47 void decompress_file(const std::string& from_path, const std::string& to_path);
48 } // namespace comp
49 } // namespace bcache
50 
51 #endif // BUILDCACHE_COMPRESSOR_HPP_
bcache::comp::decompress
std::string decompress(const std::string &compressed_str)
Decompress a string in memory.
Definition: compressor.cpp:153
bcache
The top level namespace.
Definition: compressor.cpp:34
bcache::comp::compress_file
void compress_file(const std::string &from_path, const std::string &to_path)
Compress a file.
Definition: compressor.cpp:209
bcache::comp::decompress_file
void decompress_file(const std::string &from_path, const std::string &to_path)
Decompress a file.
Definition: compressor.cpp:224
bcache::comp::compress
std::string compress(const std::string &str)
Compress a string in memory.
Definition: compressor.cpp:133