CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | Friends | List of all members
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. More...
 
void * stream () const noexcept
 Get the native stream handler. More...
 
bool IsValid () const noexcept
 Is stream valid? More...
 
size_t Write (const void *buffer, size_t size) override
 Write a byte buffer into the stream. More...
 
void Flush () override
 Flush the stream. More...
 
void swap (StdOutput &stream) noexcept
 Swap two instances. More...
 
virtual size_t Write (const void *buffer, size_t size)=0
 Write a byte buffer base method. More...
 
size_t Write (const std::string &text)
 Write a text string. More...
 
size_t Write (const std::vector< std::string > &lines)
 Write text lines. More...
 
- 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. More...
 
size_t Write (const std::vector< std::string > &lines)
 Write text lines. More...
 

Friends

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

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/4]

size_t CppCommon::Writer::Write

Write a text string.

Parameters
text- Text string
Returns
Count of written characters

Definition at line 46 of file writer.cpp.

◆ Write() [2/4]

size_t CppCommon::Writer::Write

Write text lines.

Parameters
lines- Text lines
Returns
Count of written lines

Definition at line 52 of file writer.cpp.

◆ Write() [3/4]

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.

◆ Write() [4/4]

virtual size_t CppCommon::Writer::Write

Write a byte buffer base method.

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

Friends And Related Function Documentation

◆ 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: