{"id":16603912,"url":"https://github.com/greedysky/json_archive","last_synced_at":"2025-03-21T13:32:52.605Z","repository":{"id":83475618,"uuid":"195540856","full_name":"Greedysky/json_archive","owner":"Greedysky","description":"boost json archive(input/output) for boost::serialization ","archived":false,"fork":false,"pushed_at":"2024-12-05T01:38:09.000Z","size":186,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T06:51:13.836Z","etag":null,"topics":["archive","boost","c-plus-plus","json","serialization"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Greedysky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_1_0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-06T13:11:15.000Z","updated_at":"2024-12-05T01:38:13.000Z","dependencies_parsed_at":"2023-12-20T13:21:38.857Z","dependency_job_id":"c39fd01f-88a9-4be0-8a6d-1c00f7430e33","html_url":"https://github.com/Greedysky/json_archive","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greedysky%2Fjson_archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greedysky%2Fjson_archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greedysky%2Fjson_archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greedysky%2Fjson_archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Greedysky","download_url":"https://codeload.github.com/Greedysky/json_archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244141580,"owners_count":20404835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archive","boost","c-plus-plus","json","serialization"],"created_at":"2024-10-12T00:53:52.157Z","updated_at":"2025-03-21T13:32:52.599Z","avatar_url":"https://github.com/Greedysky.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Json Archive\n===========\nJson archive(input/output) for boost::serialization.\n\n## Build Dependencies\n* boost 1.64.0 or newer\n* json\n* g++ (c++11)\n\n## Build\n```bash\n  $ cmake .\n  $ make\n```\n\n## Usage\n```c++\n#include \"json_oarchive.hpp\"\n#include \"json_iarchive.hpp\"\n\n#include \u003csstream\u003e\n#include \u003ciostream\u003e\n#include \u003cboost/serialization/vector.hpp\u003e\n#include \u003cboost/serialization/shared_ptr.hpp\u003e\n\nclass Pos\n{\npublic:\n    Pos()\n        : x_(0)\n        , y_(0)\n    {\n    }\n\n    Pos(int x, int y)\n        : x_(x)\n        , y_(y)\n    {\n    }\n\nprivate:\n    int x_;\n    int y_;\n\nprivate:\n    friend class boost::serialization::access;\n    template \u003ctypename Archive\u003e\n    inline void serialize(Archive\u0026 ar, unsigned)\n    {\n        ar\n        \u0026 BOOST_SERIALIZATION_NVP(x_)\n        \u0026 BOOST_SERIALIZATION_NVP(y_);\n    }\n};\n\n\nclass Test\n{\npublic:\n    Test()\n        : struct_(3, 4)\n        , int_(1)\n        , bool_(true)\n        , double_(3.14)\n        , string_(\"Test\")\n        , int_array_({1, 1, 1})\n        , struct_array_({Pos(0, 0), Pos(1, 1), Pos(2, 2)})\n    {\n    }\n\nprivate:\n    friend class boost::serialization::access;\n    template \u003ctypename Archive\u003e\n    inline void serialize(Archive\u0026 ar, unsigned)\n    {\n        ar\n        \u0026 BOOST_SERIALIZATION_NVP(struct_)\n        \u0026 BOOST_SERIALIZATION_NVP(int_)\n        \u0026 BOOST_SERIALIZATION_NVP(bool_)\n        \u0026 BOOST_SERIALIZATION_NVP(double_)\n        \u0026 BOOST_SERIALIZATION_NVP(string_)\n        \u0026 BOOST_SERIALIZATION_NVP(int_array_)\n        \u0026 BOOST_SERIALIZATION_NVP(struct_array_);\n    }\n\n    Pos struct_;\n    int int_;\n    bool bool_;\n    double double_;\n    std::string string_;\n\n    std::vector\u003cint\u003e int_array_;\n    std::vector\u003cPos\u003e struct_array_;\n};\n\nclass TestA : public Test\n{\npublic:\n    TestA()\n        : Test()\n        , hdr_(boost::make_shared\u003cPos\u003e(6, 6))\n    {\n    }\n\nprivate:\n    friend class boost::serialization::access;\n    template \u003ctypename Archive\u003e\n    inline void serialize(Archive\u0026 ar, unsigned)\n    {\n        ar\n        \u0026 BOOST_SERIALIZATION_BASE_OBJECT_NVP(Test)\n        \u0026 BOOST_SERIALIZATION_NVP(hdr_);\n    }\n\n    boost::shared_ptr\u003cPos\u003e hdr_;\n};\n\n\nint main()\n{\n    std::stringstream stream;\n    {\n        {\n            TestA test;\n            boost::archive::json_oarchive oa(stream);\n            oa \u003c\u003c BOOST_SERIALIZATION_NVP(test);\n            std::cout \u003c\u003c stream.str() \u003c\u003c std::endl;\n        }\n\n        {\n            TestA test;\n            boost::archive::json_iarchive ia(stream);\n            ia \u003e\u003e BOOST_SERIALIZATION_NVP(test);\n        }\n    }\n}\n```\n\n## License\nBSL-1.0 License\n\n## Copyright\n * This file is part of the Json Archive project.\n * Copyright (C) 2015 - 2025 Greedysky Studio.\n * Mail: greedysky@163.com.\n\n## How To Contribute\n * Fork this project on github and make a branch. Commit in that branch, and push, then create a pull request to be reviewed and merged.\n * Create an issue if you have any problem when using project or you find a bug, etc.\n * What you can do: translation, write document, wiki, find or fix bugs, give your idea for this project etc.\n * If you want to join the project developed together, please send e-mail to me.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreedysky%2Fjson_archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreedysky%2Fjson_archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreedysky%2Fjson_archive/lists"}