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

IJsonHandler for handling JSON objects. More...

#include <CesiumJsonReader/ObjectJsonHandler.h>

Inheritance diagram for CesiumJsonReader::ObjectJsonHandler:
CesiumJsonReader::JsonHandler CesiumJsonReader::IJsonHandler CesiumJsonReader::DictionaryJsonHandler< CesiumUtility::JsonValue, CesiumJsonReader::JsonObjectJsonHandler > CesiumJsonReader::DictionaryJsonHandler< T, THandler > CesiumJsonReader::ExtensibleObjectJsonHandler CesiumJsonReader::ExtensionsJsonHandler CesiumJsonReader::SharedAssetJsonHandler

Public Member Functions

virtual IJsonHandlerreadObjectStart () override
 Called when the JSON parser encounters the beginning of an object.
 
virtual IJsonHandlerreadObjectEnd () override
 Called when the JSON parser encounters the end of an object.
 
- Public Member Functions inherited from CesiumJsonReader::JsonHandler
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 IJsonHandlerreadObjectKey (const std::string_view &str) override
 Called when the JSON parser encounters a key while reading 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.
 
- Public Member Functions inherited from CesiumJsonReader::IJsonHandler

Protected Member Functions

virtual IJsonHandlerStartSubObject () noexcept
 Called when readObjectStart is called when the depth of the ObjectJsonHandler is greater than 0.
 
virtual IJsonHandlerEndSubObject () noexcept
 Called when readObjectEnd is called when the depth of the ObjectJsonHandler is greater than 0.
 
template<typename TAccessor , typename TProperty >
IJsonHandlerproperty (const char *currentKey, TAccessor &accessor, TProperty &value)
 Called from IJsonHandler::readObjectKey to read a property into an object.
 
const char * getCurrentKey () const noexcept
 Obtains the most recent key handled by this JsonHandler.
 
virtual void reportWarning (const std::string &warning, std::vector< std::string > &&context=std::vector< std::string >()) override
 Report a warning while reading JSON.
 
void setCurrentKey (const char *key) noexcept
 Sets the most recent key handled by this JsonHandler.
 
- Protected Member Functions inherited from CesiumJsonReader::JsonHandler
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

IJsonHandler for handling JSON objects.

Definition at line 14 of file ObjectJsonHandler.h.

Constructor & Destructor Documentation

◆ ObjectJsonHandler()

CesiumJsonReader::ObjectJsonHandler::ObjectJsonHandler ( )
inlinenoexcept

Definition at line 16 of file ObjectJsonHandler.h.

Member Function Documentation

◆ property()

template<typename TAccessor , typename TProperty >
IJsonHandler * CesiumJsonReader::ObjectJsonHandler::property ( const char * currentKey,
TAccessor & accessor,
TProperty & value )
inlineprotected

Called from IJsonHandler::readObjectKey to read a property into an object.

Parameters
currentKeyThe key that's currently being read.
accessorAn IJsonHandler that can read the type of this property.
valueA reference to the location to store the read value.
Returns
The accessor IJsonHandler that will read the next token into value.

Definition at line 48 of file ObjectJsonHandler.h.

◆ readObjectEnd()

virtual IJsonHandler * CesiumJsonReader::ObjectJsonHandler::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.

Reimplemented from CesiumJsonReader::JsonHandler.

◆ readObjectStart()

virtual IJsonHandler * CesiumJsonReader::ObjectJsonHandler::readObjectStart ( )
overridevirtual

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

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

Reimplemented from CesiumJsonReader::JsonHandler.

◆ reportWarning()

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

Report a warning while reading JSON.

Parameters
warningThe warning to report.
contextContext information to include with this warning to help debugging.

Reimplemented from CesiumJsonReader::JsonHandler.


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