35 file_reader::file_reader(FILE *f,
int max_message_length,
bool block_read) :
36 reader(max_message_length, block_read),
45 if (c == EOF && ferror(
m_file))
A class to read JSON messages from various types of input stream.
#define NAMESPACE
You can change the namespace of the whole library by changing this value.
Specific class of exceptions for IO errors of various types.
unsigned char m_block[block_size]
If we're reading blocks, the block data.
virtual bool read_next_block()
Common defs needed everywhere and, as far as is possible, platform specific changes.
virtual int read_next_char()
The POSIX read() system call failed.
FILE * m_file
File to read from.
int m_block_index
If we're reading blocks, the index into the current block.
static const int block_size
Amount of data to read at once when in block read mode.
The json_io_exception class.
The stdio fgetc call failed in an unexpected way.
int m_block_num_bytes
If we're reading blocks, the number of bytes in the current block.