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

Reader interface. More...

#include <reader.h>

Inheritance diagram for CppCommon::Reader:
CppCommon::File CppCommon::Pipe CppCommon::StdInput

Public Member Functions

 Reader () noexcept=default
 
 Reader (const Reader &) noexcept=default
 
 Reader (Reader &&) noexcept=default
 
virtual ~Reader () noexcept=default
 
Readeroperator= (const Reader &) noexcept=default
 
Readeroperator= (Reader &&) noexcept=default
 
virtual size_t Read (void *buffer, size_t size)=0
 Read a bytes buffer base method. More...
 
std::vector< uint8_t > ReadAllBytes ()
 Read all bytes. More...
 
std::string ReadAllText ()
 Read all text. More...
 
std::vector< std::string > ReadAllLines ()
 Read all text lines. More...
 

Detailed Description

Reader interface.

Reader interface is based on a read byte buffer method and provides functionality to read all bytes, text or text lines.

Definition at line 23 of file reader.h.

Constructor & Destructor Documentation

◆ Reader() [1/3]

CppCommon::Reader::Reader ( )
defaultnoexcept

◆ Reader() [2/3]

CppCommon::Reader::Reader ( const Reader )
defaultnoexcept

◆ Reader() [3/3]

CppCommon::Reader::Reader ( Reader &&  )
defaultnoexcept

◆ ~Reader()

virtual CppCommon::Reader::~Reader ( )
virtualdefaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Read()

virtual size_t CppCommon::Reader::Read ( void *  buffer,
size_t  size 
)
pure virtual

Read a bytes buffer base method.

Parameters
buffer- Buffer to read
size- Buffer size
Returns
Count of read bytes

Implemented in CppCommon::StdInput, CppCommon::Pipe, and CppCommon::File.

◆ ReadAllBytes()

std::vector< uint8_t > CppCommon::Reader::ReadAllBytes ( )

Read all bytes.

Returns
Bytes buffer

Definition at line 15 of file reader.cpp.

◆ ReadAllLines()

std::vector< std::string > CppCommon::Reader::ReadAllLines ( )

Read all text lines.

Returns
Text lines

Definition at line 38 of file reader.cpp.

◆ ReadAllText()

std::string CppCommon::Reader::ReadAllText ( )

Read all text.

Returns
Text string

Definition at line 32 of file reader.cpp.


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