cesium-native 0.44.2
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:
15 JsonObjectJsonHandler() noexcept;
16
22
24 virtual IJsonHandler* readNull() override;
26 virtual IJsonHandler* readBool(bool b) override;
28 virtual IJsonHandler* readInt32(int32_t i) override;
30 virtual IJsonHandler* readUint32(uint32_t i) override;
32 virtual IJsonHandler* readInt64(int64_t i) override;
34 virtual IJsonHandler* readUint64(uint64_t i) override;
36 virtual IJsonHandler* readDouble(double d) override;
38 virtual IJsonHandler* readString(const std::string_view& str) override;
40 virtual IJsonHandler* readObjectStart() override;
42 virtual IJsonHandler* readObjectKey(const std::string_view& str) override;
44 virtual IJsonHandler* readObjectEnd() override;
46 virtual IJsonHandler* readArrayStart() override;
48 virtual IJsonHandler* readArrayEnd() override;
49
50private:
51 IJsonHandler* doneElement();
52
53 std::vector<CesiumUtility::JsonValue*> _stack;
54 std::string_view _currentKey;
55};
56
57} // namespace CesiumJsonReader
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...
Definition JsonHandler.h:19
IJsonHandler for arbitrary CesiumUtility::JsonValue JsonValue objects.
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.
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.