JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::JSON::FormatOptions Class Reference

Allows formatting var objects as JSON with various configurable options. More...

#include <juce_JSON.h>

Collaboration diagram for juce::JSON::FormatOptions:

Public Member Functions

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

Private Attributes

Encoding encoding = Encoding::utf8
 
int indent = 0
 
int maxDecimalPlaces = 15
 
Spacing spacing = Spacing::multiLine
 

Detailed Description

Allows formatting var objects as JSON with various configurable options.

Member Function Documentation

◆ getEncoding()

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

Returns the encoding of this Formatter.

◆ getIndentLevel()

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

Returns the indent level of this Formatter.

◆ getMaxDecimalPlaces()

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

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

◆ getSpacing()

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

Returns the spacing used by this Formatter.

◆ withEncoding()

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

Returns a copy of this Formatter with the specified encoding.

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

References juce::withMember().

◆ withIndentLevel()

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

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

This should only be necessary when serialising multiline nested types.

References juce::withMember().

◆ withMaxDecimalPlaces()

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

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().

◆ withSpacing()

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

Returns a copy of this Formatter with the specified spacing.

References juce::withMember().

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

Member Data Documentation

◆ encoding

Encoding juce::JSON::FormatOptions::encoding = Encoding::utf8
private

◆ indent

int juce::JSON::FormatOptions::indent = 0
private

◆ maxDecimalPlaces

int juce::JSON::FormatOptions::maxDecimalPlaces = 15
private

◆ spacing

Spacing juce::JSON::FormatOptions::spacing = Spacing::multiLine
private

The documentation for this class was generated from the following file: