userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
zstd.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/compression/zstd.hpp
4
/// @brief @copybrief compression::zstd::Decompress
5
/// @ingroup userver_universal
6
7
#
include
<
string_view
>
8
9
#
include
<
userver
/
compression
/
error
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
/// @brief Zstandard (de)compression helpers.
14
namespace
compression
::
zstd
{
15
16
extern
const
int
kDefaultCompressionLevel;
17
18
/// @brief Decompresses all Zstandard frames in the input, ignoring skippable frames.
19
/// @throws std::runtime_error if the input is invalid or truncated.
20
/// @throws compression::TooBigError if the combined output exceeds `max_size`.
21
std::string
Decompress
(std::string_view compressed, size_t max_size);
22
23
/// @brief Compresses the string using the specified compression level.
24
std::string
Compress
(std::string_view data,
int
compression_level = kDefaultCompressionLevel);
25
26
}
// namespace compression::zstd
27
28
USERVER_NAMESPACE_END
userver
compression
zstd.hpp
Generated on
for userver by
Doxygen
1.17.0