CppCommon 1.0.6.0
C++ Common Library
Loading...
Searching...
No Matches
CppCommon::StdOutput Class Reference

Standard output stream. More...

#include <stream.h>

Inheritance diagram for CppCommon::StdOutput:
CppCommon::Writer

Public Member Functions

 StdOutput ()
 StdOutput (const StdOutput &)=delete
 StdOutput (StdOutput &&stream)=delete
virtual ~StdOutput ()
StdOutputoperator= (const StdOutput &)=delete
StdOutputoperator= (StdOutput &&stream)=delete
 operator bool () const noexcept
 Check if the stream is valid.
void * stream () const noexcept
 Get the native stream handler.
bool IsValid () const noexcept
 Is stream valid?
size_t Write (const void *buffer, size_t size) override
 Write a byte buffer into the stream.
void Flush () override
 Flush the stream.
void swap (StdOutput &stream) noexcept
 Swap two instances.
size_t Write (const std::string &text)
 Write a text string.
size_t Write (const std::vector< std::string > &lines)
 Write text lines.
Public Member Functions inherited from CppCommon::Writer
 Writer () noexcept=default
 Writer (const Writer &) noexcept=default
 Writer (Writer &&) noexcept=default
virtual ~Writer () noexcept=default
Writeroperator= (const Writer &) noexcept=default
Writeroperator= (Writer &&) noexcept=default
size_t Write (const std::string &text)
 Write a text string.
size_t Write (const std::vector< std::string > &lines)
 Write text lines.

Friends

void swap (StdOutput &stream1, StdOutput &stream2)

Detailed Description

Standard output stream.

Thread-safe.

Definition at line 75 of file stream.h.

Constructor & Destructor Documentation

◆ StdOutput() [1/3]

CppCommon::StdOutput::StdOutput ( )

Definition at line 262 of file stream.cpp.

◆ StdOutput() [2/3]

CppCommon::StdOutput::StdOutput ( const StdOutput & )
delete

◆ StdOutput() [3/3]

CppCommon::StdOutput::StdOutput ( StdOutput && stream)
delete

◆ ~StdOutput()

CppCommon::StdOutput::~StdOutput ( )
virtual

Definition at line 273 of file stream.cpp.

Member Function Documentation

◆ Flush()

void CppCommon::StdOutput::Flush ( )
overridevirtual

Flush the stream.

Reimplemented from CppCommon::Writer.

Definition at line 282 of file stream.cpp.

◆ IsValid()

bool CppCommon::StdOutput::IsValid ( ) const
noexcept

Is stream valid?

Definition at line 280 of file stream.cpp.

◆ operator bool()

CppCommon::StdOutput::operator bool ( ) const
inlineexplicitnoexcept

Check if the stream is valid.

Definition at line 87 of file stream.h.

◆ operator=() [1/2]

StdOutput & CppCommon::StdOutput::operator= ( const StdOutput & )
delete

◆ operator=() [2/2]

StdOutput & CppCommon::StdOutput::operator= ( StdOutput && stream)
delete

◆ stream()

void * CppCommon::StdOutput::stream ( ) const
noexcept

Get the native stream handler.

Definition at line 279 of file stream.cpp.

◆ swap()

void CppCommon::StdOutput::swap ( StdOutput & stream)
noexcept

Swap two instances.

Definition at line 284 of file stream.cpp.

◆ Write() [1/3]

size_t CppCommon::Writer::Write ( const std::string & text)

Write a text string.

Parameters
text- Text string
Returns
Count of written characters

Definition at line 46 of file writer.cpp.

◆ Write() [2/3]

size_t CppCommon::Writer::Write ( const std::vector< std::string > & lines)

Write text lines.

Parameters
lines- Text lines
Returns
Count of written lines

Definition at line 52 of file writer.cpp.

◆ Write() [3/3]

size_t CppCommon::StdOutput::Write ( const void * buffer,
size_t size )
overridevirtual

Write a byte buffer into the stream.

Parameters
buffer- Buffer to write
size- Buffer size
Returns
Count of written bytes

Implements CppCommon::Writer.

Definition at line 281 of file stream.cpp.

◆ swap

void swap ( StdOutput & stream1,
StdOutput & stream2 )
friend

Definition at line 16 of file stream.inl.


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