IInspectJsonSerializer#

class omni.inspect.IInspectJsonSerializer#

Bases: _IInspectJsonSerializer

Base class for object inspection requests.

Methods

__init__(*args, **kwargs)

Overloaded function.

as_string(self)

Get the current output as a string.

clear(self)

Clear the contents of the serializer output, either emptying the file or clearing the string, depending on where the current output is directed.

close_array(self)

Finish writing a JSON array.

close_object(self)

Finish writing a JSON object.

finish(self)

Finishes writing the entire JSON dictionary.

open_array(self)

Begin a JSON array.

open_object(self)

Begin a JSON object.

set_output_to_string(self)

Set the output location of the serializer data to be a local string.

write_base64_encoded(self, value, size)

Write a set of bytes into the output JSON as a base64 encoded string.

write_bool(self, value)

Write out a JSON boolean value.

write_double(self, value)

Write out a JSON double (aka number) value.

write_float(self, value)

Write out a JSON float (aka number) value.

write_int(self, value)

Write out a JSON integer value.

write_int64(self, value)

Write out a JSON 64-bit integer value.

write_key(self, key)

Write out a JSON key for an object property.

write_key_with_length(self, key, key_len)

Write out a JSON key for an object property.

write_null(self)

Write out a JSON null value.

write_string(self, value)

Write out a JSON string value.

write_string_with_length(self, value, len)

Write out a JSON string value.

write_u_int(self, value)

Write out a JSON unsigned integer value.

write_u_int64(self, value)

Write out a JSON 64-bit unsigned integer value.

Attributes

output_location

output_to_file_path

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: omni.inspect._omni_inspect.IInspectJsonSerializer, arg0: omni.core._core.IObject) -> None

  2. __init__(self: omni.inspect._omni_inspect.IInspectJsonSerializer) -> None

as_string(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) str#

Get the current output as a string. If the output is being sent to a file path then read the file at that path and return the contents of the file (with the usual caveats about file size).

@returns String representation of the output so far

clear(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) None#

Clear the contents of the serializer output, either emptying the file or clearing the string, depending on where the current output is directed.

close_array(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) bool#

Finish writing a JSON array.

@returns whether or not validation succeeded.

close_object(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) bool#

Finish writing a JSON object.

@returns whether or not validation succeeded.

finish(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) bool#

Finishes writing the entire JSON dictionary.

@returns whether or not validation succeeded.

open_array(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) bool#

Begin a JSON array.

@returns whether or not validation succeeded. @note This may throw a std::bad_alloc or a std::length_error if the stack of scopes gets too large

open_object(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) bool#

Begin a JSON object.

@returns whether or not validation succeeded.

set_output_to_string(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) None#

Set the output location of the serializer data to be a local string. No check is made to ensure that the string size doesn’t get too large so when in doubt use a file path.

write_base64_encoded(
self: omni.inspect._omni_inspect.IInspectJsonSerializer,
value: bytes,
size: int,
) bool#

Write a set of bytes into the output JSON as a base64 encoded string.

@param[in] value The bytes to be written. @param[in] size The number of bytes of data in @p value. @returns whether or not validation succeeded. @remarks This will take the input bytes and encode it in base64, then store that as base64 data in a string.

write_bool(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
value: bool,
) bool#

Write out a JSON boolean value.

@param[in] value The boolean value. @returns whether or not validation succeeded.

write_double(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
value: float,
) bool#

Write out a JSON double (aka number) value.

@param[in] value The double value. @returns whether or not validation succeeded.

write_float(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
value: float,
) bool#

Write out a JSON float (aka number) value.

@param[in] value The double value. @returns whether or not validation succeeded.

write_int(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
value: int,
) bool#

Write out a JSON integer value.

@param[in] value The integer value. @returns whether or not validation succeeded.

write_int64(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
value: int,
) bool#

Write out a JSON 64-bit integer value.

@param[in] value The 64-bit integer value. @returns whether or not validation succeeded. @note 64 bit integers will be written as a string of they are too long to be stored as a number that’s interoperable with javascript’s double precision floating point format.

write_key(
self: omni.inspect._omni_inspect.IInspectJsonSerializer,
key: str,
) bool#

Write out a JSON key for an object property.

@param[in] key The key name for this property. This may be nullptr. @returns whether or not validation succeeded.

write_key_with_length(
self: omni.inspect._omni_inspect.IInspectJsonSerializer,
key: str,
key_len: int,
) bool#

Write out a JSON key for an object property.

@param[in] key The string value for the key. This can be nullptr. @param[in] keyLen The length of @ref key, excluding the null terminator. @returns whether or not validation succeeded.

write_null(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
) bool#

Write out a JSON null value.

@returns whether or not validation succeeded.

write_string(
self: omni.inspect._omni_inspect.IInspectJsonSerializer,
value: str,
) bool#

Write out a JSON string value.

@param[in] value The string value. This can be nullptr. @returns whether or not validation succeeded.

write_string_with_length(
self: omni.inspect._omni_inspect.IInspectJsonSerializer,
value: str,
len: int,
) bool#

Write out a JSON string value.

@param[in] value The string value. This can be nullptr if @p len is 0. @param[in] len The length of @p value, excluding the null terminator. @returns whether or not validation succeeded.

write_u_int(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
value: int,
) bool#

Write out a JSON unsigned integer value.

@param[in] value The unsigned integer value. @returns whether or not validation succeeded.

write_u_int64(
self: omni.inspect._omni_inspect._IInspectJsonSerializer,
value: int,
) bool#

Write out a JSON 64-bit unsigned integer value.

@param[in] value The 64-bit unsigned integer value. @returns whether or not validation succeeded. @note 64 bit integers will be written as a string of they are too long to be stored as a number that’s interoperable with javascript’s double precision floating point format.