cesium-native 0.43.0
Loading...
Searching...
No Matches
JsonObjectJsonHandler.h
1#pragma once
2
3#include "JsonHandler.h"
4#include "Library.h"
5
6#include <CesiumUtility/JsonValue.h>
7
8namespace CesiumJsonReader {
9
14class CESIUMJSONREADER_API JsonObjectJsonHandler : public JsonHandler {
15public:
16 JsonObjectJsonHandler() noexcept;
17
23
25 virtual IJsonHandler* readNull() override;
27 virtual IJsonHandler* readBool(bool b) override;
29 virtual IJsonHandler* readInt32(int32_t i) override;
31 virtual IJsonHandler* readUint32(uint32_t i) override;
33 virtual IJsonHandler* readInt64(int64_t i) override;
35 virtual IJsonHandler* readUint64(uint64_t i) override;
37 virtual IJsonHandler* readDouble(double d) override;
39 virtual IJsonHandler* readString(const std::string_view& str) override;
41 virtual IJsonHandler* readObjectStart() override;
43 virtual IJsonHandler* readObjectKey(const std::string_view& str) override;
45 virtual IJsonHandler* readObjectEnd() override;
47 virtual IJsonHandler* readArrayStart() override;
49 virtual IJsonHandler* readArrayEnd() override;
50
51private:
52 IJsonHandler* doneElement();
53
54 std::vector<CesiumUtility::JsonValue*> _stack;
55 std::string_view _currentKey;
56};
57
58} // 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:75
Classes for reading JSON.