nlib
|
The class for creating an output stream that makes use of memory. More...
#include "nn/nlib/MemoryOutputStream.h"
Public Member Functions | |
const void * | data () const noexcept |
Gets a pointer to the start of the output data. More... | |
errno_t | Init (void *buf, size_t n) noexcept |
Initializes MemoryOuputStream and makes it available for use. More... | |
template<class T , size_t N> | |
errno_t | Init (T(&buf)[N]) noexcept |
Initializes MemoryOuputStream and makes it available for use. More... | |
Basic Member Functions | |
MemoryOutputStream () noexcept | |
Instantiates the object with default parameters (default constructor). You must call the Init function before using this function. | |
MemoryOutputStream (void *buf, size_t n) noexcept | |
Constructs and initializes MemoryOutputStream . More... | |
template<class T , size_t N> | |
MemoryOutputStream (T(&buf)[N]) noexcept | |
Constructs and initializes MemoryOutputStream . More... | |
virtual | ~MemoryOutputStream () noexcept override |
Destructor. | |
![]() | |
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 no internal error has occurred. | |
constexpr | OutputStream () noexcept |
Instantiates the object with default parameters (default constructor). | |
virtual | ~OutputStream () noexcept |
Destructor. Does not do anything. | |
Additional Inherited Members | |
![]() | |
enum | BufferingMode { BUFFERINGMODE_BLOCKBUFFERED = 0, BUFFERINGMODE_LINEBUFFERED, BUFFERINGMODE_UNBUFFERED } |
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 for creating an output stream that makes use of memory.
MemoryOutputStream
. Definition at line 10 of file MemoryOutputStream.h.
|
noexcept |
Constructs and initializes MemoryOutputStream
.
[out] | buf | A pointer to a memory region. |
[in] | n | The size of the memory region. |
|
inlineexplicitnoexcept |
Constructs and initializes MemoryOutputStream
.
[out] | buf | The array to use as the output buffer. |
Definition at line 15 of file MemoryOutputStream.h.
|
inlinenoexcept |
Gets a pointer to the start of the output data.
Definition at line 20 of file MemoryOutputStream.h.
|
noexcept |
Initializes MemoryOuputStream
and makes it available for use.
[out] | buf | A pointer to a memory region. |
[in] | n | The size of the memory region. |
0
on success.
|
inlinenoexcept |
Initializes MemoryOuputStream
and makes it available for use.
[out] | buf | The array that is the backing store. |
0
on success. Definition at line 23 of file MemoryOutputStream.h.
© 2012-2016 Nintendo Co., Ltd. All rights reserved.