cesium-native  0.41.0
CesiumJsonReader::JsonReaderOptions Class Reference

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 ExtensibleObject::unknownProperties field. More...
 
void setCaptureUnknownProperties (bool value)
 Sets a value indicating whether the values of unknown properties are captured in the ExtensibleObject::unknownProperties field. More...
 
template<typename TExtended , typename TExtensionHandler >
void registerExtension (const std::string &extensionName)
 Registers an extension for an object. More...
 
template<typename TExtended , typename TExtensionHandler >
void registerExtension ()
 Registers an extension for an object. More...
 
ExtensionState getExtensionState (const std::string &extensionName) const
 Returns whether an extension is enabled or disabled. More...
 
void setExtensionState (const std::string &extensionName, ExtensionState newState)
 Enables or disables an extension. More...
 
std::unique_ptr< IExtensionJsonHandlercreateExtensionHandler (const std::string_view &extensionName, const std::string &extendedObjectType) const
 

Detailed Description

Holds options for reading statically-typed data structures from JSON.

Definition at line 48 of file JsonReaderOptions.h.

Member Function Documentation

◆ getCaptureUnknownProperties()

bool CesiumJsonReader::JsonReaderOptions::getCaptureUnknownProperties ( ) const
inline

Gets a value indicating whether the values of unknown properties are captured in the ExtensibleObject::unknownProperties field.

If this is false, unknown properties are completely ignored.

Definition at line 56 of file JsonReaderOptions.h.

◆ getExtensionState()

ExtensionState CesiumJsonReader::JsonReaderOptions::getExtensionState ( const std::string &  extensionName) const

Returns whether an extension is enabled or disabled.

By default, all extensions are enabled.

Parameters
extensionNameThe name of the extension.

◆ registerExtension() [1/2]

template<typename TExtended , typename TExtensionHandler >
void CesiumJsonReader::JsonReaderOptions::registerExtension ( )
inline

Registers an extension for an object.

The extension name is obtained from TExtensionHandler::ExtensionName.

Template Parameters
TExtendedThe object to extend.
TExtensionHandlerThe extension's CesiumJsonReader::JsonHandler.

Definition at line 99 of file JsonReaderOptions.h.

◆ registerExtension() [2/2]

template<typename TExtended , typename TExtensionHandler >
void CesiumJsonReader::JsonReaderOptions::registerExtension ( const std::string &  extensionName)
inline

Registers an extension for an object.

Template Parameters
TExtendedThe object to extend.
TExtensionHandlerThe extension's CesiumJsonReader::JsonHandler.
Parameters
extensionNameThe name of the extension.

Definition at line 79 of file JsonReaderOptions.h.

◆ setCaptureUnknownProperties()

void CesiumJsonReader::JsonReaderOptions::setCaptureUnknownProperties ( bool  value)
inline

Sets a value indicating whether the values of unknown properties are captured in the ExtensibleObject::unknownProperties field.

If this is false, unknown properties are completely ignored.

Definition at line 66 of file JsonReaderOptions.h.

◆ setExtensionState()

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.

Parameters
extensionNameThe name of the extension to be enabled or disabled.
newStateThe new state for the extension.

The documentation for this class was generated from the following file: