nlib
|
The class for file input streams. More...
#include "nn/nlib/FileInputStream.h"
Public Member Functions | |
errno_t | Init () noexcept |
Initializes the stream with the default settings. More... | |
NLIB_CHECK_RESULT errno_t | Init (const FileInputStreamSettings &settings) noexcept |
Initializes a stream. More... | |
NLIB_CHECK_RESULT errno_t | Open (const char *filename) noexcept |
Opens the file in read-only mode. More... | |
NLIB_CHECK_RESULT errno_t | Open (const wchar_t *filename) noexcept |
Opens the file in read-only mode. More... | |
NLIB_CHECK_RESULT errno_t | FdOpen (nlib_fd fd) noexcept |
Makes an already-open file available for use by FileInputStream . More... | |
nlib_fd | GetFd () const noexcept |
Returns the file descriptor. More... | |
Basic Member Functions | |
FileInputStream () noexcept | |
Instantiates the object with default parameters (default constructor). The buffer must be set and initialized by the Init function ahead of time. | |
virtual | ~FileInputStream () noexcept override |
Destructor. Closes the file if it is open. | |
![]() | |
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 class for file input streams.
Definition at line 21 of file FileInputStream.h.
|
noexcept |
Makes an already-open file available for use by FileInputStream
.
[in] | fd | An already-open nlib_fd -type value. |
0
on success. Any other value indicates an error.Init
function was not called ahead of time, it is called internally here.
|
inlinenoexcept |
Returns the file descriptor.
Definition at line 36 of file FileInputStream.h.
|
inlinenoexcept |
Initializes the stream with the default settings.
0
on success. Any other value indicates an error.FileInputStream
object is allocated from the heap in the default size. Definition at line 28 of file FileInputStream.h.
|
noexcept |
Initializes a stream.
[in] | settings | The default options. |
0
on success. Any other value indicates an error.
|
noexcept |
Opens the file in read-only mode.
[in] | filename | The path to the file. |
0
on success. Any other value indicates an error.Init
function was not called ahead of time, it is called internally here.
|
noexcept |
Opens the file in read-only mode.
[in] | filename | The path to the file. |
0
on success. Any other value indicates an error.Init
function was not called ahead of time, it is called internally here. © 2012-2016 Nintendo Co., Ltd. All rights reserved.