RTI Connext C API  Version 6.1.2
DDS_PrintFormatProperty Struct Reference

A collection of attributes used to configure how data samples will be formatted when converted to a string. More...

Data Fields

DDS_PrintFormatKind kind
 The kind of format to be used when converting a data sample to a string. More...
 
DDS_Boolean pretty_print
 Choose whether to print a data sample in a more readable format or to eliminate all white space. More...
 
DDS_Boolean enum_as_int
 Choose whether to print enum values as integers or as strings. More...
 
DDS_Boolean include_root_elements
 Choose whether or not to include the root elements of the print format in the output string. More...
 

Detailed Description

A collection of attributes used to configure how data samples will be formatted when converted to a string.

To ensure that new objects are initialized to known values, assign them with the static initializer DDS_PrintFormatProperty_INITIALIZER.

See also
DDS_PrintFormatProperty_INITIALIZER
Examples:
HelloWorldPlugin.c.

Field Documentation

◆ kind

DDS_PrintFormatKind DDS_PrintFormatProperty::kind

The kind of format to be used when converting a data sample to a string.

Data samples can be represented in a default, XML, or JSON format.

See also
DDS_PrintFormatKind

[default] DDS_DEFAULT_PRINT_FORMAT

◆ pretty_print

DDS_Boolean DDS_PrintFormatProperty::pretty_print

Choose whether to print a data sample in a more readable format or to eliminate all white space.

A value of DDS_BOOLEAN_TRUE will add indentation and newlines to the string representation of the data sample making it more readable. For example:

<FooType>
<myLong>5</myLong>
</FooType>

A value of DDS_BOOLEAN_FALSE will cause all white space in the string representation of the data sample to be eliminated. For example:

<FooType><myLong>5</myLong></FooType>

[default] DDS_BOOLEAN_TRUE

◆ enum_as_int

DDS_Boolean DDS_PrintFormatProperty::enum_as_int

Choose whether to print enum values as integers or as strings.

A value of DDS_BOOLEAN_TRUE will cause enumeration literals to be printed using their integer value. For example:

<FooType>
<myEnum>5</myEnum>
</FooType>

A value of DDS_BOOLEAN_FALSE will cause enumeration literals to be printed as strings using their member names. For example:

<FooType>
<myEnum>RED</myEnum>
</FooType>

[default] DDS_BOOLEAN_FALSE

◆ include_root_elements

DDS_Boolean DDS_PrintFormatProperty::include_root_elements

Choose whether or not to include the root elements of the print format in the output string.

This field only applies if the DDS_PrintFormatProperty::kind is DDS_XML_PRINT_FORMAT or DDS_JSON_PRINT_FORMAT

If the value is DDS_BOOLEAN_TRUE and the kind is DDS_XML_PRINT_FORMAT then a top-level tag with the type's name in it will be included in the output. For example:

<FooType>
<myLong>5</myLong>
</FooType>

If the value is DDS_BOOLEAN_TRUE and the kind is DDS_JSON_PRINT_FORMAT then top-level opening and closing braces will be included in the output. For example:

{
"myLong":5
}

If the value is DDS_BOOLEAN_FALSE the elements described above will not be included in the output. For example:

<myLong>5</myLong>
"myLong":5

[default] DDS_BOOLEAN_TRUE