Loading...
Searching...
No Matches
juce::StrictVariantConverter< Type > Struct Template Reference

Detailed Description

template<typename Type>
struct juce::StrictVariantConverter< Type >

A helper type that can be used to implement specialisations of VariantConverter that use FromVar::convert and ToVar::convert internally.

If you've already implemented SerialisationTraits for a specific type, and don't want to write a custom VariantConverter that duplicates that implementation, you can instead write:

template <>
struct juce::VariantConverter<MyType> : public juce::StrictVariantConverter<MyType> {};
A helper type that can be used to implement specialisations of VariantConverter that use FromVar::con...
Definition juce_JSONSerialisation.h:526
This template-overloaded class can be used to convert between var and custom types.
Definition juce_JSONSerialisation.h:490

Static Public Member Functions

static Type fromVar (const var &v)
static var toVar (const Type &t)

Member Functions

◆ fromVar()

template<typename Type>
Type juce::StrictVariantConverter< Type >::fromVar ( const var & v)
static

◆ toVar()

template<typename Type>
var juce::StrictVariantConverter< Type >::toVar ( const Type & t)
static

References juce::ToVar::convert(), and jassert.

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