1 #ifndef _json_reader_hpp_ 2 #define _json_reader_hpp_ 47 static const int block_size = 8192;
55 reader(
size_t max_message_length,
bool block_read);
66 virtual void put_back(
int c);
69 size_t get_byte_index()
const;
72 void reset_byte_index();
77 int read_next_char_from_block();
80 static const int no_put_back = 1000;
83 virtual int read_next_char() = 0;
91 virtual bool read_next_block() = 0;
106 unsigned char m_block[block_size];
size_t m_byte_index
Total number of characters read.
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.
int m_put_back
Character last put back. If equal to no_put_back then none was.
Common defs needed everywhere and, as far as is possible, platform specific changes.
size_t m_max_message_length
Maximum length of a message.
int m_block_index
If we're reading blocks, the index into the current block.
int m_block_num_bytes
If we're reading blocks, the number of bytes in the current block.
bool m_block_read
Whether to read in blocks or one byte at a time.