├── .github
└── workflows
│ ├── ci-macos.yml
│ └── ci.yml
├── .gitignore
├── .travis.yml
├── CMakeLists.txt
├── Config.cmake.in
├── LICENSE
├── README.md
├── appveyor.yml
├── cereal.pc.in
├── doc
├── CMakeLists.txt
├── DoxygenLayout.xml
├── doxygen.in
├── footer.html
└── mainpage.dox
├── include
└── cereal
│ ├── access.hpp
│ ├── archives
│ ├── adapters.hpp
│ ├── binary.hpp
│ ├── json.hpp
│ ├── portable_binary.hpp
│ └── xml.hpp
│ ├── cereal.hpp
│ ├── details
│ ├── helpers.hpp
│ ├── polymorphic_impl.hpp
│ ├── polymorphic_impl_fwd.hpp
│ ├── static_object.hpp
│ ├── traits.hpp
│ └── util.hpp
│ ├── external
│ ├── LICENSE
│ ├── base64.hpp
│ ├── rapidjson
│ │ ├── LICENSE
│ │ ├── allocators.h
│ │ ├── cursorstreamwrapper.h
│ │ ├── document.h
│ │ ├── encodedstream.h
│ │ ├── encodings.h
│ │ ├── error
│ │ │ ├── en.h
│ │ │ └── error.h
│ │ ├── filereadstream.h
│ │ ├── filewritestream.h
│ │ ├── fwd.h
│ │ ├── internal
│ │ │ ├── biginteger.h
│ │ │ ├── diyfp.h
│ │ │ ├── dtoa.h
│ │ │ ├── ieee754.h
│ │ │ ├── itoa.h
│ │ │ ├── meta.h
│ │ │ ├── pow10.h
│ │ │ ├── regex.h
│ │ │ ├── stack.h
│ │ │ ├── strfunc.h
│ │ │ ├── strtod.h
│ │ │ └── swap.h
│ │ ├── istreamwrapper.h
│ │ ├── memorybuffer.h
│ │ ├── memorystream.h
│ │ ├── msinttypes
│ │ │ ├── LICENSE
│ │ │ ├── inttypes.h
│ │ │ └── stdint.h
│ │ ├── ostreamwrapper.h
│ │ ├── pointer.h
│ │ ├── prettywriter.h
│ │ ├── rapidjson.h
│ │ ├── reader.h
│ │ ├── schema.h
│ │ ├── stream.h
│ │ ├── stringbuffer.h
│ │ └── writer.h
│ └── rapidxml
│ │ ├── license.txt
│ │ ├── manual.html
│ │ ├── rapidxml.hpp
│ │ ├── rapidxml_iterators.hpp
│ │ ├── rapidxml_print.hpp
│ │ └── rapidxml_utils.hpp
│ ├── macros.hpp
│ ├── specialize.hpp
│ ├── types
│ ├── array.hpp
│ ├── atomic.hpp
│ ├── base_class.hpp
│ ├── bitset.hpp
│ ├── boost_variant.hpp
│ ├── chrono.hpp
│ ├── common.hpp
│ ├── complex.hpp
│ ├── concepts
│ │ └── pair_associative_container.hpp
│ ├── deque.hpp
│ ├── forward_list.hpp
│ ├── functional.hpp
│ ├── list.hpp
│ ├── map.hpp
│ ├── memory.hpp
│ ├── optional.hpp
│ ├── polymorphic.hpp
│ ├── queue.hpp
│ ├── set.hpp
│ ├── stack.hpp
│ ├── string.hpp
│ ├── tuple.hpp
│ ├── unordered_map.hpp
│ ├── unordered_set.hpp
│ ├── utility.hpp
│ ├── valarray.hpp
│ ├── variant.hpp
│ └── vector.hpp
│ └── version.hpp
├── sandbox
├── CMakeLists.txt
├── performance.cpp
├── sandbox.cpp
├── sandbox_json.cpp
├── sandbox_rtti.cpp
├── sandbox_shared_lib
│ ├── CMakeLists.txt
│ ├── base.cpp
│ ├── base.hpp
│ ├── derived.cpp
│ └── derived.hpp
└── sandbox_vs.cpp
├── scripts
├── add_rapidjson_prefix.sh
├── appveyor.bat
├── renameincludes.sh
├── updatecoverage.sh
└── updatedoc.in
└── unittests
├── CMakeLists.txt
├── array.cpp
├── array.hpp
├── atomic.cpp
├── atomic.hpp
├── basic_string.cpp
├── basic_string.hpp
├── bitset.cpp
├── bitset.hpp
├── boost
├── CMakeLists.txt
├── boost_variant.cpp
└── boost_variant.hpp
├── chrono.cpp
├── chrono.hpp
├── cmake-config-module.cmake
├── common.hpp
├── complex.cpp
├── complex.hpp
├── cpp17
├── CMakeLists.txt
├── optional.cpp
├── optional.hpp
├── variant.cpp
└── variant.hpp
├── defer.cpp
├── defer.hpp
├── deque.cpp
├── deque.hpp
├── doctest.h
├── forward_list.cpp
├── forward_list.hpp
├── list.cpp
├── list.hpp
├── load_construct.cpp
├── load_construct.hpp
├── map.cpp
├── map.hpp
├── memory.cpp
├── memory.hpp
├── memory_cycles.cpp
├── memory_cycles.hpp
├── multimap.cpp
├── multimap.hpp
├── multiset.cpp
├── multiset.hpp
├── pair.cpp
├── pair.hpp
├── pod.cpp
├── pod.hpp
├── polymorphic.cpp
├── polymorphic.hpp
├── portability_test.cpp
├── portable_binary_archive.cpp
├── portable_binary_archive.hpp
├── priority_queue.cpp
├── priority_queue.hpp
├── queue.cpp
├── queue.hpp
├── run_portability_test.cmake
├── run_valgrind.sh
├── set.cpp
├── set.hpp
├── stack.cpp
├── stack.hpp
├── structs.cpp
├── structs.hpp
├── structs_minimal.cpp
├── structs_minimal.hpp
├── structs_specialized.cpp
├── structs_specialized.hpp
├── tuple.cpp
├── tuple.hpp
├── unordered_loads.cpp
├── unordered_loads.hpp
├── unordered_map.cpp
├── unordered_map.hpp
├── unordered_multimap.cpp
├── unordered_multimap.hpp
├── unordered_multiset.cpp
├── unordered_multiset.hpp
├── unordered_set.cpp
├── unordered_set.hpp
├── user_data_adapters.cpp
├── user_data_adapters.hpp
├── valarray.cpp
├── valarray.hpp
├── vector.cpp
├── vector.hpp
├── versioning.cpp
└── versioning.hpp
/.github/workflows/ci-macos.yml:
--------------------------------------------------------------------------------
1 | name: cereal mac ci
2 | on: [push, pull_request]
3 |
4 | jobs:
5 | test_cereal_macos:
6 | runs-on: macos-latest
7 | strategy:
8 | fail-fast: false
9 | matrix:
10 | include:
11 | - CMAKE_OPTIONS: '-DWITH_WERROR=OFF -DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
12 | COMPILER: 'clang++'
13 | XCODE_VERSION: 15
14 | NAME: macos-latest-clang-xcode15
15 |
16 | - CMAKE_OPTIONS: '-DWITH_WERROR=OFF -DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
17 | COMPILER: 'clang++'
18 | XCODE_VERSION: 16
19 | NAME: macos-latest-clang-xcode16
20 | name: ${{ matrix.name }}
21 |
22 | steps:
23 | - name: Checkout code
24 | uses: actions/checkout@v4
25 |
26 | - uses: maxim-lobanov/setup-xcode@v1
27 | with:
28 | xcode-version: ${{ matrix.XCODE_VERSION }}
29 |
30 | - name: build and test
31 | shell: bash
32 | env:
33 | CMAKE_OPTIONS: ${{ matrix.CMAKE_OPTIONS }}
34 | COMPILER: ${{ matrix.COMPILER }}
35 | run: |
36 | set -ex
37 | # Set compiler and env variables
38 | export CXX=${COMPILER}
39 | ${CXX} --version
40 |
41 | # Build cereal and test
42 | cmake --version
43 | mkdir build && cd build
44 | cmake ${CMAKE_OPTIONS} .. && make -j4 VERBOSE=1
45 | ctest . --output-on-failure
46 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 |
6 | # Compiled Dynamic libraries
7 | *.so
8 | *.dylib
9 |
10 | # Compiled Static libraries
11 | *.lai
12 | *.la
13 | *.a
14 |
15 | # Visual studio cruft
16 | *.opensdf
17 | *.sdf
18 | *.suo
19 | *.user
20 | */x64
21 | *\Debug*
22 | *\Release*
23 | *.log
24 | *.tlog*
25 | *.obj
26 | *.VC.db
27 | *.VC.VC.opendb
28 | *.pdb
29 | *.idb
30 | *\build_*
31 | .vs/
32 | CMakeSettings.json
33 |
34 | # misc files mostly used for testing
35 | out.txt
36 | ptr.txt
37 | test.txt
38 | boost_serialize
39 | arr.txt
40 | performance
41 | include_renamed
42 | .ycm_extra_conf.py*
43 | doc/html
44 | rtti.txt
45 | doc/latex
46 | portability64
47 | portability32
48 | file.json
49 | out.xml
50 | cereal_version.out
51 | xml_ordering.out
52 | build
53 | /out/
--------------------------------------------------------------------------------
/Config.cmake.in:
--------------------------------------------------------------------------------
1 | @PACKAGE_INIT@
2 |
3 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2022, Randolph Voorhies, Shane Grant
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | * Neither the name of the copyright holder nor the
12 | names of its contributors may be used to endorse or promote products
13 | derived from this software without specific prior written permission.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | cereal - A C++11 library for serialization
2 | ==========================================
3 |
4 |
cereal is a header-only C++11 serialization library. cereal takes arbitrary data types and reversibly turns them into different representations, such as compact binary encodings, XML, or JSON. cereal was designed to be fast, light-weight, and easy to extend - it has no external dependencies and can be easily bundled with other code or used standalone.
5 | 6 | ### cereal has great documentation 7 | 8 | Looking for more information on how cereal works and its documentation? Visit [cereal's web page](https://USCiLab.github.io/cereal) to get the latest information. 9 | 10 | ### cereal is easy to use 11 | 12 | Installation and use of of cereal is fully documented on the [main web page](https://USCiLab.github.io/cereal), but this is a quick and dirty version: 13 | 14 | * Download cereal and place the headers somewhere your code can see them 15 | * Write serialization functions for your custom types or use the built in support for the standard library cereal provides 16 | * Use the serialization archives to load and save data 17 | 18 | ```cpp 19 | #include