tetengo 1.9.2
A multipurpose library set
Loading...
Searching...
No Matches
tetengo::json::stream_reader Class Reference

A stream reader. More...

#include <stream_reader.hpp>

Inheritance diagram for tetengo::json::stream_reader:
Collaboration diagram for tetengo::json::stream_reader:

Public Member Functions

 stream_reader (std::unique_ptr< std::istream > &&p_stream, std::size_t buffer_capacity=default_buffer_capacity())
 Creates a stream reader.
virtual ~stream_reader ()
 Destroys the stream reader.
Public Member Functions inherited from tetengo::json::reader
virtual ~reader ()
 Destroys the reader.
bool has_next () const
 Returns true when the next character exists.
char peek () const
 Returns the current character.
void next ()
 Moves to the next character.
const readerbase_reader () const
 Returns the base reader.

Static Public Member Functions

static std::size_t default_buffer_capacity ()
 Returns the default buffer capacity.

Detailed Description

A stream reader.

Constructor & Destructor Documentation

◆ stream_reader()

tetengo::json::stream_reader::stream_reader ( std::unique_ptr< std::istream > && p_stream,
std::size_t buffer_capacity = default_buffer_capacity() )
explicit

Creates a stream reader.

Parameters
p_streamA unique pointer to an input stream.
buffer_capacityA buffer capacity.
Exceptions
std::invalid_argumentWhen p_stream is nullptr or buffer_capacity is 0.

Member Function Documentation

◆ default_buffer_capacity()

std::size_t tetengo::json::stream_reader::default_buffer_capacity ( )
staticnodiscard

Returns the default buffer capacity.

Returns
The default buffer capacity.

The documentation for this class was generated from the following file: