|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
流式压缩器 更多...
#include <zlib_compress.hpp>
Public 成员函数 | |
| stream_compressor (compress_level level=compress_level::default_level, compress_strategy strategy=compress_strategy::default_strategy, compress_format format=compress_format::zlib) | |
| 构造函数 | |
| ~stream_compressor () | |
| 析构函数 | |
| stream_compressor (stream_compressor &&other) noexcept | |
| 移动构造函数 | |
| stream_compressor & | operator= (stream_compressor &&other) noexcept |
| 移动赋值运算符 | |
| byte_vector | compress (const cbyte_view &data, bool finish=false) |
| 压缩数据 | |
| byte_vector | compress (string_view data, bool finish=false) |
| 压缩字符串视图 | |
| byte_vector | finish () |
| 完成压缩并返回剩余数据 | |
| void | reset (compress_level level=compress_level::default_level, compress_strategy strategy=compress_strategy::default_strategy, compress_format format=compress_format::zlib) |
| 重置压缩器状态 | |
| NEFORCE_NODISCARD size_t | bytes_input () const noexcept |
| 获取输入字节数 | |
| NEFORCE_NODISCARD size_t | bytes_output () const noexcept |
| 获取输出字节数 | |
| NEFORCE_NODISCARD double | compression_ratio () const noexcept |
| 获取压缩率 | |
|
explicit |
构造函数
| level | 压缩级别,默认为default_level |
| strategy | 压缩策略,默认为default_strategy |
| format | 压缩格式,默认为zlib |
| zlib_exception | 当重置失败时抛出 |
引用了 default_level, default_strategy, format() , 以及 zlib.
被这些函数引用 operator=(), stream_compressor() , 以及 ~stream_compressor().
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| byte_vector zlib_compressor::stream_compressor::compress | ( | const cbyte_view & | data, |
| bool | finish = false ) |
| byte_vector zlib_compressor::stream_compressor::compress | ( | string_view | data, |
| bool | finish = false ) |
|
inlinenoexcept |
| byte_vector zlib_compressor::stream_compressor::finish | ( | ) |
|
noexcept |
| void zlib_compressor::stream_compressor::reset | ( | compress_level | level = compress_level::default_level, |
| compress_strategy | strategy = compress_strategy::default_strategy, | ||
| compress_format | format = compress_format::zlib ) |
重置压缩器状态
| level | 新压缩级别,默认为default_level |
| strategy | 新压缩策略,默认为default_strategy |
| format | 新压缩格式,默认为zlib |
| zlib_exception | 当重置失败时抛出 |
引用了 default_level, default_strategy, format() , 以及 zlib.