Open Lighting Architecture: ola::web::JsonParserInterface Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::web::JsonParserInterface Class Referenceabstract
JSON

## Detailed Description

The interface used to handle tokens during JSON parsing.

As the JsonLexer traverses the input string, it calls the methods below.

Inheritance diagram for ola::web::JsonParserInterface:

## Public Member Functions
virtual void | Begin ()=0
| Called when parsing begins.
virtual void | End ()=0
| Called when parsing completes.
virtual void | String (const std::string &value)=0
| Called when a string is encountered.
virtual void | Number (uint32_t value)=0
| Called when a uint32_t is encountered.
virtual void | Number (int32_t value)=0
| Called when a int32_t is encountered.
virtual void | Number (uint64_t value)=0
| Called when a uint64_t is encountered.
virtual void | Number (int64_t value)=0
| Called when a int64_t is encountered.
virtual void | Number (const JsonDouble::DoubleRepresentation &rep)=0
| Called when a double value is encountered.
virtual void | Number (double d)=0
| Called when a double value is encountered.
virtual void | Bool (bool value)=0
| Called when a bool is encountered.
virtual void | Null ()=0
| Called when a null token is encountered.
virtual void | OpenArray ()=0
| Called when an array starts.
virtual void | CloseArray ()=0
| Called when an array completes.
virtual void | OpenObject ()=0
| Called when an object starts.
virtual void | ObjectKey (const std::string &key)=0
| Called when a new key is encountered.
virtual void | CloseObject ()=0
| Called when an object completes.
virtual void | SetError (const std::string &error)=0
| Can be called at any time to indicate an error with the input data.

## Member Function Documentation

## ◆ Begin()

virtual void ola::web::JsonParserInterface::Begin | ( |  | ) |
| pure virtual

Called when parsing begins.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Bool()

virtual void ola::web::JsonParserInterface::Bool | ( | bool | value | ) |
| pure virtual

Called when a bool is encountered.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ CloseArray()

virtual void ola::web::JsonParserInterface::CloseArray | ( |  | ) |
| pure virtual

Called when an array completes.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ CloseObject()

virtual void ola::web::JsonParserInterface::CloseObject | ( |  | ) |
| pure virtual

Called when an object completes.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ End()

virtual void ola::web::JsonParserInterface::End | ( |  | ) |
| pure virtual

Called when parsing completes.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Null()

virtual void ola::web::JsonParserInterface::Null | ( |  | ) |
| pure virtual

Called when a null token is encountered.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Number() [1/6]

virtual void ola::web::JsonParserInterface::Number | ( | const JsonDouble::DoubleRepresentation & | rep | ) |
| pure virtual

Called when a double value is encountered.

MinGW struggles with long doubles http://mingw.5.n7.nabble.com/Strange-behaviour-of-gcc-4-8-1-with-long-double-td32949.html To avoid this, and to keep as many significant bits as possible we keep the components of a double separate. See JsonDouble for details.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Number() [2/6]

virtual void ola::web::JsonParserInterface::Number | ( | double | d | ) |
| pure virtual

Called when a double value is encountered.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Number() [3/6]

virtual void ola::web::JsonParserInterface::Number | ( | int32_t | value | ) |
| pure virtual

Called when a int32_t is encountered.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Number() [4/6]

virtual void ola::web::JsonParserInterface::Number | ( | int64_t | value | ) |
| pure virtual

Called when a int64_t is encountered.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Number() [5/6]

virtual void ola::web::JsonParserInterface::Number | ( | uint32_t | value | ) |
| pure virtual

Called when a uint32_t is encountered.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ Number() [6/6]

virtual void ola::web::JsonParserInterface::Number | ( | uint64_t | value | ) |
| pure virtual

Called when a uint64_t is encountered.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ ObjectKey()

virtual void ola::web::JsonParserInterface::ObjectKey | ( | const std::string & | key | ) |
| pure virtual

Called when a new key is encountered.

This may be called multiple times for the same object. The standard doesn't specify how to handle duplicate keys, so I generally use the last one.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ OpenArray()

virtual void ola::web::JsonParserInterface::OpenArray | ( |  | ) |
| pure virtual

Called when an array starts.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ OpenObject()

virtual void ola::web::JsonParserInterface::OpenObject | ( |  | ) |
| pure virtual

Called when an object starts.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ SetError()

virtual void ola::web::JsonParserInterface::SetError | ( | const std::string & | error | ) |
| pure virtual

Can be called at any time to indicate an error with the input data.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

## ◆ String()

virtual void ola::web::JsonParserInterface::String | ( | const std::string & | value | ) |
| pure virtual

Called when a string is encountered.

This is not called for object keys, see ObjectKey() below.

Implemented in ola::web::JsonParser, ola::web::JsonPatchParser, and ola::web::SchemaParser.

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

- include/ola/web/JsonLexer.h