nlib
|
The stream class for reading compressed data using zlib
.
More...
#include "nn/nlib/ZlibInputStream.h"
Public Member Functions | |
errno_t | Init () noexcept |
Initializes using the default settings. More... | |
errno_t | Init (const ZlibInputStreamSettings &settings) noexcept |
Configures the buffer and the other settings to use for streaming according to the values specified in the settings parameter. More... | |
Basic Member Functions | |
ZlibInputStream () noexcept | |
Instantiates the object with default parameters (default constructor). | |
![]() | |
errno_t | SetStream (InputStream *istr) noexcept |
Sets the input stream for reading the pre-converted data. More... | |
InputStream * | GetStream () const noexcept |
Gets the input stream for reading the pre-converted data. More... | |
![]() | |
bool | IsOk () const noexcept |
Checks that no error has occurred. More... | |
errno_t | GetErrorValue () const noexcept |
Gets the error value. 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 value. More... | |
bool | IsEos () noexcept |
Returns true if the stream is finished being read through to the end. If the stream has not been read through to the end, or if an error occurs, the function returns false . More... | |
int | Read () noexcept |
Reads one byte of data from the stream. More... | |
NLIB_CHECK_RESULT int | Peek () noexcept |
Reads the next byte without consuming the stream. More... | |
size_t | Skip (size_t nBytes) noexcept |
Skips over the number of bytes specified by nBytes. More... | |
size_t | Read (void *ptr, size_t nBytes) noexcept |
Reads the number of bytes of data specified by nBytes into the memory region specified by ptr. More... | |
bool | Close () noexcept |
Closes the stream. Returns true if successful. More... | |
operator bool () const | |
Returns true if no internal error has occurred. | |
constexpr | InputStream () noexcept |
Instantiates the object. This function is called from the derived class. | |
virtual | ~InputStream () noexcept |
Destructor. This function is called from the derived class. | |
Additional Inherited Members | |
![]() | |
void | ResetBuffer (void *p, size_t nBytes) noexcept |
Sets the buffer held by InputStream . More... | |
void | SetError (errno_t e) const noexcept |
Sets an error to InputStream . More... | |
The stream class for reading compressed data using zlib
.
zlib
. Even large amounts of data can be streamed and read. Init
function to configure the buffer and the like, using the SetStream
function to associate the base stream, and then reading the data in the same way as InputStream
. SetStream
was called. The base stream itself is not closed. zlib
errors. Z_DATA_ERROR
-> EILSEQ
. Z_NEED_DICT
-> EILSEQ
. Z_STREAM_ERROR
-> EIO
. Z_MEM_ERROR
-> ENOMEM
. Z_BUF_ERROR
-> ENOBUFS
. EOF
. EIO
. SetStream
function. inflateInit2
to initialize for the extraction of data. The windowBits parameter of inflateInit2
is currently set to 47
. zalloc, zfree, and opaque for z_stream are all set to Z_NULL
. EEXIST
. NULL
, the function returns EINVAL
. inflateInit2
function of zlib
are converted as follows. ENOMEM
. EINVAL
. ENOTSUP
. Definition at line 71 of file ZlibInputStream.h.
|
inlinenoexcept |
Initializes using the default settings.
0
indicates an error.Definition at line 76 of file ZlibInputStream.h.
|
inlinenoexcept |
Configures the buffer and the other settings to use for streaming according to the values specified in the settings parameter.
[in] | settings | The settings data for the buffer and other settings. |
0 | No error occurred. |
EEXIST | The Init function is already running. |
EINVAL | The buffer size is smaller than 1024, or only one of the buffers specified in the settings parameter is NULL . |
ENOMEM | Dynamic allocation of a buffer has failed. |
Definition at line 80 of file ZlibInputStream.h.
© 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.