cereal serializes C++ data types to and from binary, XML, or JSON with no external dependencies.
Overview
cereal is a header-only C++11 library for serialization. It takes arbitrary data types and turns them into compact binary encodings, XML, or JSON, and can load them back again.
The library is designed to stay lightweight and easy to extend. You add the headers to your project, write serialization functions for custom types or rely on built-in support for standard library types, then use archive classes to save and load data.
Online documentation covers installation and usage. A mailing list is available for questions. cereal uses a BSD license.
A separate Haskell library also uses the name cereal; that project is unrelated.
Key features
- Binary XML and JSON archives
- Header-only distribution
- Standard library type support
- Custom type serialization hooks
- No external dependencies
- Documented on project website
- BSD licensed
- Mailing list for support
Use cases
- Persisting C++ structs to disk
- Network message encoding in C++
- Configuration save and load
- Interchange via JSON or XML