byteme
C++ wrappers for buffered inputs
Loading...
Searching...
No Matches
byteme::Reader Class Referenceabstract

Virtual class for reading bytes from a source. More...

#include <Reader.hpp>

Inheritance diagram for byteme::Reader:

Public Member Functions

virtual bool load ()=0
 
virtual const unsigned char * buffer () const =0
 
virtual size_t available () const =0
 

Detailed Description

Virtual class for reading bytes from a source.

Member Function Documentation

◆ available()

virtual size_t byteme::Reader::available ( ) const
pure virtual

This method should only be called after load() has been called and returns true. The return value is generally expected to be positive; however, it is possible to return a zero. Note that zero values should not be interpreted as the end of the source, which is strictly only defined by load() returning false.

Returns
Number of available bytes in buffer().

Implemented in byteme::ChunkedBufferReader, byteme::GzipFileReader, byteme::IstreamReader< Pointer_ >, byteme::RawBufferReader, byteme::RawFileReader, byteme::SomeBufferReader, byteme::SomeFileReader, and byteme::ZlibBufferReader.

◆ buffer()

virtual const unsigned char * byteme::Reader::buffer ( ) const
pure virtual

This method should only be called after load() has been called and returns true.

Returns
Pointer to the start of an array containing the available bytes. The number of available bytes is provided in available().

Implemented in byteme::ChunkedBufferReader, byteme::GzipFileReader, byteme::IstreamReader< Pointer_ >, byteme::RawBufferReader, byteme::RawFileReader, byteme::SomeBufferReader, byteme::SomeFileReader, and byteme::ZlibBufferReader.

◆ load()

virtual bool byteme::Reader::load ( )
pure virtual

Read the next chunk of bytes from the input source. To read the entire source, this function should be called repeatedly until false is returned.

Returns
Boolean indicating whether the read was successful. If false, it can be assumed that the end of the source was reached.

Implemented in byteme::ChunkedBufferReader, byteme::GzipFileReader, byteme::IstreamReader< Pointer_ >, byteme::RawBufferReader, byteme::RawFileReader, byteme::SomeBufferReader, byteme::SomeFileReader, and byteme::ZlibBufferReader.


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