├── .github └── workflows │ └── ci.yml ├── README.md ├── examples ├── asis │ ├── asis.pro │ └── main.cpp ├── base_object │ ├── base_object.pro │ └── main.cpp ├── init │ ├── init.pro │ └── main.cpp ├── nested │ ├── main.cpp │ └── nested.pro ├── one_func │ ├── main.cpp │ └── one_func.pro ├── one_func_cond │ ├── main.cpp │ └── one_func_cond.pro ├── one_func_cond2 │ ├── main.cpp │ └── one_func_cond2.pro ├── one_memfn │ ├── main.cpp │ └── one_memfn.pro ├── raw_array │ ├── main.cpp │ └── raw_array.pro ├── serialization │ ├── main.cpp │ └── serialization.pro ├── split_func │ ├── main.cpp │ └── split_func.pro ├── split_memfn │ ├── main.cpp │ └── split_memfn.pro ├── streams │ ├── main.cpp │ └── streams.pro ├── traits-ex │ ├── main.cpp │ └── traits-ex.pro ├── traits │ ├── main.cpp │ └── traits.pro └── xor-stream │ ├── main.cpp │ └── xor-stream.pro ├── include └── yas │ ├── abseil_types.hpp │ ├── binary_iarchive.hpp │ ├── binary_oarchive.hpp │ ├── boost_types.hpp │ ├── buffers.hpp │ ├── count_streams.hpp │ ├── defaul_traits.hpp │ ├── detail │ ├── config │ │ ├── compiler │ │ │ ├── clang.hpp │ │ │ ├── gcc.hpp │ │ │ ├── intel.hpp │ │ │ └── msvc.hpp │ │ ├── config.hpp │ │ └── endian.hpp │ ├── io │ │ ├── binary_streams.hpp │ │ ├── endian_conv.hpp │ │ ├── exception_base.hpp │ │ ├── header.hpp │ │ ├── io_exceptions.hpp │ │ ├── json_streams.hpp │ │ ├── serialization_exceptions.hpp │ │ └── text_streams.hpp │ ├── preprocessor │ │ ├── auto_rec.hpp │ │ ├── bitand.hpp │ │ ├── bool.hpp │ │ ├── cat.hpp │ │ ├── comma.hpp │ │ ├── comma_if.hpp │ │ ├── compl.hpp │ │ ├── config.hpp │ │ ├── dec.hpp │ │ ├── empty.hpp │ │ ├── enum_params.hpp │ │ ├── equal.hpp │ │ ├── error.hpp │ │ ├── expr_if.hpp │ │ ├── expr_iif.hpp │ │ ├── if.hpp │ │ ├── iif.hpp │ │ ├── inc.hpp │ │ ├── not_equal.hpp │ │ ├── overload.hpp │ │ ├── preprocessor.hpp │ │ ├── rep_for.hpp │ │ ├── rep_for_impl.hpp │ │ ├── rep_for_impl_dmc.hpp │ │ ├── rep_for_impl_edg.hpp │ │ ├── rep_for_impl_msvc.hpp │ │ ├── repeat.hpp │ │ ├── seq_elem.hpp │ │ ├── seq_for_each.hpp │ │ ├── seq_for_each_i.hpp │ │ ├── seq_seq.hpp │ │ ├── seq_size.hpp │ │ ├── stringize.hpp │ │ ├── tuple_eat.hpp │ │ ├── tuple_elem.hpp │ │ ├── tuple_rem.hpp │ │ ├── tuple_size.hpp │ │ ├── tuple_to_seq.hpp │ │ ├── variadic_elem.hpp │ │ └── variadic_size.hpp │ ├── tools │ │ ├── base64.hpp │ │ ├── base_object.hpp │ │ ├── cast.hpp │ │ ├── ctmap.hpp │ │ ├── ctsort.hpp │ │ ├── fnv1a.hpp │ │ ├── json_tools.hpp │ │ ├── limit.hpp │ │ ├── limit_exceptions.hpp │ │ ├── noncopyable.hpp │ │ ├── rapidjson_dtoa.hpp │ │ ├── save_load_string.hpp │ │ ├── tuple_element_name.hpp │ │ ├── tuple_element_switch.hpp │ │ └── utf8conv.hpp │ └── type_traits │ │ ├── flags.hpp │ │ ├── has_function_serialize.hpp │ │ ├── has_memfn_serialize.hpp │ │ ├── serializer.hpp │ │ ├── type_traits.hpp │ │ └── typeinfo.hpp │ ├── file_streams.hpp │ ├── get_archive.hpp │ ├── json_iarchive.hpp │ ├── json_oarchive.hpp │ ├── mem_streams.hpp │ ├── null_streams.hpp │ ├── object.hpp │ ├── qt_types.hpp │ ├── serialize.hpp │ ├── std_streams.hpp │ ├── std_traits.hpp │ ├── std_types.hpp │ ├── text_iarchive.hpp │ ├── text_oarchive.hpp │ ├── tools │ ├── archinfo.hpp │ ├── array.hpp │ ├── asis.hpp │ ├── hexdump.hpp │ └── init.hpp │ ├── types │ ├── abseil │ │ ├── btree_map.hpp │ │ └── flat_hash_map.hpp │ ├── boost │ │ ├── array.hpp │ │ ├── chrono.hpp │ │ ├── container_deque.hpp │ │ ├── container_flat_map.hpp │ │ ├── container_flat_multimap.hpp │ │ ├── container_flat_multiset.hpp │ │ ├── container_flat_set.hpp │ │ ├── container_list.hpp │ │ ├── container_map.hpp │ │ ├── container_multimap.hpp │ │ ├── container_multiset.hpp │ │ ├── container_set.hpp │ │ ├── container_slist.hpp │ │ ├── container_stable_vector.hpp │ │ ├── container_static_vector.hpp │ │ ├── container_string.hpp │ │ ├── container_vector.hpp │ │ ├── container_wstring.hpp │ │ ├── fusion_list.hpp │ │ ├── fusion_map.hpp │ │ ├── fusion_pair.hpp │ │ ├── fusion_set.hpp │ │ ├── fusion_tuple.hpp │ │ ├── fusion_vector.hpp │ │ ├── optional.hpp │ │ ├── string_view.hpp │ │ ├── tuple.hpp │ │ ├── unordered_map.hpp │ │ ├── unordered_multimap.hpp │ │ ├── unordered_multiset.hpp │ │ ├── unordered_set.hpp │ │ └── variant.hpp │ ├── concepts │ │ ├── array.hpp │ │ ├── const_sized_array.hpp │ │ ├── forward_list.hpp │ │ ├── fusion_seq.hpp │ │ ├── keyval.hpp │ │ ├── list.hpp │ │ ├── optional.hpp │ │ └── set.hpp │ ├── qt │ │ ├── qbytearray.hpp │ │ ├── qlist.hpp │ │ ├── qmap.hpp │ │ ├── qstring.hpp │ │ ├── qstringlist.hpp │ │ └── qvector.hpp │ ├── std │ │ ├── array.hpp │ │ ├── bitset.hpp │ │ ├── chrono.hpp │ │ ├── complex.hpp │ │ ├── deque.hpp │ │ ├── forward_list.hpp │ │ ├── list.hpp │ │ ├── map.hpp │ │ ├── multimap.hpp │ │ ├── multiset.hpp │ │ ├── optional.hpp │ │ ├── pair.hpp │ │ ├── set.hpp │ │ ├── string.hpp │ │ ├── string_view.hpp │ │ ├── tuple.hpp │ │ ├── u16string.hpp │ │ ├── unordered_map.hpp │ │ ├── unordered_multimap.hpp │ │ ├── unordered_multiset.hpp │ │ ├── unordered_set.hpp │ │ ├── variant.hpp │ │ ├── vector.hpp │ │ └── wstring.hpp │ └── utility │ │ ├── array.hpp │ │ ├── asis.hpp │ │ ├── autoarray.hpp │ │ ├── buffer.hpp │ │ ├── enum.hpp │ │ ├── fundamental.hpp │ │ ├── init.hpp │ │ ├── object.hpp │ │ ├── usertype.hpp │ │ └── value.hpp │ ├── version.hpp │ └── yas_fwd.hpp └── tests ├── base ├── CMakeLists.txt ├── externals │ └── nlohmann_json.hpp ├── include │ ├── absl_cont_btree_map.hpp │ ├── absl_cont_flat_hash_map.hpp │ ├── archive_type.hpp │ ├── array.hpp │ ├── auto_array.hpp │ ├── base64.hpp │ ├── base_object.hpp │ ├── bitset.hpp │ ├── boost_cont_deque.hpp │ ├── boost_cont_flat_map.hpp │ ├── boost_cont_flat_multimap.hpp │ ├── boost_cont_flat_multiset.hpp │ ├── boost_cont_flat_set.hpp │ ├── boost_cont_list.hpp │ ├── boost_cont_map.hpp │ ├── boost_cont_multimap.hpp │ ├── boost_cont_multiset.hpp │ ├── boost_cont_set.hpp │ ├── boost_cont_slist.hpp │ ├── boost_cont_stable_vector.hpp │ ├── boost_cont_static_vector.hpp │ ├── boost_cont_string.hpp │ ├── boost_cont_vector.hpp │ ├── boost_cont_wstring.hpp │ ├── boost_fusion_list.hpp │ ├── boost_fusion_map.hpp │ ├── boost_fusion_pair.hpp │ ├── boost_fusion_set.hpp │ ├── boost_fusion_tuple.hpp │ ├── boost_fusion_vector.hpp │ ├── boost_string_view.hpp │ ├── boost_tuple.hpp │ ├── boost_variant.hpp │ ├── buffer.hpp │ ├── chrono.hpp │ ├── compacted_storage_size.hpp │ ├── complex.hpp │ ├── deque.hpp │ ├── endian.hpp │ ├── enum.hpp │ ├── forward_list.hpp │ ├── fundamental.hpp │ ├── header.hpp │ ├── json_conformance.hpp │ ├── list.hpp │ ├── map.hpp │ ├── multimap.hpp │ ├── multiset.hpp │ ├── one_func.hpp │ ├── one_memfn.hpp │ ├── optional.hpp │ ├── pair.hpp │ ├── qbytearray.hpp │ ├── qlist.hpp │ ├── qmap.hpp │ ├── qstring.hpp │ ├── qstringlist.hpp │ ├── qvector.hpp │ ├── serialization.hpp │ ├── serialize.hpp │ ├── set.hpp │ ├── split_func.hpp │ ├── split_memfn.hpp │ ├── std_streams.hpp │ ├── string.hpp │ ├── string_view.hpp │ ├── tuple.hpp │ ├── u16string.hpp │ ├── unordered_map.hpp │ ├── unordered_multimap.hpp │ ├── unordered_multiset.hpp │ ├── unordered_set.hpp │ ├── variant.hpp │ ├── vector.hpp │ ├── version.hpp │ ├── wstring.hpp │ ├── yas_array.hpp │ ├── yas_asis.hpp │ ├── yas_init.hpp │ └── yas_object.hpp ├── json_data │ ├── canada-max.json │ └── canada-min.json ├── main.cpp ├── test.hpp └── yas-base-test.pro ├── endian ├── endian.pro └── main.cpp └── speed ├── main.cpp └── yas-speed-test.pro /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - master 8 | 9 | jobs: 10 | build: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | include: 16 | - name: Linux GCC 17 | os: ubuntu-latest 18 | CMAKE_FLAGS: -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS="-fstack-protector-all -fsanitize=address -fno-omit-frame-pointer" 19 | 20 | - name: Linux Clang 21 | os: ubuntu-latest 22 | CMAKE_FLAGS: -DCMAKE_CXX_COMPILER=clang++ 23 | 24 | - name: macOS 25 | os: macos-latest 26 | 27 | - name: Windows 28 | os: windows-latest 29 | 30 | env: 31 | ABSEIL_HOME: ${{github.workspace}}/abseil-cpp 32 | ABSEIL_VERSION: 20200923.2 33 | BOOST_PATH: ${{github.workspace}} 34 | BOOST_VERSION: 1.76.0 35 | CONFIGURATION: Release 36 | 37 | steps: 38 | - uses: actions/checkout@v2 39 | 40 | # Retrieve the cached dependencies 41 | - name: Cache dependencies 42 | uses: actions/cache@v3 43 | id: cache-dependencies 44 | with: 45 | # Set the path to cache 46 | path: | 47 | ${{env.ABSEIL_HOME}} 48 | ${{env.BOOST_PATH}} 49 | # Use the version as the key to only cache the correct version 50 | key: deps-${{runner.os}}-${{env.ABSEIL_VERSION}}-${{env.BOOST_VERSION}} 51 | 52 | # Actual install step (only runs if the cache is empty) 53 | - name: Download Abseil 54 | if: steps.cache-dependencies.outputs.cache-hit != 'true' 55 | run: git clone --depth 1 --branch "${{env.ABSEIL_VERSION}}" https://github.com/abseil/abseil-cpp.git "${{env.ABSEIL_HOME}}" 56 | 57 | - name: Install boost 58 | id: install-boost 59 | if: steps.cache-dependencies.outputs.cache-hit != 'true' 60 | uses: MarkusJx/install-boost@v2.3.0 61 | with: 62 | # Set the boost version (required) 63 | boost_version: ${{env.BOOST_VERSION}} 64 | # Set the install directory 65 | boost_install_dir: ${{env.BOOST_PATH}} 66 | 67 | - name: Configure 68 | run: cmake -S tests/base -B build ${{matrix.CMAKE_FLAGS}} -DCMAKE_BUILD_TYPE=${{env.CONFIGURATION}} -DYAS_SERIALIZE_ABSL_TYPES=TRUE -DYAS_BUILD_TESTS=ON 69 | 70 | env: 71 | BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}} 72 | 73 | - name: Build 74 | run: cmake --build build --config ${{env.CONFIGURATION}} --parallel 75 | 76 | - name: Test 77 | run: ctest -C ${{env.CONFIGURATION}} --output-on-failure 78 | working-directory: build 79 | -------------------------------------------------------------------------------- /examples/asis/asis.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/asis/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #include 37 | #include 38 | 39 | #undef NDEBUG 40 | #include 41 | 42 | /***************************************************************************/ 43 | 44 | struct type { 45 | type() 46 | :c{1} 47 | ,i(33) 48 | ,u(44) 49 | {} 50 | 51 | std::uint8_t c; 52 | std::uint32_t i; 53 | std::uint64_t u; 54 | 55 | template 56 | void serialize(Ar &ar) { 57 | ar & YAS_OBJECT("type", c, yas::asis(i), u); 58 | } 59 | }; 60 | 61 | /***************************************************************************/ 62 | 63 | int main() { 64 | type t1, t2; 65 | t2.i = 0; 66 | t2.c = 0; 67 | t2.u = 0; 68 | 69 | constexpr std::size_t flags = yas::mem|yas::binary|yas::compacted; 70 | 71 | auto buf = yas::save(t1); 72 | 73 | assert(buf.size == 7+1+4+1); // 7 - YAS header, 1 - uint8, 4 - nonpacked uint32, 1 - packed uint64 74 | 75 | yas::load(buf, t2); 76 | 77 | assert(t1.c == t2.c && t1.i == t2.i); 78 | } 79 | 80 | /***************************************************************************/ 81 | -------------------------------------------------------------------------------- /examples/base_object/base_object.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/base_object/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #include 37 | 38 | #undef NDEBUG 39 | #include 40 | 41 | /***************************************************************************/ 42 | 43 | struct base { 44 | std::uint32_t x; 45 | 46 | base() 47 | :x() 48 | {} 49 | 50 | template 51 | void serialize(Ar &ar) { 52 | ar & YAS_OBJECT(nullptr /* reserved */, x); 53 | } 54 | }; 55 | 56 | struct derived: base { 57 | std::uint32_t y; 58 | 59 | derived() 60 | :y() 61 | {} 62 | 63 | template 64 | void serialize(Ar &ar) { 65 | auto &x = yas::base_object(*this); 66 | ar & YAS_OBJECT(nullptr /* reserved */, y, x); 67 | } 68 | }; 69 | 70 | /***************************************************************************/ 71 | 72 | int main() { 73 | derived t1, t2; 74 | t1.x = 33; 75 | t1.y = 44; 76 | 77 | constexpr std::size_t flags = yas::mem|yas::json; 78 | 79 | yas::shared_buffer buf = yas::save(t1); 80 | 81 | yas::load(buf, t2); 82 | 83 | assert(t2.x == 33 && t2.y == 44); 84 | } 85 | 86 | /***************************************************************************/ 87 | -------------------------------------------------------------------------------- /examples/init/init.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/init/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #include 37 | #include 38 | 39 | #undef NDEBUG 40 | #include 41 | 42 | /***************************************************************************/ 43 | 44 | struct type { 45 | type() 46 | :i(0xff) 47 | ,u(44) 48 | {} 49 | 50 | std::uint32_t i; 51 | std::uint64_t u; 52 | 53 | template 54 | void serialize(Ar &ar) { 55 | ar & YAS_OBJECT("type", yas::init(i), u); 56 | } 57 | }; 58 | 59 | /***************************************************************************/ 60 | 61 | int main() { 62 | type t1, t2; 63 | t2.i = 0xffffffff; 64 | t2.u = 0; 65 | 66 | constexpr std::size_t flags = yas::mem|yas::binary|yas::compacted; 67 | 68 | auto buf = yas::save(t1); 69 | 70 | yas::load(buf, t2); 71 | 72 | assert(t1.i == t2.i && t1.u == t2.u); 73 | } 74 | 75 | /***************************************************************************/ 76 | -------------------------------------------------------------------------------- /examples/nested/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #include 37 | #include 38 | 39 | #undef NDEBUG 40 | #include 41 | 42 | /***************************************************************************/ 43 | 44 | struct data { 45 | data() 46 | :s("33") 47 | {} 48 | 49 | std::string s; 50 | 51 | // one member-function for save/load 52 | template 53 | void serialize(Ar &ar) { 54 | ar & YAS_OBJECT("data", s); 55 | } 56 | }; 57 | 58 | struct type { 59 | type() 60 | :i(33) 61 | ,d() 62 | {} 63 | 64 | std::uint32_t i; 65 | data d; 66 | 67 | // one member-function for save/load 68 | template 69 | void serialize(Ar &ar) { 70 | ar & YAS_OBJECT("type", i, d); 71 | } 72 | }; 73 | 74 | /***************************************************************************/ 75 | 76 | int main() { 77 | type t1, t2; 78 | t2.i = 0; 79 | t2.d.s.clear(); 80 | 81 | constexpr std::size_t flags = yas::mem|yas::json; 82 | 83 | auto buf = yas::save(t1); 84 | 85 | yas::load(buf, t2); 86 | 87 | assert(t1.i == t2.i && t1.d.s == t2.d.s); 88 | } 89 | 90 | /***************************************************************************/ 91 | -------------------------------------------------------------------------------- /examples/nested/nested.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/one_func/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #include 37 | #include 38 | 39 | #undef NDEBUG 40 | #include 41 | 42 | /***************************************************************************/ 43 | 44 | struct type { 45 | type() 46 | :i(33) 47 | ,d(.34) 48 | ,s("35") 49 | ,v({36, 37, 38}) 50 | {} 51 | 52 | std::uint32_t i; 53 | double d; 54 | std::string s; 55 | std::vector v; 56 | }; 57 | 58 | // one free-function serializer/deserializer 59 | template 60 | void serialize(Ar &ar, type &t) { 61 | ar & YAS_OBJECT_NVP( 62 | "type" 63 | ,("i", t.i) 64 | ,("d", t.d) 65 | ,("s", t.s) 66 | ,("v", t.v) 67 | ); 68 | } 69 | 70 | /***************************************************************************/ 71 | 72 | int main() { 73 | type t1, t2; 74 | t2.i = 0; 75 | t2.d = 0; 76 | t2.s.clear(); 77 | t2.v.clear(); 78 | 79 | constexpr std::size_t flags = yas::mem|yas::json; 80 | 81 | auto buf = yas::save(t1); 82 | 83 | yas::load(buf, t2); 84 | 85 | // TODO: stackoverflow.com/questions/17333 86 | assert(t1.i == t2.i && t1.d == t2.d && t1.s == t2.s && t1.v == t2.v); 87 | } 88 | 89 | /***************************************************************************/ 90 | -------------------------------------------------------------------------------- /examples/one_func/one_func.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/one_func_cond/one_func_cond.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 7 | 8 | INCLUDEPATH += \ 9 | ../../include \ 10 | 11 | SOURCES += \ 12 | main.cpp 13 | -------------------------------------------------------------------------------- /examples/one_func_cond2/one_func_cond2.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 7 | 8 | INCLUDEPATH += \ 9 | ../../include \ 10 | 11 | SOURCES += \ 12 | main.cpp 13 | -------------------------------------------------------------------------------- /examples/one_memfn/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #include 37 | #include 38 | 39 | #undef NDEBUG 40 | #include 41 | 42 | /***************************************************************************/ 43 | struct type { 44 | type() 45 | :i(33) 46 | ,d(.33) 47 | ,s("33") 48 | ,v({33, 33, 33}) 49 | {} 50 | 51 | std::uint32_t i; 52 | double d; 53 | std::string s; 54 | std::vector v; 55 | 56 | // one member-function for save/load 57 | template 58 | void serialize(Ar &ar) { 59 | ar & YAS_OBJECT_NVP( 60 | "type" 61 | ,("i", i) 62 | ,("d", d) 63 | ,("s", s) 64 | ,("v", v) 65 | ); 66 | } 67 | }; 68 | 69 | /***************************************************************************/ 70 | 71 | int main() { 72 | type t1, t2; 73 | t2.i = 0; 74 | t2.d = 0; 75 | t2.s.clear(); 76 | t2.v.clear(); 77 | 78 | constexpr std::size_t flags = yas::mem|yas::json; 79 | 80 | auto buf = yas::save(t1); 81 | 82 | yas::load(buf, t2); 83 | 84 | // TODO: stackoverflow.com/questions/17333 85 | assert(t1.i == t2.i && t1.d == t2.d && t1.s == t2.s && t1.v == t2.v); 86 | } 87 | 88 | /***************************************************************************/ 89 | -------------------------------------------------------------------------------- /examples/one_memfn/one_memfn.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/raw_array/raw_array.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/serialization/serialization.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/split_func/split_func.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/split_memfn/split_memfn.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= qt app_bundle 4 | 5 | QMAKE_CXXFLAGS += \ 6 | -std=c++11 \ 7 | -Wall \ 8 | -Wextra 9 | 10 | INCLUDEPATH += \ 11 | ../../include \ 12 | 13 | SOURCES += \ 14 | main.cpp 15 | -------------------------------------------------------------------------------- /examples/streams/streams.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | 6 | QMAKE_CXXFLAGS += \ 7 | -std=c++11 \ 8 | -Wall \ 9 | -Wextra 10 | 11 | INCLUDEPATH += \ 12 | ../../include 13 | 14 | SOURCES += \ 15 | main.cpp 16 | -------------------------------------------------------------------------------- /examples/traits-ex/traits-ex.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | 6 | QMAKE_CXXFLAGS += \ 7 | -std=c++11 \ 8 | -Wall \ 9 | -Wextra 10 | 11 | INCLUDEPATH += \ 12 | ../../include 13 | 14 | SOURCES += main.cpp 15 | -------------------------------------------------------------------------------- /examples/traits/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #include 37 | 38 | #undef NDEBUG 39 | #include 40 | 41 | /***************************************************************************/ 42 | 43 | struct my_traits { 44 | static std::size_t itoa(char *buf, const std::size_t bufsize, std::int32_t v) { 45 | return std::snprintf(buf, bufsize, "%d", v); 46 | } 47 | }; 48 | 49 | struct my_traits2 { 50 | template 51 | static T atoi(const char *str, std::size_t) { 52 | return static_cast(std::strtol(str, 0, 10)); 53 | } 54 | }; 55 | 56 | /***************************************************************************/ 57 | 58 | int main() { 59 | std::int32_t src = 33, dst = 0; 60 | constexpr std::size_t flags = yas::mem|yas::json; 61 | 62 | auto buf = yas::save(YAS_OBJECT_NVP("object", ("v", src))); 63 | 64 | yas::load(buf, YAS_OBJECT_NVP("object", ("v", dst))); 65 | 66 | assert(src == dst); 67 | } 68 | 69 | /***************************************************************************/ 70 | -------------------------------------------------------------------------------- /examples/traits/traits.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | 6 | QMAKE_CXXFLAGS += \ 7 | -std=c++11 \ 8 | -Wall \ 9 | -Wextra 10 | 11 | INCLUDEPATH += \ 12 | ../../include 13 | 14 | SOURCES += main.cpp 15 | 16 | -------------------------------------------------------------------------------- /examples/xor-stream/xor-stream.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | 6 | QMAKE_CXXFLAGS += \ 7 | -std=c++11 \ 8 | -Wall \ 9 | -Wextra 10 | 11 | INCLUDEPATH += \ 12 | ../../include 13 | 14 | SOURCES += main.cpp 15 | 16 | -------------------------------------------------------------------------------- /include/yas/abseil_types.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__abseil_types_hpp 37 | #define __yas__abseil_types_hpp 38 | 39 | #if defined(YAS_SERIALIZE_ABSL_TYPES) 40 | 41 | #include 42 | #include 43 | 44 | #endif // defined(YAS_SERIALIZE_ABSL_TYPES) 45 | 46 | #endif // __yas__abseil_types_hpp 47 | -------------------------------------------------------------------------------- /include/yas/count_streams.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__count_streams_hpp 37 | #define __yas__count_streams_hpp 38 | 39 | #include 40 | #include 41 | 42 | namespace yas { 43 | 44 | /***************************************************************************/ 45 | 46 | struct count_ostream { 47 | count_ostream() 48 | :total_size{} 49 | {} 50 | 51 | template 52 | std::size_t write(const T *, const std::size_t size) { 53 | total_size += size; 54 | return size; 55 | } 56 | 57 | std::size_t total_size; 58 | }; // struct null_ostream 59 | 60 | /***************************************************************************/ 61 | 62 | } // ns yas 63 | 64 | #endif // __yas__count_streams_hpp 65 | -------------------------------------------------------------------------------- /include/yas/detail/config/compiler/intel.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__detail__config__compiler__intel_hpp 37 | #define __yas__detail__config__compiler__intel_hpp 38 | 39 | /**************************************************************************/ 40 | /**************************************************************************/ 41 | 42 | #endif // __yas__detail__config__compiler__intel_hpp 43 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/bitand.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | #ifndef __yas__detail__preprocessor__bitand_hpp 13 | #define __yas__detail__preprocessor__bitand_hpp 14 | # 15 | # include 16 | # 17 | # /* YAS_PP_BITAND */ 18 | # 19 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MWCC() 20 | # define YAS_PP_BITAND(x, y) YAS_PP_BITAND_I(x, y) 21 | # else 22 | # define YAS_PP_BITAND(x, y) YAS_PP_BITAND_OO((x, y)) 23 | # define YAS_PP_BITAND_OO(par) YAS_PP_BITAND_I ## par 24 | # endif 25 | # 26 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MSVC() 27 | # define YAS_PP_BITAND_I(x, y) YAS_PP_BITAND_ ## x ## y 28 | # else 29 | # define YAS_PP_BITAND_I(x, y) YAS_PP_BITAND_ID(YAS_PP_BITAND_ ## x ## y) 30 | # define YAS_PP_BITAND_ID(res) res 31 | # endif 32 | # 33 | # define YAS_PP_BITAND_00 0 34 | # define YAS_PP_BITAND_01 0 35 | # define YAS_PP_BITAND_10 0 36 | # define YAS_PP_BITAND_11 1 37 | # 38 | #endif // __yas__detail__preprocessor__bitand_hpp 39 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/cat.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__cat_hpp 15 | #define __yas__detail__preprocessor__cat_hpp 16 | # 17 | # include 18 | # 19 | # /* YAS_PP_CAT */ 20 | # 21 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MWCC() 22 | # define YAS_PP_CAT(a, b) YAS_PP_CAT_I(a, b) 23 | # else 24 | # define YAS_PP_CAT(a, b) YAS_PP_CAT_OO((a, b)) 25 | # define YAS_PP_CAT_OO(par) YAS_PP_CAT_I ## par 26 | # endif 27 | # 28 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MSVC() 29 | # define YAS_PP_CAT_I(a, b) a ## b 30 | # else 31 | # define YAS_PP_CAT_I(a, b) YAS_PP_CAT_II(~, a ## b) 32 | # define YAS_PP_CAT_II(p, res) res 33 | # endif 34 | # 35 | #endif // __yas__detail__preprocessor__cat_hpp 36 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/comma.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__comma_hpp 15 | #define __yas__detail__preprocessor__comma_hpp 16 | # 17 | # /* YAS_PP_COMMA */ 18 | # 19 | # define YAS_PP_COMMA() , 20 | # 21 | #endif // __yas__detail__preprocessor__comma_hpp 22 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/comma_if.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__comma_if_hpp 15 | #define __yas__detail__preprocessor__comma_if_hpp 16 | # 17 | # include 18 | # include 19 | # include 20 | # include 21 | # 22 | # /* YAS_PP_COMMA_IF */ 23 | # 24 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_EDG() 25 | # define YAS_PP_COMMA_IF(cond) YAS_PP_IF(cond, YAS_PP_COMMA, YAS_PP_EMPTY)() 26 | # else 27 | # define YAS_PP_COMMA_IF(cond) YAS_PP_COMMA_IF_I(cond) 28 | # define YAS_PP_COMMA_IF_I(cond) YAS_PP_IF(cond, YAS_PP_COMMA, YAS_PP_EMPTY)() 29 | # endif 30 | # 31 | #endif // __yas__detail__preprocessor__comma_if_hpp 32 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/compl.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | #ifndef __yas__detail__preprocessor__compl_hpp 13 | #define __yas__detail__preprocessor__compl_hpp 14 | # 15 | # include 16 | # 17 | # /* YAS_PP_COMPL */ 18 | # 19 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MWCC() 20 | # define YAS_PP_COMPL(x) YAS_PP_COMPL_I(x) 21 | # else 22 | # define YAS_PP_COMPL(x) YAS_PP_COMPL_OO((x)) 23 | # define YAS_PP_COMPL_OO(par) YAS_PP_COMPL_I ## par 24 | # endif 25 | # 26 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MSVC() 27 | # define YAS_PP_COMPL_I(x) YAS_PP_COMPL_ ## x 28 | # else 29 | # define YAS_PP_COMPL_I(x) YAS_PP_COMPL_ID(YAS_PP_COMPL_ ## x) 30 | # define YAS_PP_COMPL_ID(id) id 31 | # endif 32 | # 33 | # define YAS_PP_COMPL_0 1 34 | # define YAS_PP_COMPL_1 0 35 | # 36 | #endif // __yas__detail__preprocessor__compl_hpp 37 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/empty.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__empty_hpp 15 | #define __yas__detail__preprocessor__empty_hpp 16 | # 17 | # /* YAS_PP_EMPTY */ 18 | # 19 | # define YAS_PP_EMPTY() 20 | # 21 | #endif // __yas__detail__preprocessor__empty_hpp 22 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/enum_params.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__enum_params_hpp 15 | #define __yas__detail__preprocessor__enum_params_hpp 16 | # 17 | # include 18 | # include 19 | # include 20 | # 21 | # /* YAS_PP_ENUM_PARAMS */ 22 | # 23 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_EDG() 24 | # define YAS_PP_ENUM_PARAMS(count, param) YAS_PP_REPEAT(count, YAS_PP_ENUM_PARAMS_M, param) 25 | # else 26 | # define YAS_PP_ENUM_PARAMS(count, param) YAS_PP_ENUM_PARAMS_I(count, param) 27 | # define YAS_PP_ENUM_PARAMS_I(count, param) YAS_PP_REPEAT(count, YAS_PP_ENUM_PARAMS_M, param) 28 | # endif 29 | # 30 | # define YAS_PP_ENUM_PARAMS_M(z, n, param) YAS_PP_COMMA_IF(n) param ## n 31 | # 32 | # /* YAS_PP_ENUM_PARAMS_Z */ 33 | # 34 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_EDG() 35 | # define YAS_PP_ENUM_PARAMS_Z(z, count, param) YAS_PP_REPEAT_ ## z(count, YAS_PP_ENUM_PARAMS_M, param) 36 | # else 37 | # define YAS_PP_ENUM_PARAMS_Z(z, count, param) YAS_PP_ENUM_PARAMS_Z_I(z, count, param) 38 | # define YAS_PP_ENUM_PARAMS_Z_I(z, count, param) YAS_PP_REPEAT_ ## z(count, YAS_PP_ENUM_PARAMS_M, param) 39 | # endif 40 | # 41 | #endif // __yas__detail__preprocessor__enum_params_hpp 42 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/equal.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__equal_hpp 15 | #define __yas__detail__preprocessor__equal_hpp 16 | # 17 | # include 18 | # include 19 | # include 20 | # 21 | # /* YAS_PP_EQUAL */ 22 | # 23 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_EDG() 24 | # define YAS_PP_EQUAL(x, y) YAS_PP_COMPL(YAS_PP_NOT_EQUAL(x, y)) 25 | # else 26 | # define YAS_PP_EQUAL(x, y) YAS_PP_EQUAL_I(x, y) 27 | # define YAS_PP_EQUAL_I(x, y) YAS_PP_COMPL(YAS_PP_NOT_EQUAL(x, y)) 28 | # endif 29 | # 30 | # /* YAS_PP_EQUAL_D */ 31 | # 32 | # define YAS_PP_EQUAL_D(d, x, y) YAS_PP_EQUAL(x, y) 33 | # 34 | #endif // __yas__detail__preprocessor__equal_hpp 35 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/error.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | #ifndef __yas__detail__preprocessor__error_hpp 13 | #define __yas__detail__preprocessor__error_hpp 14 | # 15 | # include 16 | # include 17 | # 18 | # /* YAS_PP_ERROR */ 19 | # 20 | # if YAS_PP_CONFIG_ERRORS 21 | # define YAS_PP_ERROR(code) YAS_PP_CAT(YAS_PP_ERROR_, code) 22 | # endif 23 | # 24 | # define YAS_PP_ERROR_0x0000 YAS_PP_ERROR(0x0000, YAS_PP_INDEX_OUT_OF_BOUNDS) 25 | # define YAS_PP_ERROR_0x0001 YAS_PP_ERROR(0x0001, YAS_PP_WHILE_OVERFLOW) 26 | # define YAS_PP_ERROR_0x0002 YAS_PP_ERROR(0x0002, YAS_PP_FOR_OVERFLOW) 27 | # define YAS_PP_ERROR_0x0003 YAS_PP_ERROR(0x0003, YAS_PP_REPEAT_OVERFLOW) 28 | # define YAS_PP_ERROR_0x0004 YAS_PP_ERROR(0x0004, YAS_PP_LIST_FOLD_OVERFLOW) 29 | # define YAS_PP_ERROR_0x0005 YAS_PP_ERROR(0x0005, YAS_PP_SEQ_FOLD_OVERFLOW) 30 | # define YAS_PP_ERROR_0x0006 YAS_PP_ERROR(0x0006, YAS_PP_ARITHMETIC_OVERFLOW) 31 | # define YAS_PP_ERROR_0x0007 YAS_PP_ERROR(0x0007, YAS_PP_DIVISION_BY_ZERO) 32 | # 33 | #endif // __yas__detail__preprocessor__error_hpp 34 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/expr_if.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__expr_if_hpp 15 | #define __yas__detail__preprocessor__expr_if_hpp 16 | # 17 | # include 18 | # include 19 | # include 20 | # 21 | # /* YAS_PP_EXPR_IF */ 22 | # 23 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_EDG() 24 | # define YAS_PP_EXPR_IF(cond, expr) YAS_PP_EXPR_IIF(YAS_PP_BOOL(cond), expr) 25 | # else 26 | # define YAS_PP_EXPR_IF(cond, expr) YAS_PP_EXPR_IF_I(cond, expr) 27 | # define YAS_PP_EXPR_IF_I(cond, expr) YAS_PP_EXPR_IIF(YAS_PP_BOOL(cond), expr) 28 | # endif 29 | # 30 | #endif // __yas__detail__preprocessor__expr_if_hpp 31 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/expr_iif.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | #ifndef __yas__detail__preprocessor__expr_iif_hpp 13 | #define __yas__detail__preprocessor__expr_iif_hpp 14 | # 15 | # include 16 | # 17 | # /* YAS_PP_EXPR_IIF */ 18 | # 19 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MWCC() 20 | # define YAS_PP_EXPR_IIF(bit, expr) YAS_PP_EXPR_IIF_I(bit, expr) 21 | # else 22 | # define YAS_PP_EXPR_IIF(bit, expr) YAS_PP_EXPR_IIF_OO((bit, expr)) 23 | # define YAS_PP_EXPR_IIF_OO(par) YAS_PP_EXPR_IIF_I ## par 24 | # endif 25 | # 26 | # define YAS_PP_EXPR_IIF_I(bit, expr) YAS_PP_EXPR_IIF_ ## bit(expr) 27 | # 28 | # define YAS_PP_EXPR_IIF_0(expr) 29 | # define YAS_PP_EXPR_IIF_1(expr) expr 30 | # 31 | #endif // __yas__detail__preprocessor__expr_iif_hpp 32 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/if.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__if_hpp 15 | #define __yas__detail__preprocessor__if_hpp 16 | # 17 | # include 18 | # include 19 | # include 20 | # 21 | # /* YAS_PP_IF */ 22 | # 23 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_EDG() 24 | # define YAS_PP_IF(cond, t, f) YAS_PP_IIF(YAS_PP_BOOL(cond), t, f) 25 | # else 26 | # define YAS_PP_IF(cond, t, f) YAS_PP_IF_I(cond, t, f) 27 | # define YAS_PP_IF_I(cond, t, f) YAS_PP_IIF(YAS_PP_BOOL(cond), t, f) 28 | # endif 29 | # 30 | #endif // __yas__detail__preprocessor__if_hpp 31 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/iif.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | #ifndef __yas__detail__preprocessor__iif_hpp 13 | #define __yas__detail__preprocessor__iif_hpp 14 | # 15 | # include 16 | # 17 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MWCC() 18 | # define YAS_PP_IIF(bit, t, f) YAS_PP_IIF_I(bit, t, f) 19 | # else 20 | # define YAS_PP_IIF(bit, t, f) YAS_PP_IIF_OO((bit, t, f)) 21 | # define YAS_PP_IIF_OO(par) YAS_PP_IIF_I ## par 22 | # endif 23 | # 24 | # if ~YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MSVC() 25 | # define YAS_PP_IIF_I(bit, t, f) YAS_PP_IIF_ ## bit(t, f) 26 | # else 27 | # define YAS_PP_IIF_I(bit, t, f) YAS_PP_IIF_II(YAS_PP_IIF_ ## bit(t, f)) 28 | # define YAS_PP_IIF_II(id) id 29 | # endif 30 | # 31 | # define YAS_PP_IIF_0(t, f) f 32 | # define YAS_PP_IIF_1(t, f) t 33 | # 34 | #endif // __yas__detail__preprocessor__iif_hpp 35 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/overload.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2011. * 4 | # * (C) Copyright Edward Diener 2011. * 5 | # * Distributed under the Boost Software License, Version 1.0. (See * 6 | # * accompanying file LICENSE_1_0.txt or copy at * 7 | # * http://www.boost.org/LICENSE_1_0.txt) * 8 | # * * 9 | # ************************************************************************** */ 10 | # 11 | # /* See http://www.boost.org for most recent version. */ 12 | # 13 | #ifndef __yas__detail__preprocessor__overload_hpp 14 | #define __yas__detail__preprocessor__overload_hpp 15 | # 16 | # include 17 | # include 18 | # include 19 | # 20 | # /* BOOST_PP_OVERLOAD */ 21 | # 22 | # if YAS_PP_VARIADICS 23 | # define YAS_PP_OVERLOAD(prefix, ...) YAS_PP_CAT(prefix, YAS_PP_VARIADIC_SIZE(__VA_ARGS__)) 24 | # endif 25 | # 26 | #endif // __yas__detail__preprocessor__overload_hpp 27 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/seq_seq.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | #ifndef __yas__detail__preprocessor__seq_seq_hpp 13 | #define __yas__detail__preprocessor__seq_seq_hpp 14 | # 15 | # include 16 | # include 17 | # 18 | # /* YAS_PP_SEQ_HEAD */ 19 | # 20 | # define YAS_PP_SEQ_HEAD(seq) YAS_PP_SEQ_ELEM(0, seq) 21 | # 22 | # /* YAS_PP_SEQ_TAIL */ 23 | # 24 | # if YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MWCC() 25 | # define YAS_PP_SEQ_TAIL(seq) YAS_PP_SEQ_TAIL_1((seq)) 26 | # define YAS_PP_SEQ_TAIL_1(par) YAS_PP_SEQ_TAIL_2 ## par 27 | # define YAS_PP_SEQ_TAIL_2(seq) YAS_PP_SEQ_TAIL_I ## seq 28 | # elif YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MSVC() 29 | # define YAS_PP_SEQ_TAIL(seq) YAS_PP_SEQ_TAIL_ID(YAS_PP_SEQ_TAIL_I seq) 30 | # define YAS_PP_SEQ_TAIL_ID(id) id 31 | # elif YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_EDG() 32 | # define YAS_PP_SEQ_TAIL(seq) YAS_PP_SEQ_TAIL_D(seq) 33 | # define YAS_PP_SEQ_TAIL_D(seq) YAS_PP_SEQ_TAIL_I seq 34 | # else 35 | # define YAS_PP_SEQ_TAIL(seq) YAS_PP_SEQ_TAIL_I seq 36 | # endif 37 | # 38 | # define YAS_PP_SEQ_TAIL_I(x) 39 | # 40 | # /* YAS_PP_SEQ_NIL */ 41 | # 42 | # define YAS_PP_SEQ_NIL(x) (x) 43 | # 44 | #endif // __yas__detail__preprocessor__seq_seq_hpp 45 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/stringize.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | #ifndef __yas__detail__preprocessor__stringize_hpp 15 | #define __yas__detail__preprocessor__stringize_hpp 16 | # 17 | # include 18 | # 19 | # /* YAS_PP_STRINGIZE */ 20 | # 21 | # if YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MSVC() 22 | # define YAS_PP_STRINGIZE(text) YAS_PP_STRINGIZE_A((text)) 23 | # define YAS_PP_STRINGIZE_A(arg) YAS_PP_STRINGIZE_I arg 24 | # elif YAS_PP_CONFIG_FLAGS() & YAS_PP_CONFIG_MWCC() 25 | # define YAS_PP_STRINGIZE(text) YAS_PP_STRINGIZE_OO((text)) 26 | # define YAS_PP_STRINGIZE_OO(par) YAS_PP_STRINGIZE_I ## par 27 | # else 28 | # define YAS_PP_STRINGIZE(text) YAS_PP_STRINGIZE_I(text) 29 | # endif 30 | # 31 | # define YAS_PP_STRINGIZE_I(text) #text 32 | # 33 | #endif // __yas__detail__preprocessor__stringize_hpp 34 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/tuple_size.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Edward Diener 2011. * 4 | # * (C) Copyright Paul Mensonides 2011. * 5 | # * Distributed under the Boost Software License, Version 1.0. (See * 6 | # * accompanying file LICENSE_1_0.txt or copy at * 7 | # * http://www.boost.org/LICENSE_1_0.txt) * 8 | # * * 9 | # ************************************************************************** */ 10 | # 11 | # /* See http://www.boost.org for most recent version. */ 12 | # 13 | #ifndef __yas__detail__preprocessor__tuple_size_hpp 14 | #define __yas__detail__preprocessor__tuple_size_hpp 15 | # 16 | # include 17 | # include 18 | # include 19 | # 20 | # if YAS_PP_VARIADICS 21 | # if YAS_PP_VARIADICS_MSVC 22 | # define YAS_PP_TUPLE_SIZE(tuple) YAS_PP_CAT(YAS_PP_VARIADIC_SIZE tuple,) 23 | # else 24 | # define YAS_PP_TUPLE_SIZE(tuple) YAS_PP_VARIADIC_SIZE tuple 25 | # endif 26 | # endif 27 | # 28 | #endif // __yas__detail__preprocessor__tuple_size_hpp 29 | -------------------------------------------------------------------------------- /include/yas/detail/preprocessor/variadic_size.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Edward Diener 2011. * 4 | # * (C) Copyright Paul Mensonides 2011. * 5 | # * Distributed under the Boost Software License, Version 1.0. (See * 6 | # * accompanying file LICENSE_1_0.txt or copy at * 7 | # * http://www.boost.org/LICENSE_1_0.txt) * 8 | # * * 9 | # ************************************************************************** */ 10 | # 11 | # /* See http://www.boost.org for most recent version. */ 12 | # 13 | #ifndef __yas__detail__preprocessor__variadic_size_hpp 14 | #define __yas__detail__preprocessor__variadic_size_hpp 15 | # 16 | # include 17 | # include 18 | # 19 | # /* YAS_PP_VARIADIC_SIZE */ 20 | # 21 | # if YAS_PP_VARIADICS 22 | # if YAS_PP_VARIADICS_MSVC 23 | # define YAS_PP_VARIADIC_SIZE(...) YAS_PP_CAT(YAS_PP_VARIADIC_SIZE_I(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,),) 24 | # else 25 | # define YAS_PP_VARIADIC_SIZE(...) YAS_PP_VARIADIC_SIZE_I(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,) 26 | # endif 27 | # define YAS_PP_VARIADIC_SIZE_I(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, size, ...) size 28 | # endif 29 | # 30 | #endif // __yas__detail__preprocessor__variadic_size_hpp 31 | -------------------------------------------------------------------------------- /include/yas/detail/tools/base_object.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tool__base_object_hpp 37 | #define __yas__tool__base_object_hpp 38 | 39 | namespace yas { 40 | 41 | template 42 | B& base_object(D& d) { 43 | return static_cast(d); 44 | } 45 | 46 | template 47 | const B& base_object(const D& d) { 48 | return static_cast(d); 49 | } 50 | 51 | } // namespace yas 52 | 53 | #endif // __yas__tool__base_object_hpp 54 | -------------------------------------------------------------------------------- /include/yas/detail/tools/cast.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__detail__tools__cast_hpp 37 | #define __yas__detail__tools__cast_hpp 38 | 39 | #define __YAS_SCAST(t, v) static_cast(v) 40 | #define __YAS_RCAST(t, v) reinterpret_cast(v) 41 | #define __YAS_CCAST(t, v) const_cast(v) 42 | 43 | #endif // __yas__detail__tools__cast_hpp 44 | -------------------------------------------------------------------------------- /include/yas/detail/tools/limit_exceptions.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__detail__tools__limit_exceptions_hpp 37 | #define __yas__detail__tools__limit_exceptions_hpp 38 | 39 | #include 40 | 41 | namespace yas { 42 | 43 | /***************************************************************************/ 44 | 45 | __YAS_DECLARE_EXCEPTION_TYPE(limits_exception) 46 | 47 | /***************************************************************************/ 48 | 49 | #define __YAS_THROW_LIMIT_EXCEEDED() \ 50 | throw ::yas::limits_exception("limit exceeded"); 51 | 52 | /***************************************************************************/ 53 | 54 | } // ns yas 55 | 56 | #endif // __yas__detail__tools__limit_exceptions_hpp 57 | -------------------------------------------------------------------------------- /include/yas/detail/tools/noncopyable.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__detail__tools__noncopyable_hpp 37 | #define __yas__detail__tools__noncopyable_hpp 38 | 39 | #define YAS_NONCOPYABLE(type) \ 40 | type(const type &) = delete; \ 41 | type& operator=(const type &) = delete; 42 | 43 | #define YAS_MOVABLE(type) \ 44 | type(type &&) = default; \ 45 | type& operator=(type &&) = default; 46 | 47 | #endif // __yas__detail__tools__noncopyable_hpp 48 | -------------------------------------------------------------------------------- /include/yas/detail/type_traits/serializer.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__detail__type_traits__serializer_hpp 37 | #define __yas__detail__type_traits__serializer_hpp 38 | 39 | #include 40 | 41 | namespace yas { 42 | namespace detail { 43 | 44 | /***************************************************************************/ 45 | 46 | template< 47 | type_prop 48 | ,ser_case 49 | ,std::size_t F 50 | ,typename T 51 | > struct serializer; 52 | 53 | /***************************************************************************/ 54 | 55 | } // ns detail 56 | } // ns yas 57 | 58 | #endif // __yas__detail__type_traits__serializer_hpp 59 | -------------------------------------------------------------------------------- /include/yas/qt_types.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__qt_types_hpp 37 | #define __yas__qt_types_hpp 38 | 39 | #if defined(YAS_SERIALIZE_QT_TYPES) 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #endif // defined(YAS_SERIALIZE_QT_TYPES) 49 | 50 | #endif // __yas__qt_types_hpp 51 | -------------------------------------------------------------------------------- /include/yas/std_types.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__std_types_hpp 37 | #define __yas__std_types_hpp 38 | 39 | #include 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | 66 | #endif // __yas__std_types_hpp 67 | -------------------------------------------------------------------------------- /include/yas/types/abseil/btree_map.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 2 | // rights reserved. 3 | // 4 | // This file is part of YAS(https://github.com/niXman/yas) project. 5 | // 6 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // 10 | // 11 | // Boost Software License - Version 1.0 - August 17th, 2003 12 | // 13 | // Permission is hereby granted, free of charge, to any person or organization 14 | // obtaining a copy of the software and accompanying documentation covered by 15 | // this license (the "Software") to use, reproduce, display, distribute, 16 | // execute, and transmit the Software, and to prepare derivative works of the 17 | // Software, and to permit third-parties to whom the Software is furnished to 18 | // do so, all subject to the following: 19 | // 20 | // The copyright notices in the Software and this entire statement, including 21 | // the above license grant, this restriction and the following disclaimer, 22 | // must be included in all copies of the Software, in whole or in part, and 23 | // all derivative works of the Software, unless such copies or derivative 24 | // works are solely in the form of machine-executable object code generated by 25 | // a source language processor. 26 | // 27 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 28 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 29 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 30 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 31 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 32 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 33 | // DEALINGS IN THE SOFTWARE. 34 | 35 | #ifndef __yas__types__abseil__absl_btree_map_serializers_hpp 36 | #define __yas__types__abseil__absl_btree_map_serializers_hpp 37 | 38 | #if defined(YAS_SERIALIZE_ABSL_TYPES) 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | absl::btree_map 56 | > { 57 | template 58 | static Archive& save(Archive &ar, const absl::btree_map &map) { 59 | return concepts::keyval::save(ar, map); 60 | } 61 | 62 | template 63 | static Archive& load(Archive &ar, absl::btree_map &map) { 64 | return concepts::keyval::load(ar, map); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // defined(YAS_SERIALIZE_ABSL_TYPES) 74 | 75 | #endif // __yas__types__abseil__absl_btree_map_serializers_hpp -------------------------------------------------------------------------------- /include/yas/types/abseil/flat_hash_map.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 2 | // rights reserved. 3 | // 4 | // This file is part of YAS(https://github.com/niXman/yas) project. 5 | // 6 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // 10 | // 11 | // Boost Software License - Version 1.0 - August 17th, 2003 12 | // 13 | // Permission is hereby granted, free of charge, to any person or organization 14 | // obtaining a copy of the software and accompanying documentation covered by 15 | // this license (the "Software") to use, reproduce, display, distribute, 16 | // execute, and transmit the Software, and to prepare derivative works of the 17 | // Software, and to permit third-parties to whom the Software is furnished to 18 | // do so, all subject to the following: 19 | // 20 | // The copyright notices in the Software and this entire statement, including 21 | // the above license grant, this restriction and the following disclaimer, 22 | // must be included in all copies of the Software, in whole or in part, and 23 | // all derivative works of the Software, unless such copies or derivative 24 | // works are solely in the form of machine-executable object code generated by 25 | // a source language processor. 26 | // 27 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 28 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 29 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 30 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 31 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 32 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 33 | // DEALINGS IN THE SOFTWARE. 34 | 35 | #ifndef __yas__types__abseil__absl_flat_hash_map_serializers_hpp 36 | #define __yas__types__abseil__absl_flat_hash_map_serializers_hpp 37 | 38 | #if defined(YAS_SERIALIZE_ABSL_TYPES) 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | absl::flat_hash_map 56 | > { 57 | template 58 | static Archive& save(Archive &ar, const absl::flat_hash_map &map) { 59 | return concepts::keyval::save(ar, map); 60 | } 61 | 62 | template 63 | static Archive& load(Archive &ar, absl::flat_hash_map &map) { 64 | return concepts::keyval::load(ar, map); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // defined(YAS_SERIALIZE_ABSL_TYPES) 74 | 75 | #endif // __yas__types__abseil__absl_flat_hash_map_serializers_hpp -------------------------------------------------------------------------------- /include/yas/types/boost/container_deque.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_container_deque_serializers_hpp 37 | #define __yas__types__boost__boost_container_deque_serializers_hpp 38 | 39 | #if defined(YAS_SERIALIZE_BOOST_TYPES) 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | namespace yas { 47 | namespace detail { 48 | 49 | /***************************************************************************/ 50 | 51 | template 52 | struct serializer< 53 | type_prop::not_a_fundamental, 54 | ser_case::use_internal_serializer, 55 | F, 56 | boost::container::deque 57 | > { 58 | template 59 | static Archive& save(Archive& ar, const boost::container::deque &deque) { 60 | return concepts::list::save(ar, deque); 61 | } 62 | 63 | template 64 | static Archive& load(Archive& ar, boost::container::deque &deque) { 65 | return concepts::list::load(ar, deque); 66 | } 67 | }; 68 | 69 | /***************************************************************************/ 70 | 71 | } // namespace detail 72 | } // namespace yas 73 | 74 | #endif // defined(YAS_SERIALIZE_BOOST_TYPES) 75 | 76 | #endif // __yas__types__boost__boost_container_deque_serializers_hpp 77 | -------------------------------------------------------------------------------- /include/yas/types/boost/container_list.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_container_list_serializers_hpp 37 | #define __yas__types__boost__boost_container_list_serializers_hpp 38 | 39 | #if defined(YAS_SERIALIZE_BOOST_TYPES) 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | namespace yas { 47 | namespace detail { 48 | 49 | /***************************************************************************/ 50 | 51 | template 52 | struct serializer< 53 | type_prop::not_a_fundamental, 54 | ser_case::use_internal_serializer, 55 | F, 56 | boost::container::list 57 | > { 58 | template 59 | static Archive& save(Archive &ar, const boost::container::list &list) { 60 | return concepts::list::save(ar, list); 61 | } 62 | 63 | template 64 | static Archive& load(Archive &ar, boost::container::list &list) { 65 | return concepts::list::load(ar, list); 66 | } 67 | }; 68 | 69 | /***************************************************************************/ 70 | 71 | } // namespace detail 72 | } // namespace yas 73 | 74 | #endif // defined(YAS_SERIALIZE_BOOST_TYPES) 75 | 76 | #endif // __yas__types__boost__boost_container_list_serializers_hpp 77 | -------------------------------------------------------------------------------- /include/yas/types/boost/container_set.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_container_set_serializers_hpp 37 | #define __yas__types__boost__boost_container_set_serializers_hpp 38 | 39 | #if defined(YAS_SERIALIZE_BOOST_TYPES) 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | namespace yas { 47 | namespace detail { 48 | 49 | /***************************************************************************/ 50 | 51 | template 52 | struct serializer< 53 | type_prop::not_a_fundamental, 54 | ser_case::use_internal_serializer, 55 | F, 56 | boost::container::set 57 | > { 58 | template 59 | static Archive& save(Archive& ar, const boost::container::set &set) { 60 | return concepts::set::save(ar, set); 61 | } 62 | 63 | template 64 | static Archive& load(Archive& ar, boost::container::set &set) { 65 | return concepts::set::load(ar, set); 66 | } 67 | }; 68 | 69 | /***************************************************************************/ 70 | 71 | } // namespace detail 72 | } // namespace yas 73 | 74 | #endif // defined(YAS_SERIALIZE_BOOST_TYPES) 75 | 76 | #endif // __yas__types__boost__boost_container_set_serializers_hpp 77 | -------------------------------------------------------------------------------- /include/yas/types/boost/fusion_map.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_fusion_map_serializers_hpp 37 | #define __yas__types__boost__boost_fusion_map_serializers_hpp 38 | 39 | namespace yas { 40 | namespace detail { 41 | 42 | /***************************************************************************/ 43 | 44 | /** not implemented */ 45 | 46 | /***************************************************************************/ 47 | 48 | } // namespace detail 49 | } // namespace yas 50 | 51 | #endif // __yas__types__boost__boost_fusion_map_serializers_hpp 52 | -------------------------------------------------------------------------------- /include/yas/types/boost/fusion_pair.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_fusion_pair_serializers_hpp 37 | #define __yas__types__boost__boost_fusion_pair_serializers_hpp 38 | 39 | #if defined(YAS_SERIALIZE_BOOST_TYPES) 40 | #include 41 | #include 42 | 43 | #include 44 | #include 45 | 46 | namespace yas { 47 | namespace detail { 48 | 49 | /***************************************************************************/ 50 | 51 | template 52 | struct serializer< 53 | type_prop::not_a_fundamental, 54 | ser_case::use_internal_serializer, 55 | F, 56 | boost::fusion::pair 57 | > { 58 | template 59 | static Archive& save(Archive& ar, const boost::fusion::pair& pair) { 60 | ar & pair.second; 61 | return ar; 62 | } 63 | 64 | template 65 | static Archive& load(Archive& ar, boost::fusion::pair& pair) { 66 | ar & pair.second; 67 | return ar; 68 | } 69 | }; 70 | 71 | /***************************************************************************/ 72 | 73 | } // namespace detail 74 | } // namespace yas 75 | 76 | #endif // defined(YAS_SERIALIZE_BOOST_TYPES) 77 | 78 | #endif // __yas__types__boost__boost_fusion_pair_serializers_hpp 79 | -------------------------------------------------------------------------------- /include/yas/types/boost/fusion_set.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_fusion_set_serializers_hpp 37 | #define __yas__types__boost__boost_fusion_set_serializers_hpp 38 | 39 | namespace yas { 40 | namespace detail { 41 | 42 | /***************************************************************************/ 43 | 44 | /** not implemented */ 45 | 46 | /***************************************************************************/ 47 | 48 | } // namespace detail 49 | } // namespace yas 50 | 51 | #endif // __yas__types__boost__boost_fusion_set_serializers_hpp 52 | -------------------------------------------------------------------------------- /include/yas/types/boost/optional.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_optional_serializers_hpp 37 | #define __yas__types__boost__boost_optional_serializers_hpp 38 | 39 | #if defined(YAS_SERIALIZE_BOOST_TYPES) 40 | 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | boost::optional 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const boost::optional &t) { 59 | return concepts::optional::save(ar, t); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, boost::optional &t) { 64 | return concepts::optional::load(ar, t); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // defined(YAS_SERIALIZE_BOOST_TYPES) 74 | 75 | #endif // __yas__types__boost__boost_optional_serializers_hpp 76 | -------------------------------------------------------------------------------- /include/yas/types/boost/unordered_set.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__boost__boost_unordered_set_serializers_hpp 37 | #define __yas__types__boost__boost_unordered_set_serializers_hpp 38 | 39 | #if defined(YAS_SERIALIZE_BOOST_TYPES) 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | namespace yas { 47 | namespace detail { 48 | 49 | /***************************************************************************/ 50 | 51 | template 52 | struct serializer< 53 | type_prop::not_a_fundamental, 54 | ser_case::use_internal_serializer, 55 | F, 56 | boost::unordered_set 57 | > { 58 | template 59 | static Archive& save(Archive& ar, const boost::unordered_set &set) { 60 | return concepts::set::save(ar, set); 61 | } 62 | 63 | template 64 | static Archive& load(Archive& ar, boost::unordered_set &set) { 65 | return concepts::set::load(ar, set); 66 | } 67 | }; 68 | 69 | /***************************************************************************/ 70 | 71 | } // namespace detail 72 | } // namespace yas 73 | 74 | #endif // defined(YAS_SERIALIZE_BOOST_TYPES) 75 | 76 | #endif // __yas__types__boost__boost_unordered_set_serializers_hpp 77 | -------------------------------------------------------------------------------- /include/yas/types/qt/qlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__qt__qlist_serializers_hpp 37 | #define __yas__types__qt__qlist_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | QList 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const QList& list) { 59 | return concepts::list::save(ar, list); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, QList& list) { 64 | return concepts::list::load(ar, list); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__qt__qlist_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/qt/qstring.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__qt__qstring_serializers_hpp 37 | #define __yas__types__qt__qstring_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | #include 46 | 47 | namespace yas { 48 | namespace detail { 49 | 50 | /***************************************************************************/ 51 | 52 | template 53 | struct serializer< 54 | type_prop::not_a_fundamental, 55 | ser_case::use_internal_serializer, 56 | F, 57 | QString 58 | > { 59 | template 60 | static Archive& save(Archive& ar, const QString &str) { 61 | return ar & str.toUtf8(); 62 | } 63 | 64 | template 65 | static Archive& load(Archive& ar, QString &str) { 66 | QByteArray arr; 67 | ar & arr; 68 | 69 | str = QString::fromUtf8(arr); 70 | 71 | return ar; 72 | } 73 | }; 74 | 75 | /***************************************************************************/ 76 | 77 | } // namespace detail 78 | } // namespace yas 79 | 80 | #endif // __yas__types__qt__qstring_serializers_hpp 81 | -------------------------------------------------------------------------------- /include/yas/types/qt/qstringlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__qt__qstringlist_serializers_hpp 37 | #define __yas__types__qt__qstringlist_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | QStringList 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const QStringList &list) { 59 | return concepts::list::save(ar, list); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, QStringList& list) { 64 | return concepts::list::load(ar, list); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__qt__qstringlist_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/qt/qvector.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__qt__qvector_serializers_hpp 37 | #define __yas__types__qt__qvector_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | QVector 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const QVector &vector) { 59 | return concepts::array::save(ar, vector); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, QVector &vector) { 64 | return concepts::array::load(ar, vector); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__qt__qvector_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/array.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_array_serializers_hpp 37 | #define __yas__types__std__std_array_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | #include 46 | 47 | namespace yas { 48 | namespace detail { 49 | 50 | /***************************************************************************/ 51 | 52 | template 53 | struct serializer< 54 | type_prop::not_a_fundamental, 55 | ser_case::use_internal_serializer, 56 | F, 57 | std::array 58 | > { 59 | template 60 | static Archive& save(Archive& ar, const std::array& array) { 61 | return concepts::const_sized_array::save(ar, array.data(), array.data()+N); 62 | } 63 | 64 | template 65 | static Archive& load(Archive& ar, std::array& array) { 66 | return concepts::const_sized_array::load(ar, array.data(), array.data()+N); 67 | } 68 | }; 69 | 70 | /***************************************************************************/ 71 | 72 | } // namespace detail 73 | } // namespace yas 74 | 75 | #endif // __yas__types__std__std_array_serializers_hpp 76 | -------------------------------------------------------------------------------- /include/yas/types/std/deque.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_deque_serializers_hpp 37 | #define __yas__types__std__std_deque_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::deque 56 | > { 57 | template 58 | static Archive& save(Archive &ar, const std::deque &deque) { 59 | return concepts::list::save(ar, deque); 60 | } 61 | 62 | template 63 | static Archive& load(Archive &ar, std::deque &deque) { 64 | return concepts::list::load(ar, deque); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_deque_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/forward_list.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_forward_list_serializers_hpp 37 | #define __yas__types__std__std_forward_list_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::forward_list 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::forward_list& list) { 59 | return concepts::forward_list::save(ar, list, std::distance(list.begin(), list.end())); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::forward_list& list) { 64 | return concepts::forward_list::load(ar, list); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_forward_list_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/list.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_list_serializers_hpp 37 | #define __yas__types__std__std_list_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::list 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::list& list) { 59 | return concepts::list::save(ar, list); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::list& list) { 64 | return concepts::list::load(ar, list); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_list_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/map.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_map_serializers_hpp 37 | #define __yas__types__std__std_map_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template< 51 | std::size_t F 52 | ,typename K 53 | ,typename V 54 | ,typename Cmp 55 | ,typename Alloc 56 | > 57 | struct serializer< 58 | type_prop::not_a_fundamental, 59 | ser_case::use_internal_serializer, 60 | F, 61 | std::map 62 | > { 63 | template 64 | static Archive& save(Archive& ar, const std::map& map) { 65 | return concepts::keyval::save(ar, map); 66 | } 67 | 68 | template 69 | static Archive& load(Archive& ar, std::map& map) { 70 | return concepts::keyval::load(ar, map); 71 | } 72 | }; 73 | 74 | /***************************************************************************/ 75 | 76 | } // namespace detail 77 | } // namespace yas 78 | 79 | #endif // __yas__types__std__std_map_serializers_hpp 80 | -------------------------------------------------------------------------------- /include/yas/types/std/multimap.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_multimap_serializers_hpp 37 | #define __yas__types__std__std_multimap_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template< 51 | std::size_t F 52 | ,typename K 53 | ,typename V 54 | ,typename Cmp 55 | ,typename Alloc 56 | > 57 | struct serializer< 58 | type_prop::not_a_fundamental, 59 | ser_case::use_internal_serializer, 60 | F, 61 | std::multimap 62 | > { 63 | template 64 | static Archive& save(Archive& ar, const std::multimap& multimap) { 65 | return concepts::keyval::save(ar, multimap); 66 | } 67 | 68 | template 69 | static Archive& load(Archive& ar, std::multimap& multimap) { 70 | return concepts::keyval::load(ar, multimap); 71 | } 72 | }; 73 | 74 | /***************************************************************************/ 75 | 76 | } // namespace detail 77 | } // namespace yas 78 | 79 | #endif // __yas__types__std__std_multimap_serializers_hpp 80 | -------------------------------------------------------------------------------- /include/yas/types/std/multiset.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_multiset_serializers_hpp 37 | #define __yas__types__std__std_multiset_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template< 51 | std::size_t F 52 | ,typename K 53 | ,typename Cmp 54 | ,typename Alloc 55 | > 56 | struct serializer< 57 | type_prop::not_a_fundamental, 58 | ser_case::use_internal_serializer, 59 | F, 60 | std::multiset 61 | > { 62 | template 63 | static Archive& save(Archive& ar, const std::multiset& set) { 64 | return concepts::set::save(ar, set); 65 | } 66 | 67 | template 68 | static Archive& load(Archive& ar, std::multiset& set) { 69 | return concepts::set::load(ar, set); 70 | } 71 | }; 72 | 73 | /***************************************************************************/ 74 | 75 | } // namespace detail 76 | } // namespace yas 77 | 78 | #endif // __yas__types__std__std_multiset_serializers_hpp 79 | -------------------------------------------------------------------------------- /include/yas/types/std/optional.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_optional_serializers_hpp 37 | #define __yas__types__std__std_optional_serializers_hpp 38 | 39 | #if __cplusplus >= 201703L 40 | 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::optional 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::optional &t) { 59 | return concepts::optional::save(ar, t); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::optional &t) { 64 | return concepts::optional::load(ar, t); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // if __cplusplus >= 201703L 74 | 75 | #endif // __yas__types__std__std_optional_serializers_hpp 76 | -------------------------------------------------------------------------------- /include/yas/types/std/set.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_set_serializers_hpp 37 | #define __yas__types__std__std_set_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template< 51 | std::size_t F 52 | ,typename K 53 | ,typename Cmp 54 | ,typename Alloc 55 | > 56 | struct serializer< 57 | type_prop::not_a_fundamental, 58 | ser_case::use_internal_serializer, 59 | F, 60 | std::set 61 | > { 62 | template 63 | static Archive& save(Archive& ar, const std::set& set) { 64 | return concepts::set::save(ar, set); 65 | } 66 | 67 | template 68 | static Archive& load(Archive& ar, std::set& set) { 69 | return concepts::set::load(ar, set); 70 | } 71 | }; 72 | 73 | /***************************************************************************/ 74 | 75 | } // namespace detail 76 | } // namespace yas 77 | 78 | #endif // __yas__types__std__std_set_serializers_hpp 79 | -------------------------------------------------------------------------------- /include/yas/types/std/u16string.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | 37 | #ifndef __yas__types__std__std_u16string_serializers_hpp 38 | #define __yas__types__std__std_u16string_serializers_hpp 39 | 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::u16string 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::u16string& u16string) { 59 | std::string dst; 60 | detail::TypeConverter::Convert(dst, u16string); 61 | ar & dst; 62 | return ar; 63 | } 64 | 65 | template 66 | static Archive& load(Archive& ar, std::u16string& u16string) { 67 | std::string string; 68 | ar & string; 69 | detail::TypeConverter::Convert(u16string, string); 70 | return ar; 71 | } 72 | }; 73 | 74 | /***************************************************************************/ 75 | 76 | } // namespace detail 77 | } // namespace yas 78 | 79 | #endif // __yas__types__std__std_u16string_serializers_hpp 80 | -------------------------------------------------------------------------------- /include/yas/types/std/unordered_map.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_unordered_map_serializers_hpp 37 | #define __yas__types__std__std_unordered_map_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::unordered_map 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::unordered_map& map) { 59 | return concepts::keyval::save(ar, map); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::unordered_map& map) { 64 | return concepts::keyval::load(ar, map); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_unordered_map_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/unordered_multimap.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_unordered_multimap_serializers_hpp 37 | #define __yas__types__std__std_unordered_multimap_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::unordered_multimap 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::unordered_multimap &map) { 59 | return concepts::keyval::save(ar, map); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::unordered_multimap &map) { 64 | return concepts::keyval::load(ar, map); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_unordered_multimap_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/unordered_multiset.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_unordered_multiset_serializers_hpp 37 | #define __yas__types__std__std_unordered_multiset_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::unordered_multiset 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::unordered_multiset &set) { 59 | return concepts::set::save(ar, set); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::unordered_multiset &set) { 64 | return concepts::set::load(ar, set); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_unordered_multiset_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/unordered_set.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_unordered_set_serializers_hpp 37 | #define __yas__types__std__std_unordered_set_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::unordered_set 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::unordered_set& set) { 59 | return concepts::set::save(ar, set); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::unordered_set& set) { 64 | return concepts::set::load(ar, set); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_unordered_set_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/vector.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__std__std_vector_serializers_hpp 37 | #define __yas__types__std__std_vector_serializers_hpp 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::vector 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::vector& vector) { 59 | return concepts::array::save(ar, vector); 60 | } 61 | 62 | template 63 | static Archive& load(Archive& ar, std::vector& vector) { 64 | return concepts::array::load(ar, vector); 65 | } 66 | }; 67 | 68 | /***************************************************************************/ 69 | 70 | } // namespace detail 71 | } // namespace yas 72 | 73 | #endif // __yas__types__std__std_vector_serializers_hpp 74 | -------------------------------------------------------------------------------- /include/yas/types/std/wstring.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | 37 | #ifndef __yas__types__std__std_wstring_serializers_hpp 38 | #define __yas__types__std__std_wstring_serializers_hpp 39 | 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | namespace yas { 46 | namespace detail { 47 | 48 | /***************************************************************************/ 49 | 50 | template 51 | struct serializer< 52 | type_prop::not_a_fundamental, 53 | ser_case::use_internal_serializer, 54 | F, 55 | std::wstring 56 | > { 57 | template 58 | static Archive& save(Archive& ar, const std::wstring& wstring) { 59 | std::string dst; 60 | detail::TypeConverter::Convert(dst, wstring); 61 | ar & dst; 62 | return ar; 63 | } 64 | 65 | template 66 | static Archive& load(Archive& ar, std::wstring& wstring) { 67 | std::string string; 68 | ar & string; 69 | detail::TypeConverter::Convert(wstring, string); 70 | return ar; 71 | } 72 | }; 73 | 74 | /***************************************************************************/ 75 | 76 | } // namespace detail 77 | } // namespace yas 78 | 79 | #endif // __yas__types__std__std_wstring_serializers_hpp 80 | -------------------------------------------------------------------------------- /include/yas/types/utility/fundamental.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__types__utility__fundamental_hpp 37 | #define __yas__types__utility__fundamental_hpp 38 | 39 | #include 40 | #include 41 | 42 | namespace yas { 43 | namespace detail { 44 | 45 | /***************************************************************************/ 46 | 47 | template 48 | struct serializer< 49 | type_prop::is_fundamental, 50 | ser_case::use_internal_serializer, 51 | F, 52 | T 53 | > { 54 | template 55 | static Archive& save(Archive& ar, const T& v) { 56 | ar.write(v); 57 | return ar; 58 | } 59 | 60 | template 61 | static Archive& load(Archive& ar, T& v) { 62 | ar.read(v); 63 | return ar; 64 | } 65 | }; 66 | 67 | /***************************************************************************/ 68 | 69 | } // namespace detail 70 | } // namespace yas 71 | 72 | #endif // __yas__types__utility__fundamental_hpp 73 | -------------------------------------------------------------------------------- /include/yas/version.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__version_hpp 37 | #define __yas__version_hpp 38 | 39 | // YAS_VERSION / 100000 is the major version 40 | // YAS_VERSION / 100 % 1000 is the minor version 41 | // YAS_VERSION % 100 is the bugfix level 42 | 43 | #define YAS_VERSION_MAJOR 7 44 | #define YAS_VERSION_MINOR 2 45 | #define YAS_VERSION_BUGFIX 0 46 | 47 | #define YAS_VERSION \ 48 | YAS_VERSION_MAJOR*100000 \ 49 | +YAS_VERSION_MINOR*1000 \ 50 | +YAS_VERSION_BUGFIX*10 51 | 52 | #define __YAS_STRINGIZE_I(x) #x 53 | #define __YAS_STRINGIZE(x) __YAS_STRINGIZE_I(x) 54 | 55 | #define YAS_VERSION_STRING \ 56 | __YAS_STRINGIZE(YAS_VERSION_MAJOR) \ 57 | "." __YAS_STRINGIZE(YAS_VERSION_MINOR) \ 58 | "." __YAS_STRINGIZE(YAS_VERSION_BUGFIX) 59 | 60 | namespace yas { 61 | namespace detail { 62 | 63 | /**************************************************************************/ 64 | 65 | enum yas_version { 66 | binary_archive_version = 7 67 | ,text_archive_version = 3 68 | ,json_archive_version = 1 69 | }; 70 | 71 | /**************************************************************************/ 72 | 73 | } // namespace detail 74 | } // namespace yas 75 | 76 | #endif // __yas__version_hpp 77 | -------------------------------------------------------------------------------- /include/yas/yas_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__yas_fwd_hpp 37 | #define __yas__yas_fwd_hpp 38 | 39 | #include 40 | #include 41 | 42 | namespace yas { 43 | 44 | /***************************************************************************/ 45 | 46 | struct shared_buffer; 47 | struct intrusive_buffer; 48 | 49 | struct mem_ostream; 50 | struct mem_istream; 51 | 52 | struct file_ostream; 53 | struct file_istream; 54 | 55 | template 56 | struct binary_iarchive; 57 | template 58 | struct binary_oarchive; 59 | 60 | struct default_traits; 61 | struct std_traits; 62 | 63 | template 64 | struct text_iarchive; 65 | template 66 | struct text_oarchive; 67 | 68 | template 69 | struct json_iarchive; 70 | template 71 | struct json_oarchive; 72 | 73 | /***************************************************************************/ 74 | 75 | } // ns yas 76 | 77 | #endif // __yas__yas_fwd_hpp -------------------------------------------------------------------------------- /tests/base/include/bitset.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__bitset_hpp 37 | #define __yas__tests__base__include__bitset_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool bitset_test(std::ostream &log, const char* archive_type, const char *test_name) { 43 | std::bitset<33> bs1, bs2; 44 | bs1[2] = 1; 45 | bs1[9] = 1; 46 | bs1[4] = 1; 47 | bs1[6] = 1; 48 | bs1[1] = 1; 49 | bs1[8] = 1; 50 | 51 | typename archive_traits::oarchive oa; 52 | archive_traits::ocreate(oa, archive_type); 53 | oa & YAS_OBJECT_NVP("obj", ("bs", bs1)); 54 | 55 | typename archive_traits::iarchive ia; 56 | archive_traits::icreate(ia, oa, archive_type); 57 | ia & YAS_OBJECT_NVP("obj", ("bs", bs2)); 58 | 59 | if ( bs1 != bs2 ) { 60 | YAS_TEST_REPORT(log, archive_type, test_name); 61 | return false; 62 | } 63 | 64 | return true; 65 | } 66 | 67 | /***************************************************************************/ 68 | 69 | #endif // __yas__tests__base__include__bitset_hpp 70 | -------------------------------------------------------------------------------- /tests/base/include/boost_cont_stable_vector.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_cont_stable_vector_hpp 37 | #define __yas__tests__base__include__boost_cont_stable_vector_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool boost_cont_stable_vector_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | boost::container::stable_vector v, vv; 44 | v.push_back(0); 45 | v.push_back(1); 46 | v.push_back(2); 47 | v.push_back(3); 48 | v.push_back(4); 49 | v.push_back(5); 50 | v.push_back(6); 51 | v.push_back(7); 52 | v.push_back(8); 53 | v.push_back(9); 54 | 55 | typename archive_traits::oarchive oa; 56 | archive_traits::ocreate(oa, archive_type); 57 | auto o0 = YAS_OBJECT_NVP("obj", ("v", v)); 58 | oa & o0; 59 | 60 | typename archive_traits::iarchive ia; 61 | archive_traits::icreate(ia, oa, archive_type); 62 | auto i0 = YAS_OBJECT_NVP("obj", ("v", vv)); 63 | ia & i0; 64 | 65 | if ( v != vv ) { 66 | YAS_TEST_REPORT(log, archive_type, test_name); 67 | return false; 68 | } 69 | 70 | return true; 71 | } 72 | 73 | /***************************************************************************/ 74 | 75 | #endif // __yas__tests__base__include__boost_cont_stable_vector_hpp 76 | -------------------------------------------------------------------------------- /tests/base/include/boost_cont_static_vector.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_cont_static_vector_hpp 37 | #define __yas__tests__base__include__boost_cont_static_vector_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool boost_cont_static_vector_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | boost::container::static_vector v, vv; 44 | v.push_back(0); 45 | v.push_back(1); 46 | v.push_back(2); 47 | v.push_back(3); 48 | v.push_back(4); 49 | 50 | typename archive_traits::oarchive oa; 51 | archive_traits::ocreate(oa, archive_type); 52 | oa & YAS_OBJECT_NVP("obj", ("v", v)); 53 | 54 | typename archive_traits::iarchive ia; 55 | archive_traits::icreate(ia, oa, archive_type); 56 | ia & YAS_OBJECT_NVP("obj", ("v", vv)); 57 | 58 | if ( v != vv ) { 59 | YAS_TEST_REPORT(log, archive_type, test_name); 60 | return false; 61 | } 62 | 63 | return true; 64 | } 65 | 66 | /***************************************************************************/ 67 | 68 | #endif // __yas__tests__base__include__boost_cont_static_vector_hpp 69 | -------------------------------------------------------------------------------- /tests/base/include/boost_cont_string.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_cont_string_hpp 37 | #define __yas__tests__base__include__boost_cont_string_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool boost_cont_string_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | typename archive_traits::oarchive oa; 44 | archive_traits::ocreate(oa, archive_type); 45 | boost::container::string s("string string"), ss; 46 | oa & YAS_OBJECT_NVP("obj", ("s", s)); 47 | 48 | typename archive_traits::iarchive ia; 49 | archive_traits::icreate(ia, oa, archive_type); 50 | ia & YAS_OBJECT_NVP("obj", ("s", ss)); 51 | 52 | if ( s != ss ) { 53 | YAS_TEST_REPORT(log, archive_type, test_name); 54 | return false; 55 | } 56 | 57 | return true; 58 | } 59 | 60 | /***************************************************************************/ 61 | 62 | #endif // __yas__tests__base__include__boost_cont_string_hpp 63 | -------------------------------------------------------------------------------- /tests/base/include/boost_cont_vector.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_cont_vector_hpp 37 | #define __yas__tests__base__include__boost_cont_vector_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool boost_cont_vector_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | boost::container::vector v, vv; 44 | v.push_back(0); 45 | v.push_back(1); 46 | v.push_back(2); 47 | v.push_back(3); 48 | v.push_back(4); 49 | v.push_back(5); 50 | v.push_back(6); 51 | v.push_back(7); 52 | v.push_back(8); 53 | v.push_back(9); 54 | 55 | typename archive_traits::oarchive oa; 56 | archive_traits::ocreate(oa, archive_type); 57 | oa & YAS_OBJECT_NVP("obj", ("v", v)); 58 | 59 | typename archive_traits::iarchive ia; 60 | archive_traits::icreate(ia, oa, archive_type); 61 | ia & YAS_OBJECT_NVP("obj", ("v", vv)); 62 | 63 | if ( v != vv ) { 64 | YAS_TEST_REPORT(log, archive_type, test_name); 65 | return false; 66 | } 67 | 68 | return true; 69 | } 70 | 71 | /***************************************************************************/ 72 | 73 | #endif // __yas__tests__base__include__boost_cont_vector_hpp 74 | -------------------------------------------------------------------------------- /tests/base/include/boost_cont_wstring.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_cont_wstring_hpp 37 | #define __yas__tests__base__include__boost_cont_wstring_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool boost_cont_wstring_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | boost::container::wstring ws(L"wstring wstring"), wss; 44 | 45 | typename archive_traits::oarchive oa; 46 | archive_traits::ocreate(oa, archive_type); 47 | oa & YAS_OBJECT_NVP("obj", ("ws", ws)); 48 | 49 | typename archive_traits::iarchive ia; 50 | archive_traits::icreate(ia, oa, archive_type); 51 | ia & YAS_OBJECT_NVP("obj", ("ws", wss)); 52 | 53 | if ( ws != wss ) { 54 | YAS_TEST_REPORT(log, archive_type, test_name); 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | 61 | /***************************************************************************/ 62 | 63 | #endif // __yas__tests__base__include__boost_cont_wstring_hpp 64 | -------------------------------------------------------------------------------- /tests/base/include/boost_fusion_map.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_fusion_map_hpp 37 | #define __yas__tests__base__include__boost_fusion_map_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool boost_fusion_map_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | ((void)log); 44 | ((void)archive_type); 45 | ((void)test_name); 46 | 47 | return true; 48 | } 49 | 50 | /***************************************************************************/ 51 | 52 | #endif // __yas__tests__base__include__boost_fusion_map_hpp 53 | -------------------------------------------------------------------------------- /tests/base/include/boost_fusion_set.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_fusion_set_hpp 37 | #define __yas__tests__base__include__boost_fusion_set_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool boost_fusion_set_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | ((void)log); 44 | ((void)archive_type); 45 | ((void)test_name); 46 | 47 | return true; 48 | } 49 | 50 | /***************************************************************************/ 51 | 52 | #endif // __yas__tests__base__include__boost_fusion_set_hpp 53 | -------------------------------------------------------------------------------- /tests/base/include/boost_string_view.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__boost_string_view_hpp 37 | #define __yas__tests__base__include__boost_string_view_hpp 38 | 39 | #include 40 | 41 | /***************************************************************************/ 42 | 43 | template 44 | bool boost_string_view_test(std::ostream &log, const char *archive_type, const char *test_name) { 45 | typename archive_traits::oarchive oa; 46 | archive_traits::ocreate(oa, archive_type); 47 | boost::string_view s("发送日期 string"); 48 | oa & YAS_OBJECT_NVP("obj", ("s", s)); 49 | 50 | typename archive_traits::iarchive ia; 51 | archive_traits::icreate(ia, oa, archive_type); 52 | std::string ss; 53 | ia & YAS_OBJECT_NVP("obj", ("s", ss)); 54 | 55 | if ( ss.compare(0, s.length(), s.data()) ) { 56 | YAS_TEST_REPORT(log, archive_type, test_name); 57 | return false; 58 | } 59 | 60 | return true; 61 | } 62 | 63 | /***************************************************************************/ 64 | 65 | #endif // __yas__tests__base__include__boost_string_view_hpp 66 | -------------------------------------------------------------------------------- /tests/base/include/endian.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__endian_hpp 37 | #define __yas__tests__base__include__endian_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool endian_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | typename archive_traits::oarchive oa; 44 | archive_traits::ocreate(oa, archive_type); 45 | typename archive_traits::iarchive ia; 46 | archive_traits::icreate(ia, oa, archive_type); 47 | 48 | if ( ia->is_big_endian() != oa->is_big_endian() ) { 49 | YAS_TEST_REPORT(log, archive_type, test_name); 50 | return false; 51 | } 52 | 53 | if ( ia->is_little_endian() != oa->is_little_endian() ) { 54 | YAS_TEST_REPORT(log, archive_type, test_name); 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | 61 | /***************************************************************************/ 62 | 63 | #endif // __yas__tests__base__include__endian_hpp 64 | -------------------------------------------------------------------------------- /tests/base/include/pair.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__pair_hpp 37 | #define __yas__tests__base__include__pair_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool pair_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | std::pair p = std::make_pair(L"wstring wstring", "string string"), pp; 44 | 45 | typename archive_traits::oarchive oa; 46 | archive_traits::ocreate(oa, archive_type); 47 | oa & YAS_OBJECT_NVP("obj", ("p", p)); 48 | 49 | typename archive_traits::iarchive ia; 50 | archive_traits::icreate(ia, oa, archive_type); 51 | ia & YAS_OBJECT_NVP("obj", ("p", pp)); 52 | 53 | if ( p != pp ) { 54 | YAS_TEST_REPORT(log, archive_type, test_name); 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | 61 | /***************************************************************************/ 62 | 63 | #endif // __yas__tests__base__include__pair_hpp 64 | -------------------------------------------------------------------------------- /tests/base/include/qbytearray.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__qbytearray_hpp 37 | #define __yas__tests__base__include__qbytearray_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool qbytearray_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | QByteArray srcbuf{"some string"}; 44 | typename archive_traits::oarchive oa; 45 | archive_traits::ocreate(oa, archive_type); 46 | oa & YAS_OBJECT_NVP("obj", ("p", srcbuf)); 47 | 48 | QByteArray dstbuf; 49 | typename archive_traits::iarchive ia; 50 | archive_traits::icreate(ia, oa, archive_type); 51 | ia & YAS_OBJECT_NVP("obj", ("p", dstbuf)); 52 | 53 | if ( srcbuf != dstbuf ) { 54 | YAS_TEST_REPORT(log, archive_type, test_name); 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | 61 | /***************************************************************************/ 62 | 63 | #endif // __yas__tests__base__include__qbytearray_hpp 64 | -------------------------------------------------------------------------------- /tests/base/include/qstringlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__qstringlist_hpp 37 | #define __yas__tests__base__include__qstringlist_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool qstringlist_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | QStringList slist1, slist2; 44 | slist1.push_back("23"); 45 | slist1.push_back("54"); 46 | slist1.push_back("91"); 47 | slist1.push_back("246"); 48 | slist1.push_back("976"); 49 | 50 | typename archive_traits::oarchive oa2; 51 | archive_traits::ocreate(oa2, archive_type); 52 | oa2 & YAS_OBJECT_NVP("obj", ("list", slist1)); 53 | 54 | typename archive_traits::iarchive ia2; 55 | archive_traits::icreate(ia2, oa2, archive_type); 56 | ia2 & YAS_OBJECT_NVP("obj", ("list", slist2)); 57 | 58 | if ( slist1 != slist2 ) { 59 | YAS_TEST_REPORT(log, archive_type, test_name); 60 | return false; 61 | } 62 | 63 | return true; 64 | } 65 | 66 | /***************************************************************************/ 67 | 68 | #endif // __yas__tests__base__include__qstringlist_hpp 69 | -------------------------------------------------------------------------------- /tests/base/include/std_streams.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__std_streams_hpp 37 | #define __yas__tests__base__include__std_streams_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool std_streams_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | std::ostringstream os; 44 | yas::std_ostream_adapter osadapter(os); 45 | yas::binary_oarchive oa(osadapter); 46 | 47 | std::uint32_t i=33, ii=0; 48 | oa & YAS_OBJECT_NVP("obj", ("i", i)); 49 | 50 | std::istringstream is(os.str()); 51 | yas::std_istream_adapter isadapter(is); 52 | yas::binary_iarchive ia(isadapter); 53 | ia & YAS_OBJECT_NVP("obj", ("i", ii)); 54 | 55 | if ( i != ii ) { 56 | YAS_TEST_REPORT(log, archive_type, test_name); 57 | } 58 | 59 | return true; 60 | } 61 | 62 | /***************************************************************************/ 63 | 64 | #endif // __yas__tests__base__include__std_streams_hpp 65 | -------------------------------------------------------------------------------- /tests/base/include/string_view.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__tests__base__include__string_view_hpp 37 | #define __yas__tests__base__include__string_view_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | template 42 | bool string_view_test(std::ostream &log, const char *archive_type, const char *test_name) { 43 | #if __cplusplus >= 201703L 44 | typename archive_traits::oarchive oa; 45 | archive_traits::ocreate(oa, archive_type); 46 | std::string_view s("发送日期 string"); 47 | oa & YAS_OBJECT_NVP("obj", ("s", s)); 48 | 49 | typename archive_traits::iarchive ia; 50 | archive_traits::icreate(ia, oa, archive_type); 51 | std::string ss; 52 | ia & YAS_OBJECT_NVP("obj", ("s", ss)); 53 | 54 | if ( ss != s ) { 55 | YAS_TEST_REPORT(log, archive_type, test_name); 56 | return false; 57 | } 58 | #else 59 | (void)log; 60 | (void)archive_type; 61 | (void)test_name; 62 | #endif // __cplusplus >= 201703L 63 | 64 | return true; 65 | } 66 | 67 | /***************************************************************************/ 68 | 69 | #endif // __yas__tests__base__include__string_view_hpp 70 | -------------------------------------------------------------------------------- /tests/base/test.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2010-2023 niXman (github dot nixman at pm dot me). All 3 | // rights reserved. 4 | // 5 | // This file is part of YAS(https://github.com/niXman/yas) project. 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // 11 | // 12 | // Boost Software License - Version 1.0 - August 17th, 2003 13 | // 14 | // Permission is hereby granted, free of charge, to any person or organization 15 | // obtaining a copy of the software and accompanying documentation covered by 16 | // this license (the "Software") to use, reproduce, display, distribute, 17 | // execute, and transmit the Software, and to prepare derivative works of the 18 | // Software, and to permit third-parties to whom the Software is furnished to 19 | // do so, all subject to the following: 20 | // 21 | // The copyright notices in the Software and this entire statement, including 22 | // the above license grant, this restriction and the following disclaimer, 23 | // must be included in all copies of the Software, in whole or in part, and 24 | // all derivative works of the Software, unless such copies or derivative 25 | // works are solely in the form of machine-executable object code generated by 26 | // a source language processor. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 31 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 32 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 33 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | // DEALINGS IN THE SOFTWARE. 35 | 36 | #ifndef __yas__base_test__test_hpp 37 | #define __yas__base_test__test_hpp 38 | 39 | /***************************************************************************/ 40 | 41 | #define YAS_TEST_REPORT(log, artype, testname) \ 42 | log << __FILE__ << "(" << __LINE__ << "): " << "archive: \"" << artype << "\", test: \"" << testname << "\" failed!" << std::endl; 43 | 44 | #define YAS_TEST_REPORT_IF(expr, log, artype, testname, ...) \ 45 | if ( (expr) ) { YAS_TEST_REPORT(log, artype, testname); __VA_ARGS__; } 46 | 47 | /***************************************************************************/ 48 | 49 | #endif // __yas__base_test__test_hpp 50 | --------------------------------------------------------------------------------