cesium-native 0.43.0
Loading...
Searching...
No Matches
IJsonHandler.h
1#pragma once
2
3#include "Library.h"
4
5#include <cstdint>
6#include <string>
7#include <string_view>
8#include <vector>
9
10namespace CesiumJsonReader {
18class CESIUMJSONREADER_API IJsonHandler {
19public:
20 virtual ~IJsonHandler(){};
26 virtual IJsonHandler* readNull() = 0;
33 virtual IJsonHandler* readBool(bool b) = 0;
40 virtual IJsonHandler* readInt32(int32_t i) = 0;
47 virtual IJsonHandler* readUint32(uint32_t i) = 0;
54 virtual IJsonHandler* readInt64(int64_t i) = 0;
61 virtual IJsonHandler* readUint64(uint64_t i) = 0;
68 virtual IJsonHandler* readDouble(double d) = 0;
75 virtual IJsonHandler* readString(const std::string_view& str) = 0;
76
90 virtual IJsonHandler* readObjectKey(const std::string_view& str) = 0;
97
110
118 virtual void reportWarning(
119 const std::string& warning,
120 std::vector<std::string>&& context = std::vector<std::string>()) = 0;
121};
122} // namespace CesiumJsonReader
Base interface for all JSON handlers. Types that need to be deserialized from JSON should implement I...
virtual IJsonHandler * readArrayEnd()=0
Called when the JSON parser encounters the end of an array.
virtual IJsonHandler * readArrayStart()=0
Called when the JSON parser encounters the start of an array.
virtual IJsonHandler * readUint32(uint32_t i)=0
Called when the JSON parser encounters a uint32 value.
virtual IJsonHandler * readObjectKey(const std::string_view &str)=0
Called when the JSON parser encounters a key while reading an object.
virtual IJsonHandler * readUint64(uint64_t i)=0
Called when the JSON parser encounters a uint64 value.
virtual IJsonHandler * readNull()=0
Called when the JSON parser encounters a null.
virtual IJsonHandler * readObjectEnd()=0
Called when the JSON parser encounters the end of an object.
virtual IJsonHandler * readDouble(double d)=0
Called when the JSON parser encounters a double value.
virtual IJsonHandler * readBool(bool b)=0
Called when the JSON parser encounters a boolean value.
virtual void reportWarning(const std::string &warning, std::vector< std::string > &&context=std::vector< std::string >())=0
Report a warning while reading JSON.
virtual IJsonHandler * readObjectStart()=0
Called when the JSON parser encounters the beginning of an object.
virtual IJsonHandler * readString(const std::string_view &str)=0
Called when the JSON parser encounters a string value.
virtual IJsonHandler * readInt64(int64_t i)=0
Called when the JSON parser encounters an int64 value.
virtual IJsonHandler * readInt32(int32_t i)=0
Called when the JSON parser encounters an int32 value.
Classes for reading JSON.