https://github.com/xdbr/cpp-generic-serialize
C++11 Header-only generic binary-serialization for arbitrary types (and nested containers)
https://github.com/xdbr/cpp-generic-serialize
Last synced: 17 days ago
JSON representation
C++11 Header-only generic binary-serialization for arbitrary types (and nested containers)
- Host: GitHub
- URL: https://github.com/xdbr/cpp-generic-serialize
- Owner: xdbr
- Created: 2013-06-12T12:38:10.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-02-15T11:39:51.000Z (over 8 years ago)
- Last Synced: 2024-11-14T21:38:07.531Z (6 months ago)
- Language: C++
- Homepage:
- Size: 15.6 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeCppGameDev - cpp-generic-serialize - only generic binary-serialization for arbitrary types (and nested containers) (C++)
README
cpp-generic-serialize
=====================C++11 Header-only generic binary-serialization for arbriray types (and nested containers)
Description
-----------Header-only library to ease binary serialization.
Examples
--------Essentially, these lines should sum up the purpose of this library:
// open ofstream as binary ...
// save arbitraty container or fundamental type to it:
list>> foobar;
save(ofstream_binary, foobar);
// a little later... load the container back in:
auto barbaz = load< list>> >( ifstream_binary );See the test cases for more examples.
Usage
-----* `include` the header file
* Compile your executable/library with `-std=c++11`
* (this is a C++11-only header, making heavy use of template meta-programming and C++11-type_traits)Tests
-----Run `rake clobber; rake`
References
----------A lot of inspiration (and a mediocre-sized bit of code) was taken from http://flamingdangerzone.com/. This is an absolutely worth reading, and very enlightening. Great work!
License
-------WTFPL