nlib
|
The class that uses zlib
to decompress data and write the data to a stream.
More...
#include "nn/nlib/ZlibOutputStream.h"
Public Member Functions | |
Constructor, Destructor, and Initialization | |
constexpr | ZlibOutputStream () noexcept |
Instantiates the object with default parameters (default constructor). | |
errno_t | Init () noexcept |
A parameter omitted version of the above function which passes settings as the default value. | |
errno_t | Init (const ZlibOutputStreamSettings &settings) noexcept |
Initializes by specifying the behavior option. Returns 0 if successful. More... | |
![]() | |
errno_t | SetStream (OutputStream *ostr) noexcept |
Sets an output stream as the base stream. More... | |
OutputStream * | GetStream () const noexcept |
Gets the input stream that will be the base stream. More... | |
![]() | |
size_t | Pos () const noexcept |
Returns the current position in the stream. More... | |
uint64_t | Pos64 () const noexcept |
Returns the current position in the stream as a 64-bit integer. More... | |
bool | Write (int b) noexcept |
Writes one byte of data to the stream. More... | |
bool | Write (const void *p, size_t n) noexcept |
Writes n bytes of data to the stream. More... | |
bool | WriteGather (const nlib_fd_iovec *iov, int iovcnt) noexcept |
Writes data from multiple non-continuous buffers to a stream. More... | |
bool | Flush () noexcept |
Flushes the stream. More... | |
bool | Close () noexcept |
Closes the stream after it has been flushed. Returns true if successful. More... | |
errno_t | GetErrorValue () const noexcept |
Gets the error value. More... | |
BufferingMode | GetBufferingMode () const noexcept |
Gets the buffering mode. | |
operator bool () const | |
Returns true if the object has been initialized and an error has not occurred inside, or returns false if an error has occurred inside. | |
constexpr | OutputStream () noexcept |
Instantiates the object with default parameters (default constructor). | |
virtual | ~OutputStream () noexcept |
Destructor. | |
Additional Inherited Members | |
![]() | |
enum | BufferingMode { kBufferingModeBlockBuffered = 0, kBufferingModeLineBuffered, kBufferingModeUnbuffered } |
The buffering mode for OutputStream . More... | |
![]() | |
void | ResetBuffer (void *p, size_t nbytes) noexcept |
Sets the buffer held by OutputStream . More... | |
void | SetError (errno_t e) const noexcept |
Sets an error to OutputStream . More... | |
![]() | |
BufferingMode | m_BufferingMode |
Stores the buffering mode. More... | |
The class that uses zlib
to decompress data and write the data to a stream.
zlib
. Even large amounts of data can be streamed and written. Init
function to configure the buffer and the like, using the SetStream
function to associate the base stream, and then writing the data in the same way as OutputStream
. When you close this stream, the base stream is flushed and detached, reverting to the state before SetStream
was called. The base stream itself is not closed. zlib
errors. Z_STREAM_ERROR
-> EIO
. Z_MEM_ERROR
-> ENOMEM
. Z_BUF_ERROR
-> ENOBUFS
. EIO
. Definition at line 57 of file ZlibOutputStream.h.
|
noexcept |
Initializes by specifying the behavior option. Returns 0 if successful.
[in] | settings | Behavior options. |
0 | Success. |
EALREADY | Already initialized. |
ENOMEM | Indicates that internal memory allocation failed. |
EINVAL | Indicates that the specification of behavior options was invalid. |
deflateInit2
function is called inside the SetStream
function to initialize for data compression. 31
, memLevel is set to 8
, and strategy is set to Z_DEFAULT_STRATEGY
. zalloc, zfree, and opaque for z_stream are all set to Z_NULL
. EEXIST
. NULL
, the function returns EINVAL
. deflateInit2
function of zlib
are converted as follows. ENOMEM
. EINVAL
. ENOTSUP
. © Nintendo Co., Ltd. All rights reserved.