Qore msgpack Module  1.0.0
MessagePack Functions

Modules

 MessagePack Constants
 

Functions

*binary msgpack::msgpack_pack (auto value, int mode=MSGPACK_SIMPLE_MODE)
 Packs passed Qore value. More...
 
auto msgpack::msgpack_unpack (binary value, int mode=MSGPACK_SIMPLE_MODE)
 Unpacks serialized MessagePack value. More...
 

Detailed Description

Function Documentation

◆ msgpack_pack()

*binary msgpack::msgpack_pack ( auto  value,
int  mode = MSGPACK_SIMPLE_MODE 
)

Packs passed Qore value.

Code Flags:
RET_VALUE_ONLY
Parameters
valuevalue to pack
modeoperation mode
Returns
packed value in MessagePack format
Exceptions
ENCODING-ERRORencoding error occured during packing
INVALID-MODEpassed operation mode is invalid
PACK-ERRORpacking failed
Example:
hash example = {"compact": True, "schema": 0};
*binary packed = msgpack_pack(example);

◆ msgpack_unpack()

auto msgpack::msgpack_unpack ( binary  value,
int  mode = MSGPACK_SIMPLE_MODE 
)

Unpacks serialized MessagePack value.

Code Flags:
RET_VALUE_ONLY
Parameters
valuevalue to unpack
modeoperation mode
Returns
unpacked Qore value
Exceptions
ENCODING-ERRORencoding error occured during unpacking
INVALID-MODEpassed operation mode is invalid
UNPACK-ERRORunpacking failed
Example:
hash example = {"compact": True, "schema": 0};
*binary packed = msgpack_pack(example);
# ---
auto unpacked = msgpack_unpack(packed);
msgpack::msgpack_pack
*binary msgpack_pack(auto value, int mode=MSGPACK_SIMPLE_MODE)
Packs passed Qore value.
msgpack::msgpack_unpack
auto msgpack_unpack(binary value, int mode=MSGPACK_SIMPLE_MODE)
Unpacks serialized MessagePack value.