cesium-native 0.43.0
Loading...
Searching...
No Matches
ExtensionsJsonHandler.h
1#pragma once
2
3#include "IExtensionJsonHandler.h"
4#include "JsonReaderOptions.h"
5#include "ObjectJsonHandler.h"
6
7#include <CesiumUtility/ExtensibleObject.h>
8
9#include <memory>
10
11namespace CesiumJsonReader {
17public:
24 explicit ExtensionsJsonHandler(const JsonReaderOptions& context) noexcept
26 _context(context),
27 _pObject(nullptr),
28 _currentExtensionHandler() {}
29
34 void reset(
35 IJsonHandler* pParent,
37 const std::string& objectType);
38
40 virtual IJsonHandler* readObjectKey(const std::string_view& str) override;
41
42private:
43 const JsonReaderOptions& _context;
44 CesiumUtility::ExtensibleObject* _pObject = nullptr;
45 std::string _objectType;
46 std::unique_ptr<IExtensionJsonHandler> _currentExtensionHandler;
47};
48
49} // namespace CesiumJsonReader
IJsonHandler for reading extensions, such as those listed in an ExtensibleObject.
ExtensionsJsonHandler(const JsonReaderOptions &context) noexcept
Creates a new ExtensionsJsonHandler with the specified reader options.
virtual IJsonHandler * readObjectKey(const std::string_view &str) override
Called when the JSON parser encounters a key while reading an object.
void reset(IJsonHandler *pParent, CesiumUtility::ExtensibleObject *pObject, const std::string &objectType)
Resets the IJsonHandler's parent and pointer to destination, as well as the name of the object type t...
Base interface for all JSON handlers. Types that need to be deserialized from JSON should implement I...
Holds options for reading statically-typed data structures from JSON.
IJsonHandler for handling JSON objects.
Classes for reading JSON.
The base class for objects that have extensions and extras.