Options for performing JSON encoding. EncodingStyle is either COMPACT or PRETTY. If EncodingStyle is COMPACT, no whitespace will be added between elements. If encoding style is PRETTY, then the InitialIndentLevel and SpacesPerLevel parameters are used to specify the formatting of the output. Note that InitialIndentLevel and SpacesPerLevel are ignored when EncodingStyle is COMPACT (this is the default). The EncodeEmptyArrays and EncodeNullElements encode empty array and null elements respectively. By default empty array and null elements are not encoded. The EncodeInfAndNaNAsStrings attribute provides users the option to encode Infinity and NaN floating point values as strings. These values do not have a valid JSON representation and by default such value will result in an encoding error. The DatetimeFractionalSecondPrecision specifies the precision of milliseconds printed with date time values. By default a precision of 3 decimal places is used. The MaxFloatPrecision and MaxDoublePrecision attributes allow specifying the maximum precision for float and double values. When not specified, or 0 is specified, the precision is determined automatically to use enough digits to ensure restoring the original binary floating point value by a reader. We recommend against setting these options: they were provided prior to the current default behavior (of choosing the shortest presentation that can be restored to the original value) being available.
Synopsis
Declared in <baljsn_encoderoptions.h>
class EncoderOptions;
Enums
Name |
Description |
Attribute identifier constants. |
|
Attribute count constants. |
|
Attribute index constants. |
|
This |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Assign to this object the value of the specified |
|
|
|
Invoke the specified |
|
Return a reference to the non‐modifiable "DatetimeFractionalSecondPrecision" attribute of this object. |
|
Return the value of the "EncodeAnonSequenceInChoice" attribute of this object. |
|
Return a reference to the non‐modifiable "EncodeEmptyArrays" attribute of this object. Note that empty arrays occurring as selections of choices are always encoded regardless of the setting of this option. |
|
Return a reference to the non‐modifiable "EncodeInfAndNaNAsStrings" attribute of this object. |
|
Return a reference to the non‐modifiable "EncodeNullElements" attribute of this object. |
|
Return the value of the "EncodeQuotedDecimal64" attribute of this object. |
|
Return a reference to the non‐modifiable "EncodingStyle" attribute of this object. |
|
Return the value of the "EscapeForwardSlash" attribute of this object. |
|
Return a reference to the non‐modifiable "InitialIndentLevel" attribute of this object. |
|
|
|
Invoke the specified |
|
Return a reference to the non‐modifiable "MaxDoublePrecision" attribute of this object. |
|
Return a reference to the non‐modifiable "MaxFloatPrecision" attribute of this object. |
|
Format this object to the specified output |
|
Reset this object to the default value (i.e., its value upon default construction). |
|
Set the "DatetimeFractionalSecondPrecision" attribute of this object to the specified |
|
Set the "EncodeAnonSequenceInChoice" attribute of this object to the specified |
|
Set the "EncodeEmptyArrays" attribute of this object to the specified |
|
Set the "EncodeInfAndNaNAsStrings" attribute of this object to the specified |
|
Set the "EncodeNullElements" attribute of this object to the specified |
|
Set the "EncodeQuotedDecimal64" attribute of this object to the specified |
|
|
|
Set the "EscapeForwardSlash" attribute of this object to the specified |
|
Set the "InitialIndentLevel" attribute of this object to the specified |
|
Set the "MaxDoublePrecision" attribute of this object to the specified |
|
Set the "MaxFloatPrecision" attribute of this object to the specified |
|
Set the "SpacesPerLevel" attribute of this object to the specified |
|
Return a reference to the non‐modifiable "SpacesPerLevel" attribute of this object. |
Static Member Functions
Name |
Description |
|
Static Data Members
Name |
Description |
Attribute metadata for this options type. |
|
Name of this class. |
|
|
Default value for the |
|
Default value for the |
|
Default value for the |
Default value for the |
|
|
Default value for the |
|
Default value for the |
Default value for the |
|
|
Default value for the |
|
Default value for the |
|
Default value for the |
|
Default value for the |
|
Default value for the |
Non-Member Functions
Name |
Description |
Return |
|
Return |
Created with MrDocs