Loading...
Searching...
No Matches
juce::JSON::FormatOptions Class Reference

Detailed Description

Allows formatting var objects as JSON with various configurable options.

Public Member Functions

FormatOptions withSpacing (Spacing x) const
 Returns a copy of this Formatter with the specified spacing.
FormatOptions withMaxDecimalPlaces (int x) const
 Returns a copy of this Formatter with the specified maximum number of decimal places.
FormatOptions withIndentLevel (int x) const
 Returns a copy of this Formatter with the specified indent level.
FormatOptions withEncoding (Encoding x) const
 Returns a copy of this Formatter with the specified encoding.
Spacing getSpacing () const
 Returns the spacing used by this Formatter.
int getMaxDecimalPlaces () const
 Returns the maximum number of decimal places used by this Formatter.
int getIndentLevel () const
 Returns the indent level of this Formatter.
Encoding getEncoding () const
 Returns the encoding of this Formatter.

Member Functions

◆ withSpacing()

FormatOptions juce::JSON::FormatOptions::withSpacing ( Spacing x) const

Returns a copy of this Formatter with the specified spacing.

References juce::withMember(), and x.

Referenced by juce::midi_ci::Encodings::jsonTo7BitText().

◆ withMaxDecimalPlaces()

FormatOptions juce::JSON::FormatOptions::withMaxDecimalPlaces ( int x) const

Returns a copy of this Formatter with the specified maximum number of decimal places.

This option determines the precision of floating point numbers in scientific notation.

References juce::withMember(), and x.

◆ withIndentLevel()

FormatOptions juce::JSON::FormatOptions::withIndentLevel ( int x) const

Returns a copy of this Formatter with the specified indent level.

This should only be necessary when serialising multiline nested types.

References juce::withMember(), and x.

◆ withEncoding()

FormatOptions juce::JSON::FormatOptions::withEncoding ( Encoding x) const

Returns a copy of this Formatter with the specified encoding.

Use this to force a JSON to be ASCII characters only.

References juce::withMember(), and x.

◆ getSpacing()

Spacing juce::JSON::FormatOptions::getSpacing ( ) const

Returns the spacing used by this Formatter.

◆ getMaxDecimalPlaces()

int juce::JSON::FormatOptions::getMaxDecimalPlaces ( ) const

Returns the maximum number of decimal places used by this Formatter.

◆ getIndentLevel()

int juce::JSON::FormatOptions::getIndentLevel ( ) const

Returns the indent level of this Formatter.

◆ getEncoding()

Encoding juce::JSON::FormatOptions::getEncoding ( ) const

Returns the encoding of this Formatter.

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram