nlib
|
The stream class for reading compressed data using zlib
.
More...
#include "nn/nlib/ZlibInputStream.h"
Public Member Functions | |
Constructor, Destructor, and Initialization | |
constexpr | ZlibInputStream () 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 ZlibInputStreamSettings &settings) noexcept |
Initializes by specifying the behavior option. Returns 0 if successful. More... | |
![]() | |
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... | |
![]() | |
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... | |
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... | |
template<size_t N> | |
size_t | Read (nlib_byte_t(&buf)[N]) noexcept |
A template overload of the above function. | |
bool | Close () noexcept |
Closes the stream. Returns true if successful. More... | |
bool | Mark (size_t readlimit) noexcept |
This function provides settings that allow you to return to the current load position using GoBackToMark() . More... | |
bool | GoBackToMark () noexcept |
This function allows you to return to the load position that the last Mark() has been executed at. More... | |
bool | IsMarkSupported () const noexcept |
This function returns true if this stream supports Mark() and GoBackToMark() . | |
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 | InputStream () noexcept |
Instantiates the object with default parameters (default constructor). This function is called from the derived class. | |
virtual | ~InputStream () noexcept |
Destructor. This function is called from the derived class. | |
Additional Inherited Members | |
![]() | |
void | SetBuffer (void *p, size_t nbytes, bool is_mark_supported, bool is_buf_readonly) 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
. inflateInit2
function of zlib
are converted as follows. ENOMEM
. EINVAL
. ENOTSUP
. Definition at line 53 of file ZlibInputStream.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. |
© Nintendo Co., Ltd. All rights reserved.