3#include <CesiumJsonReader/JsonHandler.h>
4#include <CesiumJsonReader/Library.h>
5#include <CesiumUtility/IntrusivePointer.h>
45 template <typename TAccessor, typename TProperty>
47 property(const
char* currentKey, TAccessor& accessor, TProperty& value) {
48 this->_currentKey = currentKey;
50 if constexpr (isOptional<TProperty>::value) {
52 accessor.reset(
this, &value.value());
53 }
else if constexpr (isIntrusivePointer<TProperty>::value) {
55 accessor.reset(
this, value.get());
57 accessor.reset(
this, &value);
69 virtual
void reportWarning(
70 const
std::
string& warning,
71 std::vector<
std::
string>&& context =
std::vector<
std::
string>()) override;
77 void setCurrentKey(const
char* key) noexcept;
80 template <typename T> struct isOptional {
81 static constexpr bool value =
false;
84 template <
typename T>
struct isOptional<
std::optional<T>> {
85 static constexpr bool value =
true;
88 template <
typename T>
struct isIntrusivePointer {
89 static constexpr bool value =
false;
93 struct isIntrusivePointer<
CesiumUtility::IntrusivePointer<T>> {
94 static constexpr bool value =
true;
98 const char* _currentKey =
nullptr;
Base interface for all JSON handlers. Types that need to be deserialized from JSON should implement I...
A dummy implementation of IJsonHandler that will report a warning and return its parent when any of i...
IJsonHandler for handling JSON objects.
virtual IJsonHandler * readObjectStart() override
Called when the JSON parser encounters the beginning of an object.
const char * getCurrentKey() const noexcept
Obtains the most recent key handled by this JsonHandler.
Classes for reading JSON.
Utility classes for Cesium.