28 #ifndef _chunked_istream_h
29 #define _chunked_istream_h
58 std::string d_error_message;
67 void m_buffer_alloc() {
69 d_buffer =
new char[d_buf_size];
100 : d_is(is), d_buf_size(size), d_buffer(0), d_twiddle_bytes(
twiddle_bytes), d_error(
false) {
102 throw std::out_of_range(
"A chunked_outbuf (or chunked_ostream) was built using a buffer larger than 0x00ffffff");
108 : d_is(is), d_buf_size(size), d_buffer(0), d_twiddle_bytes(false), d_set_twiddle(false), d_error(false) {
110 throw std::out_of_range(
"A chunked_outbuf (or chunked_ostream) was built using a buffer larger than 0x00ffffff");
128 bool error()
const {
return d_error; }
134 virtual std::streamsize
xsgetn(
char* s, std::streamsize num);
141 #if BYTE_ORDER_PREFIX
172 #endif // _chunked_istream_h
int_type read_next_chunk()
Read a chunk Normally the chunked nature of a chunked_istream/chunked_inbuf is hidden from the caller...
virtual int_type underflow()
Insert new characters into the buffer This specialization of underflow is called when the gptr() is a...
chunked_istream(std::istream &is, int size)
virtual std::streamsize xsgetn(char *s, std::streamsize num)
Read a block of data This specialization of xsgetn() reads num bytes and puts them in s first reading...
int bytes_in_buffer() const
chunked_inbuf(std::istream &is, int size)
Build a chunked input buffer.
std::string error_message() const
std::string error_message() const
bool twiddle_bytes() const
bool twiddle_bytes() const
int bytes_in_buffer() const