by apankrat · 7y ago · 0 comments
It has virtually no dependencies, requires no pre-processing (like ProtoBufs do) and it should be easy to understand and extend. It knows how to handle basic types and std containers and then uses a couple of C++ features to coerce the compiler into auto-generating all needed methods for custom types.
All you need to do is to specify which struct/class members must be serialized and then call store() on an instance to produce a blob. To restore an instance - feed the blob into parse() and that's it.
This was originally written to implement an IPC protocol for a pair of cooperating processes, but it can be readily reused for quickly storing data on disk and other things.
But being impossible to safely integrate into other projects because of illegal names and polluting the global namespace does.
This is at best a rough proof of concept which could at some point be turned into a library.