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

Options that control conversion from arbitrary types to juce::var. More...

#include <juce_JSONSerialisation.h>

Collaboration diagram for juce::ToVarOptions:

Public Member Functions

auto getExplicitVersion () const
 
auto getVersionIncluded () const
 
ToVarOptions withExplicitVersion (std::optional< int > x) const
 By default, conversion will serialise the type using the marshallingVersion defined for that type.
 
ToVarOptions withVersionIncluded (bool x) const
 By default, conversion will include version information for any type with a non-null marshallingVersion.
 

Private Attributes

std::optional< std::optional< int > > explicitVersion
 
bool versionIncluded = true
 

Detailed Description

Options that control conversion from arbitrary types to juce::var.

See also
ToVar

@tags{Core}

Member Function Documentation

◆ getExplicitVersion()

auto juce::ToVarOptions::getExplicitVersion ( ) const
inline

◆ getVersionIncluded()

auto juce::ToVarOptions::getVersionIncluded ( ) const
inline

◆ withExplicitVersion()

ToVarOptions juce::ToVarOptions::withExplicitVersion ( std::optional< int >  x) const
inline

By default, conversion will serialise the type using the marshallingVersion defined for that type.

Setting an explicit version allows the type to be serialised as an earlier version.

References explicitVersion, and juce::withMember().

◆ withVersionIncluded()

ToVarOptions juce::ToVarOptions::withVersionIncluded ( bool  x) const
inline

By default, conversion will include version information for any type with a non-null marshallingVersion.

Setting versionIncluded to false will cause the version info to be omitted, which is useful in situations where the version information is not needed (e.g. when presenting transient information to the user, rather than writing data to disk that must be deserialised in the future).

References versionIncluded, and juce::withMember().

Referenced by juce::ToVar::Visitor::convert().

Member Data Documentation

◆ explicitVersion

std::optional<std::optional<int> > juce::ToVarOptions::explicitVersion
private

◆ versionIncluded

bool juce::ToVarOptions::versionIncluded = true
private

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