matador::generic_json_parser< T > Class Template Reference

Parses a json string providing callbacks for json syntax. More...

#include <generic_json_parser.hpp>

Protected Member Functions

 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

template<class T>
class matador::generic_json_parser< T >

Parses a json string providing callbacks for json syntax.

The generic_json_parser parses a json string and provides an interface to get notified with current parsed json structure part (e.g. begin array, read boolean or end object)

Template Parameters
TType of the class implementing the callbacks

Constructor & Destructor Documentation

◆ generic_json_parser()

template<class T >
matador::generic_json_parser< T >::generic_json_parser ( )
protecteddefault

Creates a new generic_json_parser for concrete parser h.

Parameters
hThe concrete parser.

Member Function Documentation

◆ on_begin_array()

template<class T >
void matador::generic_json_parser< T >::on_begin_array ( )
inlineprotected

Called when begin of json array is detected

◆ on_begin_object()

template<class T >
void matador::generic_json_parser< T >::on_begin_object ( )
inlineprotected

Called when begin of json object is detected

◆ on_bool()

template<class T >
void matador::generic_json_parser< T >::on_bool ( bool  val)
inlineprotected

Called when a json boolean value is detected

Parameters
valThe boolean json value

◆ on_end_array()

template<class T >
void matador::generic_json_parser< T >::on_end_array ( )
inlineprotected

Called when end of json array is detected

◆ on_end_object()

template<class T >
void matador::generic_json_parser< T >::on_end_object ( )
inlineprotected

Called when end of json object is detected

◆ on_integer()

template<class T >
void matador::generic_json_parser< T >::on_integer ( long long  val)
inlineprotected

Called when a integral json value (number) is detected

Parameters
valThe detected json integral value (number)

◆ on_null()

template<class T >
void matador::generic_json_parser< T >::on_null ( )
inlineprotected

Called when json null value is detected

◆ on_object_key()

template<class T >
void matador::generic_json_parser< T >::on_object_key ( const std::string &  key)
inlineprotected

Called when a key string of a key value relation of o json object is detected

Parameters
keyThe detected key

◆ on_parse_array()

template<class T >
void matador::generic_json_parser< T >::on_parse_array ( bool  check_for_eos)
protected

Start to parse a json array. The check_for_eos flag indicates if at the end of the object an end of string check is done

Parameters
check_for_eosTrue if end of string at end of array

◆ on_parse_object()

template<class T >
void matador::generic_json_parser< T >::on_parse_object ( bool  check_for_eos)
protected

Start to parse a json object. The check_for_eos flag indicates if at the end of the object an end of string check is done

Parameters
check_for_eosTrue if end of string at end of object

◆ on_real()

template<class T >
void matador::generic_json_parser< T >::on_real ( double  val)
inlineprotected

Called when a floating point json value (number) is detected

Parameters
valThe floating point json integral value (number)

◆ on_string()

template<class T >
void matador::generic_json_parser< T >::on_string ( const std::string &  str)
inlineprotected

Called when a json string value is detected

Parameters
strThe detected json string value

◆ sync_cursor()

template<class T >
void matador::generic_json_parser< T >::sync_cursor ( const char *  cursor)
protected

Syncs the current cursor of the internal json string to the new cursor

Parameters
cursorThe new cursor position

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