Gin
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
MessagePack Class Reference

Converts between MessagePack binary format and juce::var. More...

#include <gin_messagepack.h>

Static Public Member Functions

static juce::MemoryBlock toMessagePack (const juce::var &obj)
 Converts a juce::var to MessagePack binary format.
 
static juce::var parse (const juce::MemoryBlock &data)
 Parses MessagePack binary data into a juce::var.
 

Detailed Description

Converts between MessagePack binary format and juce::var.

MessagePack is an efficient binary serialization format that's more compact than JSON. This class provides bidirectional conversion between MessagePack data and JUCE's var type.

Limitations due to juce::var constraints:

See also
toMessagePack, parse

Member Function Documentation

◆ toMessagePack()

static juce::MemoryBlock MessagePack::toMessagePack ( const juce::var &  obj)
static

Converts a juce::var to MessagePack binary format.

Serializes a var (and any nested structures) into MessagePack binary format. The var can contain primitives, arrays, and objects which will be encoded appropriately.

Parameters
objThe var to serialize
Returns
A MemoryBlock containing the MessagePack-encoded data

◆ parse()

static juce::var MessagePack::parse ( const juce::MemoryBlock &  data)
static

Parses MessagePack binary data into a juce::var.

Deserializes MessagePack binary data back into a var structure. Arrays become var arrays, objects become DynamicObjects, and primitives are converted to appropriate var types.

Parameters
dataThe MemoryBlock containing MessagePack-encoded data
Returns
The deserialized var structure

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