Skip to content

msgpack-cpp is a tiny, header-only C++11 library providing MsgPack serialization and deserialization

License

Notifications You must be signed in to change notification settings

scanban/msgpack-cpp

Repository files navigation

Build Status

What is msgpack-cpp ?

msgpack-cpp is a tiny, headers-only MsgPack library for C++11, providing MsgPack parsing and serialization.

Main goals are simplicity and performance.

Installation

git clone https://github.com/scanban/msgpack-cpp
mkdir build
cd build
cmake ..
make && make install

Examples

simple

msgpack::packer p;
p << 10 << 20 << 30 << "test"
msgpack::unpacker u { p.get_buffer() };
int i1, i2, i3;
string s;
u >> i1 >> i2 >> i3 >> s;

array

packer p;
vector<int8_t> v_in{ 1, 2, 3, 4, -5 };
p << v_in;

unpacker u{ p.get_buffer() };
vector<int8_t> v_out;
u >> v_out;

map

packer p;
map<int, int> m = {{ 1, 10 },
                   { 2, 20 },
                   { 3, 30 }};

p << m;

unpacker u{ p.get_buffer() };
map<int, int> m_out;
u >> m_out;

Supported features

  • serialization and deserialization of integers, floats, doubles and strings.
  • serialization and deserialization of arrays of integers, floats, doubles and strings.
  • serialization and deserialization of maps of integers, floats, doubles and strings.

Unsupported features

  • external data

License

This software is released under the MIT License, see LICENSE

About

msgpack-cpp is a tiny, header-only C++11 library providing MsgPack serialization and deserialization

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published