bpf::io::ConsoleWriter class final

High-level console serializer

Base classes

class IDataOutputStream

Constructors, destructors, conversion operators

ConsoleWriter(EConsoleStream type = EConsoleStream::OUTPUT) explicit

Public functions

void Flush() final
auto Write(const void* buf, fsize bufsize) -> fsize final
void WriteLine(const String& str)
void Write(const String& str)
void NewLine()
auto operator<<(uint8 u) -> ConsoleWriter& final
auto operator<<(uint16 u) -> ConsoleWriter& final
auto operator<<(uint32 u) -> ConsoleWriter& final
auto operator<<(uint64 u) -> ConsoleWriter& final
auto operator<<(int8 i) -> ConsoleWriter& final
auto operator<<(int16 i) -> ConsoleWriter& final
auto operator<<(fint i) -> ConsoleWriter& final
auto operator<<(int64 i) -> ConsoleWriter& final
auto operator<<(float f) -> ConsoleWriter& final
auto operator<<(double d) -> ConsoleWriter& final
auto operator<<(bool b) -> ConsoleWriter& final
auto operator<<(const bpf::String& str) -> ConsoleWriter& final
auto operator<<(const char* str) -> ConsoleWriter& final
auto operator<<(const Console::TextStyle& style) -> ConsoleWriter&
auto operator<<(const Console::ClearTextStyle&) -> ConsoleWriter&

Function documentation

bpf::io::ConsoleWriter::ConsoleWriter(EConsoleStream type = EConsoleStream::OUTPUT) explicit

Parameters
type which stream to write to (ERROR/OUTPUT)

Constructs a ConsoleWrite

void bpf::io::ConsoleWriter::Flush() final

Write all the content currently stored in buffer to the underlying stream Only usefull for buffered serializers

fsize bpf::io::ConsoleWriter::Write(const void* buf, fsize bufsize) final

Parameters
buf buffer to write to console
bufsize the size in bytes of the buffer
Returns number of bytes written, 0 if no bytes could be written

This function performs a low level write to console On Windows it expects bufsize to be a multiple of 2 and expects buf to contain UTF-16 code points On Linux it expects buf to contain UTF-8 bytes (last UTF-8 code can be cut)

void bpf::io::ConsoleWriter::WriteLine(const String& str)

Parameters
str text to write

Writes a line of text

void bpf::io::ConsoleWriter::Write(const String& str)

Parameters
str string to write

Writes a string (without appending newline character)

void bpf::io::ConsoleWriter::NewLine()

Writes a platform dependent newline character

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(uint8 u) final

Parameters
u uint8 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(uint16 u) final

Parameters
u uint16 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(uint32 u) final

Parameters
u uint32 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(uint64 u) final

Parameters
u uint64 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(int8 i) final

Parameters
i int8 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(int16 i) final

Parameters
i int16 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(fint i) final

Parameters
i int32 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(int64 i) final

Parameters
i int64 to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(float f) final

Parameters
f float to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(double d) final

Parameters
d double to serialize
Returns IDataOutputStream&

Serialize a number

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(bool b) final

Parameters
b value to serialize
Returns IDataOutputStream&

Serialize a boolean

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(const bpf::String& str) final

Parameters
str high-level string to serialize
Returns IDataOutputStream&

Serialize a string

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(const char* str) final

Parameters
str low-level null terminated c-like string to serialize
Returns IDataOutputStream&

Serialize a string

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(const Console::TextStyle& style)

Parameters
style the new text style
Returns ConsoleWriter&

Sets the text style for the subsequent write operations

ConsoleWriter& bpf::io::ConsoleWriter::operator<<(const Console::ClearTextStyle&)

Returns ConsoleWriter&

Resets all previous text styles