msgpack23 is a tiny MsgPack library for C++23, providing MsgPack parsing and serialization.
This library is forked from msgpack11 to use C++23 features.
-
Using CMake
git clone git@github.com:ar90n/msgpack23.git mkdir build cd build cmake .. make && make install
MsgPack my_msgpack = MsgPack::object {
{ "key1", "value1" },
{ "key2", false },
{ "key3", MsgPack::array { 1, 2, 3 } },
};
//access to elements
std::cout << my_msgpack["key1"].string_value();
//serialize
std::string msgpack_bytes = my_msgpack.dump();
//deserialize
std::string err;
MsgPack des_msgpack = MsgPack::parse(msgpack_bytes, err);
There are more specific examples in example.cpp. Please see it.
- Support serialization and deserialization.
This software is released under the MIT License, see LICENSE.txt.