matador::json_parser Class Reference

Parse a json formatted stream or string. More...

#include <json_parser.hpp>

Inherits matador::generic_json_parser< json_parser >.

Public Member Functions

 json_parser ()=default
 
json parse (const char *str)
 parse a const character string.
 
json parse (const std::string &str)
 parse a std::string.
 

Additional Inherited Members

- Protected Member Functions inherited from matador::generic_json_parser< json_parser >
 generic_json_parser ()=default
 
void on_parse_object (bool check_for_eos)
 
void on_parse_array (bool check_for_eos)
 
void on_begin_object ()
 
void on_object_key (const std::string &)
 
void on_end_object ()
 
void on_begin_array ()
 
void on_end_array ()
 
void on_string (const std::string &)
 
void on_integer (long long)
 
void on_real (double)
 
void on_bool (bool)
 
void on_null ()
 
void sync_cursor (const char *cursor)
 

Detailed Description

Parse a json formatted stream or string.

This class parse a given input stream or string into a json serializable representation. The result will be a matador::json_value serializable.

Constructor & Destructor Documentation

◆ json_parser()

matador::json_parser::json_parser ( )
default

Creates a new json_parser instance

Member Function Documentation

◆ parse() [1/2]

json matador::json_parser::parse ( const char *  str)

parse a const character string.

Parses a const character string and returns a json_value serializable representing the json structure.

Parameters
strThe json const character string.
Returns
A json_value structure.

◆ parse() [2/2]

json matador::json_parser::parse ( const std::string &  str)

parse a std::string.

Parses a std::string and returns a json_value serializable representing the json structure.

Parameters
strThe json std::string.
Returns
A json_value structure.

The documentation for this class was generated from the following file:
  • matador/json/json_parser.hpp