RTI Connext .Net APIs  Version 6.0.0
DDS::PrintFormatProperty Class Reference

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

#include <managed_topic.h>

Public Attributes

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

Properties

System::Boolean pretty_print [get, set]
 Choose whether to print a data sample in a more readable format or to eliminate all white space. More...
 
System::Boolean enum_as_int [get, set]
 Choose whether to print enum values as integers or as strings. More...
 
System::Boolean include_root_elements [get, set]
 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.

Examples:
HelloWorldSupport.cpp.

Member Data Documentation

◆ kind

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
PrintFormatKind

[default] PrintFormatKind::DEFAULT_PRINT_FORMAT

Property Documentation

◆ pretty_print

System:: Boolean DDS::PrintFormatProperty::pretty_print
getset

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

A value of 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 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] true

◆ enum_as_int

System:: Boolean DDS::PrintFormatProperty::enum_as_int
getset

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

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

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

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

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

[default] false

◆ include_root_elements

System:: Boolean DDS::PrintFormatProperty::include_root_elements
getset

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 PrintFormatKind::XML_PRINT_FORMAT or PrintFormatKind::JSON_PRINT_FORMAT

If the value is true and the kind is PrintFormatKind::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 true and the kind is PrintFormatKind::JSON_PRINT_FORMAT then top-level opening and closing braces will be included in the output. For example:

{
"myLong":5
}

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

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

[default] true


RTI Connext .Net APIs Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc