16 #ifndef INCLUDE_NN_NLIB_ZLIBOUTPUTSTREAM_H_ 17 #define INCLUDE_NN_NLIB_ZLIBOUTPUTSTREAM_H_ 29 typedef void* (*ReallocFunc)(
void* p,
size_t n) NLIB_NOEXCEPT_FUNCPTR;
39 buffer_size(64 * 1024),
45 buffer_size(buffer_size_),
52 buffer_size(buffer_size_),
54 realloc_func(realloc_func_) {}
63 return this->Init(settings);
68 struct ZlibOutputStreamPrivate;
69 ZlibOutputStreamPrivate* prv_;
76 #endif // INCLUDE_NN_NLIB_ZLIBOUTPUTSTREAM_H_ #define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
errno_t Init() noexcept
Initializes using the default settings.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
ZlibOutputStream() noexcept
Instantiates the object with default parameters (default constructor).
void * buf_out
The buffer set for z_stream::next_out.
void * buf_in
The buffer set for z_stream::next_in.
size_t buffer_size
The size of ZlibOutputStreamSettings::buf_in and ZlibOutputStreamSettings::buf_out.
ReallocFunc realloc_func
The realloc function or its equivalent that ZlibOutputStream uses internally.
The base class for classes that act internally like OutputStream to convert data. ...
constexpr ZlibOutputStreamSettings() noexcept
Instantiates the object with default parameters (default constructor). Sets the default values...
constexpr ZlibOutputStreamSettings(void *buf_in_, void *buf_out_, size_t buffer_size_, int level_) noexcept
Sets the individual data members.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
The structure that stores the various ZlibOutputStream settings. At construction time, the default settings are stored.
The class that uses zlib to decompress data and write the data to a stream.
int level
The compression setting to pass to the deflateInit2 function of zlib.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
constexpr ZlibOutputStreamSettings(void *buf_in_, void *buf_out_, size_t buffer_size_, int level_, ReallocFunc realloc_func_) noexcept
Sets the individual data members.