nlib
|
The class for writing text to streams. More...
#include "nn/nlib/TextWriter.h"
Public Member Functions | |
bool | Init (OutputStream *stream) noexcept |
Initializes a text writer for the specified stream. More... | |
bool | Write (wchar_t c) noexcept |
Writes one character to a stream. More... | |
bool | Write (const wchar_t *str) noexcept |
Writes a text string to a stream. More... | |
bool | Write (char c) noexcept |
Writes one character to a stream. More... | |
bool | Write (const char *str) noexcept |
Writes a text string to a stream. More... | |
bool | Write (nlib_utf16_t c) noexcept |
Writes one character to a stream. More... | |
bool | Write (const nlib_utf16_t *str) noexcept |
Writes a text string to a stream. More... | |
bool | Write (nlib_utf32_t c) noexcept |
Writes one character to a stream. More... | |
bool | Write (const nlib_utf32_t *str) noexcept |
Writes a text string to a stream. More... | |
bool | Flush () noexcept |
Flushes the text writer and the base stream. More... | |
bool | Close () noexcept |
Closes the text writer. More... | |
errno_t | GetErrorValue () const noexcept |
This function can get the cause of the error when writing has failed. More... | |
OutputStream * | GetStream () noexcept |
Gets the stream for the text writer to write to. More... | |
bool | WriteFormat (const wchar_t *fmt,...) noexcept |
Writes a formatted text string to a stream. More... | |
bool | WriteFormat (const char *fmt,...) noexcept |
Writes a formatted text string to a stream. More... | |
void | SetError (errno_t e) const noexcept |
Sets an error value. More... | |
operator bool () const | |
Returns true if no internal error has occurred. | |
Basic Member Functions | |
TextWriter () noexcept | |
Instantiates the object with default parameters (default constructor). | |
~TextWriter () noexcept | |
Destructor. The stream is not closed. | |
TextWriter & | assign (TextWriter &rhs, move_tag) |
Assigns the object by using swap for a move. | |
TextWriter (TextWriter &rhs, move_tag) | |
Instantiates the object by using swap for a move. | |
TextWriter (TextWriter &&rhs) | |
Instantiates the object (move constructor). This function is useful when using C++11. | |
TextWriter & | operator= (TextWriter &&rhs) |
Move assignment operator. This function is useful when using C++11. | |
void | swap (TextWriter &rhs) noexcept |
Swaps the contents of an object. | |
The class for writing text to streams.
EILSEQ
error is generated, Definition at line 20 of file TextWriter.h.
|
noexcept |
Closes the text writer.
true
when successful.
|
noexcept |
Flushes the text writer and the base stream.
true
when successful.
|
inlinenoexcept |
This function can get the cause of the error when writing has failed.
0 | No error occurred. |
EINVAL | Invalid argument. |
EEXIST | Initialized redundantly. |
EBADF | No stream to write to. |
EIO | Writing to the stream has failed for some reason. |
EILSEQ | Tried to write an invalid character. |
ENOMEM | Failed to dynamically allocate memory. |
Definition at line 36 of file TextWriter.h.
|
inlinenoexcept |
Gets the stream for the text writer to write to.
Definition at line 37 of file TextWriter.h.
|
noexcept |
Initializes a text writer for the specified stream.
[in] | stream | A stream. |
true
when successful.false
if it is already initialized or if stream is NULL
.
|
inlinenoexcept |
Sets an error value.
[in] | e | An error value. |
Definition at line 40 of file TextWriter.h.
|
noexcept |
Writes one character to a stream.
[in] | c | A wide character (UTF-16 or UTF-32). |
true
when successful.
|
noexcept |
Writes a text string to a stream.
[in] | str | A wide text string. |
true
when successful.
|
noexcept |
Writes one character to a stream.
[in] | c | An ASCII character. |
true
when successful.EILSEQ
).
|
noexcept |
Writes a text string to a stream.
[in] | str | A UTF-8 text string. |
true
when successful.
|
noexcept |
Writes one character to a stream.
[in] | c | A UTF-16 character. |
true
when successful.
|
noexcept |
Writes a text string to a stream.
[in] | str | UTF-16 string. |
true
when successful.
|
noexcept |
Writes one character to a stream.
[in] | c | A UTF-32 character. |
true
when successful.
|
noexcept |
Writes a text string to a stream.
[in] | str | UTF-32 string. |
true
when successful.
|
noexcept |
Writes a formatted text string to a stream.
[in] | fmt | A formatted text string. |
true
if it succeeds, and false
if it fails.false
, you can use the GetErrorValue
member function to get the cause of the error.
|
noexcept |
Writes a formatted text string to a stream.
[in] | fmt | A formatted text string. |
true
if it succeeds, and false
if it fails.false
, you can use the GetErrorValue
member function to get the cause of the error. © 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.