cesium-native 0.43.0
|
Classes for writing JSON. More...
Classes | |
class | ExtensionWriterContext |
A context for writing extensions where known extensions and their handlers can be registered. More... | |
class | JsonWriter |
Wrapper around rapidjson::Writer for writing objects to JSON. More... | |
class | PrettyJsonWriter |
Implementation of JsonWriter that "pretty-prints" JSON to the output, formatted with new lines and indentation. More... | |
Enumerations | |
enum class | ExtensionState { Enabled , Disabled } |
The state of an extension. More... | |
Functions | |
void | writeJsonValue (const CesiumUtility::JsonValue &value, JsonWriter &writer) |
Writes the given CesiumUtility::JsonValue to the provided writer. | |
template<typename TExtended > | |
void | writeJsonExtensions (const TExtended &obj, JsonWriter &jsonWriter, const ExtensionWriterContext &context) |
Writes the extensions attached to the provided object as a new JSON object. | |
template<typename TExtended > | |
bool | hasRegisteredExtensions (const TExtended &obj, JsonWriter &jsonWriter, const ExtensionWriterContext &context) |
Checks if the provided object has any extensions attached that have been registered with the provided ExtensionWriterContext. | |
Classes for writing JSON.
|
strong |
The state of an extension.
Enumerator | |
---|---|
Enabled | The extension is enabled. If the extension is a |
Disabled | The extension is disabled. It will not be represented in the serialized model at all. |
Definition at line 17 of file ExtensionWriterContext.h.
bool CesiumJsonWriter::hasRegisteredExtensions | ( | const TExtended & | obj, |
JsonWriter & | jsonWriter, | ||
const ExtensionWriterContext & | context ) |
Checks if the provided object has any extensions attached that have been registered with the provided ExtensionWriterContext.
TExtended | The type with extensions attached to write. This type must have an extensions property of type std::unordered_map<std::string, std::any> or a similar type with an empty() method that returns pairs of <std::string, std::any> when iterated. |
obj | The object with extensions to write. |
jsonWriter | The writer to write the extensions object to. |
context | The ExtensionWriterContext with registered extensions. |
obj
have been registered, false otherwise. Definition at line 60 of file writeJsonExtensions.h.
void CesiumJsonWriter::writeJsonExtensions | ( | const TExtended & | obj, |
JsonWriter & | jsonWriter, | ||
const ExtensionWriterContext & | context ) |
Writes the extensions attached to the provided object as a new JSON object.
TExtended | The type with extensions attached to write. This type must have an extensions property of type std::unordered_map<std::string, std::any> or a similar type with an empty() method that returns pairs of <std::string, std::any> when iterated. |
obj | The object with extensions to write. |
jsonWriter | The writer to write the extensions object to. |
context | The ExtensionWriterContext that provides information on how to write each extension. |
Definition at line 24 of file writeJsonExtensions.h.
void CesiumJsonWriter::writeJsonValue | ( | const CesiumUtility::JsonValue & | value, |
JsonWriter & | writer ) |
Writes the given CesiumUtility::JsonValue to the provided writer.
value | The value to write. |
writer | The writer used to write the provided value. |