cesium-native  0.41.0
CesiumJsonReader::JsonReader Class Reference

Reads JSON. More...

#include <CesiumJsonReader/JsonReader.h>

Static Public Member Functions

template<typename T >
static ReadJsonResult< typename T::ValueType > readJson (const gsl::span< const std::byte > &data, T &handler)
 Reads JSON from a byte buffer into a statically-typed class. More...
 
template<typename T >
static ReadJsonResult< typename T::ValueType > readJson (const rapidjson::Value &jsonValue, T &handler)
 Reads JSON from a rapidjson::Value into a statically-typed class. More...
 

Detailed Description

Reads JSON.

Definition at line 43 of file JsonReader.h.

Member Function Documentation

◆ readJson() [1/2]

template<typename T >
static ReadJsonResult<typename T::ValueType> CesiumJsonReader::JsonReader::readJson ( const gsl::span< const std::byte > &  data,
T &  handler 
)
inlinestatic

Reads JSON from a byte buffer into a statically-typed class.

Parameters
dataThe buffer from which to read JSON.
handlerThe handler to receive the top-level JSON object. This instance must:
  • Implement IJsonHandler.
  • Contain a ValueType type alias indicating the type of the instance to be read into.
  • Have a reset method taking 1) a parent IJsonHandler pointer, and 2) and a pointer to a value of type ValueType.
Returns
The result of reading the JSON.

Definition at line 60 of file JsonReader.h.

◆ readJson() [2/2]

template<typename T >
static ReadJsonResult<typename T::ValueType> CesiumJsonReader::JsonReader::readJson ( const rapidjson::Value &  jsonValue,
T &  handler 
)
inlinestatic

Reads JSON from a rapidjson::Value into a statically-typed class.

Parameters
dataThe rapidjson::Value from which to read JSON.
handlerThe handler to receive the top-level JSON object. This instance must:
  • Implement IJsonHandler.
  • Contain a ValueType type alias indicating the type of the instance to be read into.
  • Have a reset method taking 1) a parent IJsonHandler pointer, and 2) and a pointer to a value of type ValueType.
Returns
The result of reading the JSON.

Definition at line 97 of file JsonReader.h.


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