byteme
Read/write bytes from various sources
Loading...
Searching...
No Matches
byteme::Writer Class Referenceabstract

Virtual class for writing bytes to a sink. More...

#include <Writer.hpp>

Inheritance diagram for byteme::Writer:

Public Member Functions

virtual ~Writer ()=default
 
virtual void write (const unsigned char *buffer, std::size_t n)=0
 
virtual void finish ()=0
 

Detailed Description

Virtual class for writing bytes to a sink.

Constructor & Destructor Documentation

◆ ~Writer()

virtual byteme::Writer::~Writer ( )
virtualdefault

The destructor should have the same effect as finish() if the latter was not previously called.

Member Function Documentation

◆ finish()

virtual void byteme::Writer::finish ( )
pure virtual

Indicate that the writing has finished and that the relevant clean-up (buffer flushing, file closing, etc.) should be performed. This should be called exactly once, after which no further calls to write() or finish() should be performed.

Implemented in byteme::GzipFileWriter, byteme::OstreamWriter< Pointer_ >, byteme::RawBufferWriter, byteme::RawFileWriter, and byteme::ZlibBufferWriter.

◆ write()

virtual void byteme::Writer::write ( const unsigned char * buffer,
std::size_t n )
pure virtual

Write the next chunk of bytes to the output sink. This may or may not be internally buffered at the discretion of the concrete class.

Parameters
[in]bufferPointer to the start of an array containing the bytes to be written.
nLength of the array in buffer. This may be zero.

Implemented in byteme::GzipFileWriter, byteme::OstreamWriter< Pointer_ >, byteme::RawBufferWriter, byteme::RawFileWriter, and byteme::ZlibBufferWriter.


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