CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | List of all members
CppCommon::Writer Class Referenceabstract

Writer interface. More...

#include <writer.h>

Inheritance diagram for CppCommon::Writer:
CppCommon::File CppCommon::Pipe CppCommon::StdError CppCommon::StdOutput

Public Member Functions

 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
 
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...
 
virtual void Flush ()
 Flush the writer. More...
 

Detailed Description

Writer interface.

Writer interface is based on a write byte buffer method and provides functionality to write bytes buffer, text or text lines.

Definition at line 22 of file writer.h.

Constructor & Destructor Documentation

◆ Writer() [1/3]

CppCommon::Writer::Writer ( )
defaultnoexcept

◆ Writer() [2/3]

CppCommon::Writer::Writer ( const Writer )
defaultnoexcept

◆ Writer() [3/3]

CppCommon::Writer::Writer ( Writer &&  )
defaultnoexcept

◆ ~Writer()

virtual CppCommon::Writer::~Writer ( )
virtualdefaultnoexcept

Member Function Documentation

◆ Flush()

virtual void CppCommon::Writer::Flush ( )
inlinevirtual

Flush the writer.

Reimplemented in CppCommon::StdError, CppCommon::StdOutput, and CppCommon::File.

Definition at line 55 of file writer.h.

◆ operator=() [1/2]

Writer& CppCommon::Writer::operator= ( const Writer )
defaultnoexcept

◆ operator=() [2/2]

Writer& CppCommon::Writer::operator= ( Writer &&  )
defaultnoexcept

◆ 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 15 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 20 of file writer.cpp.

◆ Write() [3/3]

virtual size_t CppCommon::Writer::Write ( const void *  buffer,
size_t  size 
)
pure virtual

Write a byte buffer base method.

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

Implemented in CppCommon::StdError, CppCommon::StdOutput, CppCommon::Pipe, and CppCommon::File.


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