CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | Friends | List of all members
CppCommon::StdError Class Reference

Standard error stream. More...

#include <stream.h>

Inheritance diagram for CppCommon::StdError:
CppCommon::Writer

Public Member Functions

 StdError ()
 
 StdError (const StdError &)=delete
 
 StdError (StdError &&stream)=delete
 
virtual ~StdError ()
 
StdErroroperator= (const StdError &)=delete
 
StdErroroperator= (StdError &&stream)=delete
 
 operator bool () const
 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 (StdError &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 (StdError &stream1, StdError &stream2) noexcept
 

Detailed Description

Standard error stream.

Thread-safe.

Definition at line 127 of file stream.h.

Constructor & Destructor Documentation

◆ StdError() [1/3]

CppCommon::StdError::StdError ( )

Definition at line 290 of file stream.cpp.

◆ StdError() [2/3]

CppCommon::StdError::StdError ( const StdError )
delete

◆ StdError() [3/3]

CppCommon::StdError::StdError ( StdError &&  stream)
delete

◆ ~StdError()

CppCommon::StdError::~StdError ( )
virtual

Definition at line 301 of file stream.cpp.

Member Function Documentation

◆ Flush()

void CppCommon::StdError::Flush ( )
overridevirtual

Flush the stream.

Reimplemented from CppCommon::Writer.

Definition at line 310 of file stream.cpp.

◆ IsValid()

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

Is stream valid?

Definition at line 308 of file stream.cpp.

◆ operator bool()

CppCommon::StdError::operator bool ( ) const
inlineexplicit

Check if the stream is valid.

Definition at line 139 of file stream.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ stream()

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

Get the native stream handler.

Definition at line 307 of file stream.cpp.

◆ swap()

void CppCommon::StdError::swap ( StdError stream)
noexcept

Swap two instances.

Definition at line 312 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::StdError::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 309 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 ( StdError stream1,
StdError stream2 
)
friend

Definition at line 21 of file stream.inl.


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