omni::structuredlog::serializeScalar¶
Defined in omni/structuredlog/JsonTreeSerializer.h
-
template<bool
validate
= false, typenameT
, typenameJsonSerializerType
= JsonSerializer<false, false, ignoreJsonTreeSerializerValidationError>, typenameJsonNodeType
= JsonNode, typenameBlobReaderType
= BlobReader<false, ignoreJsonTreeSerializerValidationError>>
static inline boolomni::structuredlog
::
serializeScalar
(JsonSerializerType *serial, const JsonNodeType *root, T constVal, BlobReaderType *reader)¶ Serialize a scalar type from a JSON tree.
- Parameters
serial – [inout] The JSON serializer to serialize the data into.
root – [in] The node in the schema that represents this scalar value.
constVal – [in] The constant value from the data union of
root
. This is only read if root is marked as constant.reader – [inout] The blob reader, which will be read if
root
is not marked as constant.
- Returns
true
if no valdiation error occurred.- Returns
false
if any form of validation error occurred.