JUCE: VariantConverter< Type > Struct Template Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
VariantConverter< Type > Struct Template Reference
juce_core » javascript

This template-overloaded class can be used to convert between var and custom types. 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 VariantConverter< Type >

This template-overloaded class can be used to convert between var and custom types.

If not specialised, the variant converter will attempt to use serialisation functions if they are detected for the given type. For details of what this entails, see the docs for SerialisationTraits.

In short, the constant 'marshallingVersion', and either the single function 'serialise()', or the function pair 'load()' and 'save()' must be defined for the type. These may be defined as public members of the type T itself, or as public members of juce::SerialisationTraits<T>, which is a specialisation of the SerialisationTraits template struct for the type T.

See also
  ToVar, FromVar

## Member Function Documentation

## ◆ fromVar()

template<typename Type >

static Type VariantConverter< Type >::fromVar | ( | const var & | v | ) |
| static

## ◆ toVar()

template<typename Type >

static var VariantConverter< Type >::toVar | ( | const Type & | t | ) |
| static

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

- juce_JSONSerialisation.h