cesium-native 0.52.0
Loading...
Searching...
No Matches
JsonObjectJsonHandler.h
1#pragma once
2
3#include <CesiumJsonReader/JsonHandler.h>
4#include <CesiumJsonReader/Library.h>
5#include <CesiumUtility/JsonValue.h>
6
7namespace CesiumJsonReader {
8
13class CESIUMJSONREADER_API JsonObjectJsonHandler : public JsonHandler {
14public:
19
20 JsonObjectJsonHandler() noexcept;
21
26 void reset(IJsonHandler* pParent, CesiumUtility::JsonValue* pValue);
27
29 virtual IJsonHandler* readNull() override;
31 virtual IJsonHandler* readBool(bool b) override;
33 virtual IJsonHandler* readInt32(int32_t i) override;
35 virtual IJsonHandler* readUint32(uint32_t i) override;
37 virtual IJsonHandler* readInt64(int64_t i) override;
39 virtual IJsonHandler* readUint64(uint64_t i) override;
41 virtual IJsonHandler* readDouble(double d) override;
43 virtual IJsonHandler* readString(const std::string_view& str) override;
45 virtual IJsonHandler* readObjectStart() override;
47 virtual IJsonHandler* readObjectKey(const std::string_view& str) override;
49 virtual IJsonHandler* readObjectEnd() override;
51 virtual IJsonHandler* readArrayStart() override;
53 virtual IJsonHandler* readArrayEnd() override;
54
55private:
56 IJsonHandler* doneElement();
57
58 std::vector<CesiumUtility::JsonValue*> _stack;
59 std::string_view _currentKey;
60};
61
62} // namespace CesiumJsonReader
Base interface for all JSON handlers. Types that need to be deserialized from JSON should implement I...
virtual IJsonHandler * readObjectKey(const std::string_view &str) override
Called when the JSON parser encounters a key while reading an object.
virtual IJsonHandler * readString(const std::string_view &str) override
Called when the JSON parser encounters a string value.
virtual IJsonHandler * readObjectStart() override
Called when the JSON parser encounters the beginning of an object.
virtual IJsonHandler * readNull() override
Called when the JSON parser encounters a null.
CesiumUtility::JsonValue ValueType
The type of value this handler produces.
virtual IJsonHandler * readUint32(uint32_t i) override
Called when the JSON parser encounters a uint32 value.
virtual IJsonHandler * readArrayStart() override
Called when the JSON parser encounters the start of an array.
virtual IJsonHandler * readUint64(uint64_t i) override
Called when the JSON parser encounters a uint64 value.
virtual IJsonHandler * readBool(bool b) override
Called when the JSON parser encounters a boolean value.
void reset(IJsonHandler *pParent, CesiumUtility::JsonValue *pValue)
Resets this IJsonHandler's parent handler, as well as its destination pointer.
virtual IJsonHandler * readObjectEnd() override
Called when the JSON parser encounters the end of an object.
virtual IJsonHandler * readInt64(int64_t i) override
Called when the JSON parser encounters an int64 value.
virtual IJsonHandler * readArrayEnd() override
Called when the JSON parser encounters the end of an array.
virtual IJsonHandler * readDouble(double d) override
Called when the JSON parser encounters a double value.
virtual IJsonHandler * readInt32(int32_t i) override
Called when the JSON parser encounters an int32 value.
A generic implementation of a value in a JSON structure.
Definition JsonValue.h:53
Classes for reading JSON.
Utility classes for Cesium.
STL namespace.