byteme
C++ wrappers for buffered inputs
|
Read a buffer that may or may not be Gzip/Zlib-compressed. More...
#include <SomeBufferReader.hpp>
Public Member Functions | |
SomeBufferReader (const unsigned char *buffer, std::size_t length, const SomeBufferReaderOptions &options) | |
bool | load () |
const unsigned char * | buffer () const |
std::size_t | available () const |
![]() |
Read a buffer that may or may not be Gzip/Zlib-compressed.
This class will automatically detect whether buffer
refers to a text or Gzip/Zlib-compressed buffer, based on the initial magic numbers. After that, it will dispatch appropriately to RawBufferReader
or ZlibBufferReader
respectively.
|
inline |
[in] | buffer | Pointer to an array containing the possibly compressed data. |
length | Length of the buffer array. | |
options | Further options. |
|
inlinevirtual |
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
.
buffer()
. Implements byteme::Reader.
|
inlinevirtual |
This method should only be called after load()
has been called and returns true
.
available()
. Implements byteme::Reader.
|
inlinevirtual |
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.
false
, it can be assumed that the end of the source was reached. Implements byteme::Reader.