Yet Another Serialization
- YAS is created as a replacement of boost.serialization because of its insufficient speed of serialization (benchmark 1, benchmark 2)
- YAS is header only library
- YAS does not depend on third-party libraries or boost
- YAS require C 11 support
- YAS binary archives is endian independent
- binary
- text
- json (not fully comply)
- GCC : 4.8.5, ... - 32/64 bit
- MinGW: 4.8.5, ... - 32/64 bit
- Clang: 3.5, ... - 32/64 bit
- Intel: (untested)
- MSVC : 2017(in c 14 mode), ... - 32/64 bit
- Emscripten: 1.38 (clang version 6.0.1)
The easiest way to save and load some object or vars is to use the yas::save()
and yas::load()
functions like this:
#include <yas/serialize.hpp>
#include <yas/std_types.hpp>
int main() {
int a = 3, aa{};
short b = 4, bb{};
float c = 3.14, cc{};
constexpr std::size_t flags =
yas::mem // IO type
|yas::json; // IO format
auto buf = yas::save<flags>(
YAS_OBJECT("myobject", a, b, c)
);
// buf = {"a":3,"b":4,"c":3.14}
yas::load<flags>(buf,
YAS_OBJECT_NVP("myobject"
,("a", aa)
,("b", bb)
,("c", cc)
)
);
// a == aa && b == bb && c == cc;
}
The IO type can be one of yas::mem
or yas::file
.
The IO format can be one of yas::binary
or yas::text
or yas::json
.
The YAS_OBJECT()
/YAS_OBJECT_NVP()
/YAS_OBJECT_STRUCT()
/YAS_OBJECT_STRUCT_NVP()
macro are declared here, example use is here.
More examples you can see here.
- protobuf/messagepack support
- limits
- objects versioning
You can support the YAS project by donating:
- BTC: 12rjx6prAxwJ1Aep6HuM54At9wDvSCDbSJ
- ETH: 0x62719DDEc96C513699a276107622C73F6cAcec47
- std::array
- std::bitset
- std::chrono::duration
- std::chrono::time_point
- std::complex
- std::deque
- std::forward_list
- std::list
- std::map
- std::multimap
- std::multiset
- std::optional
- std::pair
- std::set
- std::string
- std::string_view
- std::tuple
- std::unordered_map
- std::unordered_multimap
- std::unordered_multiset
- std::unordered_set
- std::variant
- std::vector
- std::wstring
- boost::array
- boost::chrono::duration
- boost::chrono::time_point
- boost::optional
- boost::variant
- boost::container::deque
- boost::container::string
- boost::container::wstring
- boost::container::vector
- boost::container::static_vector
- boost::container::stable_vector
- boost::container::list
- boost::container::slist
- boost::container::map
- boost::container::multimap
- boost::container::set
- boost::container::multiset
- boost::container::flat_map
- boost::container::flat_multimap
- boost::container::flat_set
- boost::container::flat_multiset
- boost::unordered_map
- boost::unordered_multimap
- boost::unordered_set
- boost::unordered_multiset
- boost::fusion::pair
- boost::fusion::tuple
- boost::fusion::vector
- boost::fusion::list
- boost::fusion::map
- boost::fusion::set
- yas::intrusive_buffer
- yas::shared_buffer
- QByteArray
- QList
- QMap
- QString
- QStringList
- QVector
- Ufochain: a mimblewimble implementation of crypto currency using X17r algorithm
- Kvant: Kvant - is an original project using the consensus of MimbleWimble, due to which maximum anonymity and security were achieved
- zkPoD-lib: zkPoD-lib is the underlying core library for zkPoD system. It fully implements PoD (proof of delivery) protocol and also provides a CLI interface together with Golang bindings
- Litecash: Litecash is the next generation scalable, confidential cryptocurrency based on an elegant and innovative Mimblewimble protocol
- K3: K3 is a programming language for building large-scale data systems
- vistle: Software Environment for High-Performance Simulation and Parallel Visualization
- LGraph: Live Graph infrastructure for Synthesis and Simulation
- Beam: BEAM is a next generation scalable, confidential cryptocurrency based on an elegant and innovative Mimblewimble protocol
- libfon9: C 11 Cross-platform infrastructure for Order Management System
- iris-crypt: Store Node.js modules encrypted in a package file
- cppan: Class members annotations for C
- GeekSys company: GeekSys is using YAS to serialize features from images