🔨 moved buffer size to interface

This commit is contained in:
Niels Lohmann 2017-03-31 17:11:51 +02:00
parent 60057a4728
commit 4c821c9e9c
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69

View file

@ -10307,9 +10307,9 @@ class basic_json
class cached_input_stream_adapter : public input_adapter
{
public:
cached_input_stream_adapter(std::istream& i)
cached_input_stream_adapter(std::istream& i, const size_t buffer_size)
: is(i), start_position(is.tellg()),
buffer(1024 * 1024, std::char_traits<char>::eof())
buffer(buffer_size, std::char_traits<char>::eof())
{
// immediately abort if stream is erroneous
if (JSON_UNLIKELY(i.fail()))
@ -10552,7 +10552,7 @@ class basic_json
}
explicit lexer(std::istream& i)
: ia(new cached_input_stream_adapter(i)),
: ia(new cached_input_stream_adapter(i, 1024 * 1024)),
decimal_point_char(get_decimal_point())
{}