Skip to content

cnsuhao/serine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serine

A lightweight (STL-only), header-only C++11, free and open source bidirectional serialization system.

Loosely based on Cereal's code syntax.

Features

  • Supports 2 serialization paradigms:
    • named data entries (e.g. for XML, JSON, BSON, MsgPack...)
    • unnamed, linearly wrote/read data (tight packing)
  • Different (de)serialization backends through inheritance and virtual methods.
  • No templating of the serialization methods.
  • Fully harnessing C++11's power to only do a single data copy/read/write per operation, nullifying potential run-time object copying overhead.
  • Flexible lightweight data container wrappers (forward iterators) to allow for (de)serialization of arrays, vectors, linked lists and more, regardless of their actual implementation. (A default STL-compatible container wrapper is available through serine::contain_stl())

Extending

As to avoid templating, adding new non-struct/class type handling to an Archiver is not directly possible. This can however be worked around by creating your own serine::Archiver-inheriting base or real class, extend it to allow your new types [in/out]takes, as well as making your own serine::Serializable-like interface, madating a serialize() method taking your new serializer as parameter.

Limitations

  • As Serine's syntax is both bidirectional and named, (de)serialization must both be statically ordered and entry-named. This as well refrains you to bulk serialize data in the same fashion Cereal allows for.
  • Serine is only supposed to be a serialization structure, not a fully fledged data loading/saving framework. As such, only basic memory/file-based serializers are available (as a default and reference implementation). Applications are supposed to supply their own format handlers.

Notes

No 16-bit character/string serialization is provided (by default). This is intended, as using 16-bit chars most likely implies the usage of UTF-16, which takes the worst parts of both UTF-8 and UTF-32 and turns it into a horrid hybrid encoding. Refer to utf8everywhere.org for more information.

About

A free and open bidirectional serialization system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.1%
  • CMake 3.9%