cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumJsonReader::JsonHandler Class Reference

A dummy implementation of IJsonHandler that will report a warning and return its parent when any of its read... methods are called. More...

#include <CesiumJsonReader/JsonHandler.h>

Inheritance diagram for CesiumJsonReader::JsonHandler:
CesiumJsonReader::IJsonHandler CesiumJsonReader::ArrayJsonHandler< T, THandler > CesiumJsonReader::ArrayJsonHandler< T, IntegerJsonHandler< T > > CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler > CesiumJsonReader::ArrayJsonHandler< std::string, StringJsonHandler > CesiumJsonReader::ArrayJsonHandler< std::vector< T >, ArrayJsonHandler< T, THandler > > CesiumJsonReader::BoolJsonHandler CesiumJsonReader::DoubleJsonHandler CesiumJsonReader::IntegerJsonHandler< T > CesiumJsonReader::JsonObjectJsonHandler CesiumJsonReader::ObjectJsonHandler CesiumJsonReader::StringJsonHandler

Public Member Functions

virtual IJsonHandlerreadNull () override
 Called when the JSON parser encounters a null.
 
virtual IJsonHandlerreadBool (bool b) override
 Called when the JSON parser encounters a boolean value.
 
virtual IJsonHandlerreadInt32 (int32_t i) override
 Called when the JSON parser encounters an int32 value.
 
virtual IJsonHandlerreadUint32 (uint32_t i) override
 Called when the JSON parser encounters a uint32 value.
 
virtual IJsonHandlerreadInt64 (int64_t i) override
 Called when the JSON parser encounters an int64 value.
 
virtual IJsonHandlerreadUint64 (uint64_t i) override
 Called when the JSON parser encounters a uint64 value.
 
virtual IJsonHandlerreadDouble (double d) override
 Called when the JSON parser encounters a double value.
 
virtual IJsonHandlerreadString (const std::string_view &str) override
 Called when the JSON parser encounters a string value.
 
virtual IJsonHandlerreadObjectStart () override
 Called when the JSON parser encounters the beginning of an object.
 
virtual IJsonHandlerreadObjectKey (const std::string_view &str) override
 Called when the JSON parser encounters a key while reading an object.
 
virtual IJsonHandlerreadObjectEnd () override
 Called when the JSON parser encounters the end of an object.
 
virtual IJsonHandlerreadArrayStart () override
 Called when the JSON parser encounters the start of an array.
 
virtual IJsonHandlerreadArrayEnd () override
 Called when the JSON parser encounters the end of an array.
 
virtual void reportWarning (const std::string &warning, std::vector< std::string > &&context=std::vector< std::string >()) override
 Report a warning while reading JSON.
 
- Public Member Functions inherited from CesiumJsonReader::IJsonHandler

Protected Member Functions

void reset (IJsonHandler *pParent)
 Resets the parent IJsonHandler of this handler.
 
IJsonHandlerparent ()
 Obtains the parent IJsonHandler of this handler.
 
IJsonHandlerignoreAndReturnToParent ()
 Ignore a single value and then return to the parent handler.
 
IJsonHandlerignoreAndContinue ()
 Ignore a single value and the continue processing more tokens with this handler.
 

Detailed Description

A dummy implementation of IJsonHandler that will report a warning and return its parent when any of its read... methods are called.

This class can be used as a base for any specialized JsonHandlers, overriding the methods required for the value you're handling and leaving the rest to report warnings if called.

Definition at line 19 of file JsonHandler.h.

Member Function Documentation

◆ readArrayEnd()

◆ readArrayStart()

virtual IJsonHandler * CesiumJsonReader::JsonHandler::readArrayStart ( )
overridevirtual

◆ readBool()

virtual IJsonHandler * CesiumJsonReader::JsonHandler::readBool ( bool b)
overridevirtual

◆ readDouble()

◆ readInt32()

◆ readInt64()

◆ readNull()

◆ readObjectEnd()

virtual IJsonHandler * CesiumJsonReader::JsonHandler::readObjectEnd ( )
overridevirtual

Called when the JSON parser encounters the end of an object.

Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Implements CesiumJsonReader::IJsonHandler.

Reimplemented in CesiumJsonReader::ArrayJsonHandler< T, THandler >, CesiumJsonReader::JsonObjectJsonHandler, and CesiumJsonReader::ObjectJsonHandler.

◆ readObjectKey()

virtual IJsonHandler * CesiumJsonReader::JsonHandler::readObjectKey ( const std::string_view & str)
overridevirtual

Called when the JSON parser encounters a key while reading an object.

Parameters
strThe key.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Implements CesiumJsonReader::IJsonHandler.

Reimplemented in CesiumJsonReader::ArrayJsonHandler< T, THandler >, CesiumJsonReader::DictionaryJsonHandler< T, THandler >, CesiumJsonReader::DictionaryJsonHandler< CesiumUtility::JsonValue, CesiumJsonReader::JsonObjectJsonHandler >, CesiumJsonReader::ExtensionsJsonHandler, and CesiumJsonReader::JsonObjectJsonHandler.

◆ readObjectStart()

◆ readString()

virtual IJsonHandler * CesiumJsonReader::JsonHandler::readString ( const std::string_view & str)
overridevirtual

◆ readUint32()

◆ readUint64()

◆ reportWarning()

virtual void CesiumJsonReader::JsonHandler::reportWarning ( const std::string & warning,
std::vector< std::string > && context = std::vector< std::string >() )
overridevirtual

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