ctrlX Data Layer API for Python  3.3.0
The ctrlX Data Layer API allows access to the ctrlX Data Layer with Python
Converter Class Reference

Public Member Functions

def __init__ (self, C_DLR_CONVERTER c_converter)
 
def converter_generate_json_complex (self, Variant data, Variant ty, int indent_step)
 
def converter_generate_json_simple (self, Variant data, int indent_step)
 
def get_handle (self)
 
def get_schema (self, C_DLR_SCHEMA schema)
 
def parse_json_complex (self, str json, Variant ty)
 
def parse_json_simple (self, str json)
 

Detailed Description

Converter interface.

Definition at line 30 of file converter.py.

Member Function Documentation

◆ converter_generate_json_complex()

def converter_generate_json_complex (   self,
Variant  data,
Variant  ty,
int  indent_step 
)

This function generate a JSON string out of a Variant with complex type (flatbuffers) and the metadata of this data.

Parameters
[in]dataVariant which contains data of complex data type (flatbuffers) if data is empty (VariantType::UNKNOWN) type is converted to json schema
[in]typeVariant which contains type of data (Variant with flatbuffers BFBS)
[in]indentStepIndentation length for json string
Returns
tuple (Result, Variant)
<Result>, status of function call,
<Variant>, Generated JSON as Variant (string)

Definition at line 69 of file converter.py.

References Converter.__converter.

◆ converter_generate_json_simple()

def converter_generate_json_simple (   self,
Variant  data,
int  indent_step 
)

This function generate a JSON string out of a Variant witch have a simple data type.

Parameters
[in]dataVariant which contains data with simple data type
[in]indentStepIndentation length for json string
Returns
tuple (Result, Variant)
<Result>, status of function call,
<Variant>, Generated JSON as Variant (string)

Definition at line 54 of file converter.py.

References Converter.__converter.

◆ get_schema()

def get_schema (   self,
C_DLR_SCHEMA  schema 
)

This function returns the type (schema)

Parameters
[in]schemaRequested schema
Returns
tuple (Result, Variant)
<Result>, status of function call,
<Variant>, Variant which contains the type (schema)

Definition at line 115 of file converter.py.

References Converter.__converter.

◆ parse_json_complex()

def parse_json_complex (   self,
str  json,
Variant  ty 
)

This function generates a Variant out of a JSON string containing the (complex) data.

Parameters
[in]jsonData of the Variant as a json string
[in]typeVariant which contains type of data (Variant with bfbs flatbuffer content)
Returns
tuple (Result, Variant, Variant)
<Result>, status of function call,
<Variant>, Variant which contains the data
<Variant>, Error as Variant (string)

Definition at line 100 of file converter.py.

References Converter.__converter.

◆ parse_json_simple()

def parse_json_simple (   self,
str  json 
)

This function generates a Variant out of a JSON string containing the (simple) data.

Parameters
[in]jsonData of the Variant as a json string
Returns
tuple (Result, Variant, Variant)
<Result>, status of function call,
<Variant>, Variant which contains the data
<Variant>, Error as Variant (string)

Definition at line 83 of file converter.py.

References Converter.__converter.