|
cesium-native 0.53.0
|
Holds options for reading statically-typed data structures from JSON. More...
#include <CesiumJsonReader/JsonReaderOptions.h>
Public Member Functions | |
| bool | getCaptureUnknownProperties () const |
Gets a value indicating whether the values of unknown properties are captured in the CesiumUtility::ExtensibleObject::unknownProperties field. | |
| void | setCaptureUnknownProperties (bool value) |
Sets a value indicating whether the values of unknown properties are captured in the CesiumUtility::ExtensibleObject::unknownProperties field. | |
| template<typename TExtended, typename TExtensionHandler> | |
| void | registerExtension (const std::string &extensionName) |
| Registers an extension for an object. | |
| template<typename TExtended, typename TExtensionHandler> | |
| void | registerExtension () |
| Registers an extension for an object. | |
| ExtensionState | getExtensionState (const std::string &extensionName) const |
| Returns whether an extension is enabled or disabled. | |
| void | setExtensionState (const std::string &extensionName, ExtensionState newState) |
| Enables or disables an extension. | |
| std::unique_ptr< IExtensionJsonHandler > | createExtensionHandler (const std::string_view &extensionName, const std::string &extendedObjectType) const |
| Creates an extension handler for the given extension. | |
Holds options for reading statically-typed data structures from JSON.
Definition at line 48 of file JsonReaderOptions.h.
| std::unique_ptr< IExtensionJsonHandler > CesiumJsonReader::JsonReaderOptions::createExtensionHandler | ( | const std::string_view & | extensionName, |
| const std::string & | extendedObjectType ) const |
Creates an extension handler for the given extension.
| extensionName | The name of the extension to create a handler for. |
| extendedObjectType | The name of the type of the object that is being extended. |
|
inline |
Gets a value indicating whether the values of unknown properties are captured in the CesiumUtility::ExtensibleObject::unknownProperties field.
If this is false, unknown properties are completely ignored.
Definition at line 56 of file JsonReaderOptions.h.
| ExtensionState CesiumJsonReader::JsonReaderOptions::getExtensionState | ( | const std::string & | extensionName | ) | const |
Returns whether an extension is enabled or disabled.
By default, all extensions are enabled.
| extensionName | The name of the extension. |
|
inline |
Registers an extension for an object.
The extension name is obtained from TExtensionHandler::ExtensionName.
| TExtended | The object to extend. |
| TExtensionHandler | The extension's CesiumJsonReader::JsonHandler. |
Definition at line 99 of file JsonReaderOptions.h.
|
inline |
Registers an extension for an object.
| TExtended | The object to extend. |
| TExtensionHandler | The extension's CesiumJsonReader::JsonHandler. |
| extensionName | The name of the extension. |
Definition at line 79 of file JsonReaderOptions.h.
|
inline |
Sets a value indicating whether the values of unknown properties are captured in the CesiumUtility::ExtensibleObject::unknownProperties field.
If this is false, unknown properties are completely ignored.
Definition at line 66 of file JsonReaderOptions.h.
| void CesiumJsonReader::JsonReaderOptions::setExtensionState | ( | const std::string & | extensionName, |
| ExtensionState | newState ) |
Enables or disables an extension.
By default, all extensions are enabled. When an enabled extension is encountered in the source JSON, it is read into a statically-typed extension class, if one is registered, or into a CesiumUtility::JsonValue if not.
When a disabled extension is encountered in the source JSON, it is ignored completely.
An extension may also be set to ExtensionState::JsonOnly, in which case it will be read into a CesiumUtility::JsonValue even if a statically-typed extension class is registered.
| extensionName | The name of the extension to be enabled or disabled. |
| newState | The new state for the extension. |