byteme
C++ wrappers for buffered inputs
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 void write (const unsigned char *buffer, size_t n)=0
 
virtual void finish ()=0
 
void write (const std::string &x)
 
void write (const char *x)
 
void write (char x)
 

Detailed Description

Virtual class for writing bytes to a sink.

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() [1/4]

void byteme::Writer::write ( char x)
inline

Write a single character to the output sink.

Parameters
xCharacter to be written.

◆ write() [2/4]

void byteme::Writer::write ( const char * x)
inline

Write a null-terminated C-string to the output sink.

Parameters
[in]xPointer to the string to be written.

◆ write() [3/4]

void byteme::Writer::write ( const std::string & x)
inline

Write a string to the output sink.

Parameters
xString to be written.

◆ write() [4/4]

virtual void byteme::Writer::write ( const unsigned char * buffer,
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.

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: