Skip to content
Marc edited this page Jun 15, 2019 · 14 revisions

Cereal is a header-only serialization library written in C++ and C# by raresica1234 and marcizhu based on TheCherno's serialization library for Java.

The library was done in less than a week, and it was really simple to make because raresica1234 had tried to make a serialization library before. marcizhu had also tried to make one to serialize game data into files, but both failed. After some weeks, we decided to team up and port TheCherno's idea to C++ with a few improvements. For example, the original library only allowed a database per file, which is okay, but we thought that you may need more than one, so after a bit of thinking we made Headers.

This library was originally made for C++, but we needed to serialize data from C#, and we also needed that data to be compatible with the C++ version of Cereal, so we decided to port Cereal to C# too.
Right now both versions are supported, and there are no bugs in any version, although the C# version still needs some testing.

We recommend you to wait until the next release before using the C# version. If you decide to start using the C# version for your projects we would like to get some feedback about it.

Changelog

1.2.1 (02/02/2019)

  • Fixed template specialization on Linux (Thanks, @raresica1234!)
  • Fixed minor bug in Buffer.h
  • Fixed CRC32 calculation error. Now the CRC checksum is compatible with the C# port of the library
  • Fixed int64 and double deserialization bug in Buffer.h
  • Added randomization to tests
  • Added CircleCI for continuous integration & automatic unit testing
  • Replaced sandbox program with individual tests for each section of the library
  • Added Google Test for unit testing purposes
  • Fixed 'tautological compare' warning. Now the library will check for overflows properly
  • Fixed vector data reallocation in Array::getArray()
  • Changed std::string with const std::string& when possible to avoid unnecessary string copying
  • Added functions to copy arbitrary data from buffers
  • Deleted copy constructors for all classes to prevent double memory deletion bugs
  • Added functions to delete Fields and Arrays from Objects, Objects from Databases, and Databases from Headers

1.2.0 (02/07/2017)

  • Created C# port (available here)
  • Fixed reading and writing for floats and doubles in Buffer.h
  • Fixed maximum array item count
  • Fixed maximum database size
  • Fixed compilation warnings
  • Fixed minor bugs in class Buffer
  • Replaced most assert with standard C++ exceptions
  • Removed Windows-only functions
  • Added unit testing framework
  • Added more than 4.000 tests to Sandbox
  • Added databases version 2.0. More details on that here.
  • Added GCC (and Linux/Mac) support
  • Added x64 support
  • Improved array writing speed
  • Improved string array reading speed
  • Improved database writing speed
  • IMPORTANT: This update fixes several bugs, as well as adding new features and better performance. We recommend updating to this version as soon as possible.
  • NOTE: This update is fully backwards-compatible.

1.1.0 (09/12/2016)

  • Added std::string arrays.
  • NOTE: This update is backwards-compatible: This version can be used to read serialized files with older versions, but previous versions may crash when reading files that have std::string arrays.

1.0.0 (22/10/2016)

  • First release of the library

Links