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::StreamReader Class Reference

JSON data parser for streams. More...

#include <StreamReader.h>

+ Inheritance diagram for spt::json::io::StreamReader:
+ Collaboration diagram for spt::json::io::StreamReader:

Public Member Functions

 StreamReader (Handler::Ptr callback=Handler::Ptr())
 
void read (std::istream &stream)
 Parses the data from the specified stream and sends data event notifications to the call-back handler. More...
 
- Public Member Functions inherited from spt::json::io::Reader
 Reader (Handler::Ptr callback=Handler::Ptr())
 
virtual ~Reader ()
 Virtual DTOR for subclasses. More...
 
Handler::Ptr getHandler () const
 
void setHandler (Handler::Ptr callback)
 

Additional Inherited Members

- Protected Member Functions inherited from spt::json::io::Reader
void parseNumber (const std::string &value)
 
bool isWhiteSpace (char current)
 Check to see if the specified character is white space. More...
 
bool isNumeric (char current)
 Check to see if current character represents a numeric value. More...
 
- Protected Attributes inherited from spt::json::io::Reader
Handler::Ptr handler
 The call-back handler to send data event notifications to. More...
 
- Static Protected Attributes inherited from spt::json::io::Reader
static const std::string null
 A constant representing a JSON null value. More...
 
static const std::string True
 A constant representing a JSON true value. More...
 
static const std::string False
 A constant representing a JSON false value. More...
 

Detailed Description

JSON data parser for streams.

Date
Created 2013/05/02 20:41
Author
Rakesh
Version
Id
StreamReader.h 5669 2014-10-25 13:43:46Z rakesh

Constructor & Destructor Documentation

spt::json::io::StreamReader::StreamReader ( Handler::Ptr  callback = Handler::Ptr())
inlineexplicit

Create a new parser instance using the specified call-back handler to send JSON data event notifications to.

Note: It is possible to specify an empty handler, in which case the parser will consume the JSON data without producing any output.

Parameters
callbackThe call-back handler that will receive data events.

Member Function Documentation

void spt::json::io::StreamReader::read ( std::istream &  stream)

Parses the data from the specified stream and sends data event notifications to the call-back handler.

Parameters
streamThe stream from which data is to be parsed.
Exceptions
std::runtime_errorIf JSON is invalid.

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