nlib
nn::nlib::ConsoleOutputStream Class Referencefinal

The class for creating a stream to output to the console as a text string using nlib_printf. More...

#include "nn/nlib/ConsoleOutputStream.h"

+ Inheritance diagram for nn::nlib::ConsoleOutputStream:

Public Member Functions

 ConsoleOutputStream () noexcept
 Instantiates the object with default parameters (default constructor).
 
- Public Member Functions inherited from nn::nlib::OutputStream
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

- Public Types inherited from nn::nlib::OutputStream
enum  BufferingMode {
  BUFFERINGMODE_BLOCKBUFFERED = 0,
  BUFFERINGMODE_LINEBUFFERED,
  BUFFERINGMODE_UNBUFFERED
}
 The buffering mode for OutputStream. More...
 
- Protected Member Functions inherited from nn::nlib::OutputStream
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...
 
- Protected Attributes inherited from nn::nlib::OutputStream
BufferingMode m_BufferingMode
 Stores the buffering mode. More...
 

Detailed Description

The class for creating a stream to output to the console as a text string using nlib_printf.

Description
Normally you use this function to output to the console the strings written using the TextWriter class.
TextWriter writer;
if (nlib_is_error(writer.Init(&ostr))) { Error; }
writer.Write("The_string_you_want_to_display_on_the_console");
...
if (nlib_is_error(writer)) { Error; }
writer.Close();
Examples:
exi/serializer/serializer.cpp, exi/simple1/simple1.cpp, exi/simple2/simple2.cpp, and exi/textparser/textparser.cpp.

Definition at line 10 of file ConsoleOutputStream.h.


The documentation for this class was generated from the following files: