JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::StrictVariantConverter< Type > Struct Template Reference

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

#include <juce_JSONSerialisation.h>

Static Public Member Functions

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

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

@tags{Core}

Member Function Documentation

◆ fromVar()

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

References jassert.

◆ toVar()

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

References jassert.


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