A library for working with phylogenetic and population genetic data.
v0.32.0
JsonReader Class Reference

#include <genesis/utils/formats/json/reader.hpp>

Detailed Description

Read Json data into a JsonDocument.

This class provides functions for parsing json data into a JsonDocument. The parsing works this way: Each JsonDocument is also a Json object, and can contain other objects, arrays, or simple value types. The parsing here is thus splitted in different functions, being recursively called for every level of nesting within objects and arrays.

Definition at line 62 of file utils/formats/json/reader.hpp.

Public Member Functions

 JsonReader ()=default
 
 JsonReader (JsonReader &&)=default
 
 JsonReader (JsonReader const &)=default
 
 ~JsonReader ()=default
 
JsonReaderoperator= (JsonReader &&)=default
 
JsonReaderoperator= (JsonReader const &)=default
 
JsonDocument parse (InputStream &input_stream) const
 
JsonDocument parse_array (InputStream &input_stream) const
 
JsonDocument parse_number (InputStream &input_stream) const
 
JsonDocument parse_object (InputStream &input_stream) const
 
JsonDocument parse_value (InputStream &input_stream) const
 
JsonDocument read (std::shared_ptr< BaseInputSource > source) const
 Read from a source containing a JSON document and parse its contents into a JsonDocument. More...
 

Constructor & Destructor Documentation

◆ JsonReader() [1/3]

JsonReader ( )
default

◆ ~JsonReader()

~JsonReader ( )
default

◆ JsonReader() [2/3]

JsonReader ( JsonReader const &  )
default

◆ JsonReader() [3/3]

JsonReader ( JsonReader &&  )
default

Member Function Documentation

◆ operator=() [1/2]

JsonReader& operator= ( JsonReader &&  )
default

◆ operator=() [2/2]

JsonReader& operator= ( JsonReader const &  )
default

◆ parse()

JsonDocument parse ( InputStream input_stream) const

Definition at line 69 of file utils/formats/json/reader.cpp.

◆ parse_array()

JsonDocument parse_array ( InputStream input_stream) const

Definition at line 147 of file utils/formats/json/reader.cpp.

◆ parse_number()

JsonDocument parse_number ( InputStream input_stream) const

Definition at line 248 of file utils/formats/json/reader.cpp.

◆ parse_object()

JsonDocument parse_object ( InputStream input_stream) const

Definition at line 193 of file utils/formats/json/reader.cpp.

◆ parse_value()

JsonDocument parse_value ( InputStream input_stream) const

Definition at line 85 of file utils/formats/json/reader.cpp.

◆ read()

JsonDocument read ( std::shared_ptr< BaseInputSource source) const

Read from a source containing a JSON document and parse its contents into a JsonDocument.

Use functions such as utils::from_file() and utils::from_string() to conveniently get an input source that can be used here.

Definition at line 55 of file utils/formats/json/reader.cpp.


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