SPT JSON API  1.0.0
Developed by Sans Pareil Technologies, Inc. (SPT)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
spt::json::io::Handler Struct Referenceabstract

Streaming handler interface for parsing JSON data streams. More...

#include <Handler.h>

+ Inheritance diagram for spt::json::io::Handler:

Public Types

typedef std::shared_ptr< HandlerPtr
 Shared pointer to a handler instance. More...
 

Public Member Functions

virtual void startObject ()=0
 Call-back function invoked when a new object will be read from the JSON data. This is triggered when the parser has read a '{'. More...
 
virtual void endObject ()=0
 Call-back function invoked when an object has been read from the JSON data. This is triggered when the parser has read a '}'. More...
 
virtual void startArray ()=0
 Call-back function invoked when a new array will be read from the JSON data. This is triggered when the parser has read a '['. More...
 
virtual void endArray ()=0
 Call-back function invoked when an array has been read from the JSON data. This is triggered when the parser has read a ']'. More...
 
virtual void name (std::string &&name)=0
 Call-back function invoked when a name (applies only to objects) value has been read from the JSON data. More...
 
virtual void value (std::string &&value)=0
 Call-back function invoked when a string value has been read from the JSON data. More...
 
virtual void value (int64_t value)=0
 Call-back function invoked when a integral value has been read from the JSON data. More...
 
virtual void value (double value)=0
 Call-back function invoked when a floating point value has been read from the JSON data. More...
 
virtual void value (bool value)=0
 Call-back function invoked when a boolean value has been read from the JSON data. More...
 
virtual void null ()=0
 Call-back function invoked when a null value has been read from the JSON data. More...
 
virtual void eof ()=0
 Callback function invoked to indicate end of data parsing. More...
 
virtual bool isArray () const =0
 
virtual bool isObject () const =0
 
virtual ~Handler ()
 Virtual DTOR for sub-classes. More...
 

Detailed Description

Streaming handler interface for parsing JSON data streams.

Reader implementations provided support updating the handler as events are encountered, making it possible to specify specialised handlers for parsing parts of the JSON data if so desired.

Date
Created 2013/05/07 15:11
Author
Rakesh Vidyadharan
Version
Id
Handler.h 5665 2014-10-25 02:32:00Z rakesh

Member Typedef Documentation

typedef std::shared_ptr<Handler> spt::json::io::Handler::Ptr

Shared pointer to a handler instance.

Constructor & Destructor Documentation

virtual spt::json::io::Handler::~Handler ( )
inlinevirtual

Virtual DTOR for sub-classes.

Member Function Documentation

virtual void spt::json::io::Handler::endArray ( )
pure virtual

Call-back function invoked when an array has been read from the JSON data. This is triggered when the parser has read a ']'.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::endObject ( )
pure virtual

Call-back function invoked when an object has been read from the JSON data. This is triggered when the parser has read a '}'.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::eof ( )
pure virtual

Callback function invoked to indicate end of data parsing.

Implemented in spt::json::io::DefaultHandler.

virtual bool spt::json::io::Handler::isArray ( ) const
pure virtual
Returns
Indicate whether the data parsed was an array.

Implemented in spt::json::io::DefaultHandler.

virtual bool spt::json::io::Handler::isObject ( ) const
pure virtual
Returns
Indicate whether the data parsed was an object.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::name ( std::string &&  name)
pure virtual

Call-back function invoked when a name (applies only to objects) value has been read from the JSON data.

Parameters
nameThe name value that was read from the JSON data.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::null ( )
pure virtual

Call-back function invoked when a null value has been read from the JSON data.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::startArray ( )
pure virtual

Call-back function invoked when a new array will be read from the JSON data. This is triggered when the parser has read a '['.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::startObject ( )
pure virtual

Call-back function invoked when a new object will be read from the JSON data. This is triggered when the parser has read a '{'.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::value ( std::string &&  value)
pure virtual

Call-back function invoked when a string value has been read from the JSON data.

Parameters
valueThe string that was read.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::value ( int64_t  value)
pure virtual

Call-back function invoked when a integral value has been read from the JSON data.

Parameters
valueThe integral value that was read.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::value ( double  value)
pure virtual

Call-back function invoked when a floating point value has been read from the JSON data.

Parameters
valueThe floating point value that was read.

Implemented in spt::json::io::DefaultHandler.

virtual void spt::json::io::Handler::value ( bool  value)
pure virtual

Call-back function invoked when a boolean value has been read from the JSON data.

Parameters
valueThe boolean that was read.

Implemented in spt::json::io::DefaultHandler.


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