1#ifndef BYTEME_SOME_BUFFER_READER_HPP
2#define BYTEME_SOME_BUFFER_READER_HPP
7#include "magic_numbers.hpp"
33 if (is_zlib(
buffer, length) || is_gzip(
buffer, length)) {
50 return my_source->load();
53 const unsigned char*
buffer()
const {
54 return my_source->buffer();
58 return my_source->available();
62 std::unique_ptr<Reader> my_source;
Read bytes from a raw buffer without any extra transformations.
Read bytes from a Zlib-compressed buffer.
Read bytes from a raw buffer, usually text.
Definition RawBufferReader.hpp:21
Virtual class for reading bytes from a source.
Definition Reader.hpp:15
Read a buffer that may or may not be Gzip/Zlib-compressed.
Definition SomeBufferReader.hpp:25
bool load()
Definition SomeBufferReader.hpp:49
SomeBufferReader(const char *buffer, size_t length, size_t buffer_size=65536)
Definition SomeBufferReader.hpp:45
const unsigned char * buffer() const
Definition SomeBufferReader.hpp:53
size_t available() const
Definition SomeBufferReader.hpp:57
SomeBufferReader(const unsigned char *buffer, size_t length, size_t buffer_size=65536)
Definition SomeBufferReader.hpp:32
Read and decompress bytes from a Zlib-compressed buffer.
Definition ZlibBufferReader.hpp:22
Simple byte readers and writers.