{"id":13419592,"url":"https://github.com/Tencent/rapidjson","last_synced_at":"2025-03-15T05:31:43.628Z","repository":{"id":14673009,"uuid":"17391973","full_name":"Tencent/rapidjson","owner":"Tencent","description":"A fast JSON parser/generator for C++ with both SAX/DOM style API","archived":false,"fork":false,"pushed_at":"2025-02-05T13:28:08.000Z","size":30407,"stargazers_count":14585,"open_issues_count":743,"forks_count":3559,"subscribers_count":558,"default_branch":"master","last_synced_at":"2025-03-11T23:17:27.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rapidjson.org/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tencent.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-04T05:53:37.000Z","updated_at":"2025-03-11T15:34:39.000Z","dependencies_parsed_at":"2023-02-12T11:00:30.092Z","dependency_job_id":"ece875bf-daac-4180-8b1a-f4f151a428b5","html_url":"https://github.com/Tencent/rapidjson","commit_stats":{"total_commits":1904,"total_committers":221,"mean_commits":8.615384615384615,"dds":0.5147058823529411,"last_synced_commit":"f9d53419e912910fd8fa57d5705fa41425428c35"},"previous_names":["miloyip/rapidjson"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Frapidjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Frapidjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Frapidjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Frapidjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tencent","download_url":"https://codeload.github.com/Tencent/rapidjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690111,"owners_count":20331726,"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":[],"created_at":"2024-07-30T22:01:18.149Z","updated_at":"2025-03-15T05:31:43.083Z","avatar_url":"https://github.com/Tencent.png","language":"C++","readme":"![RapidJSON logo](doc/logo/rapidjson.png)\n\n![Release version](https://img.shields.io/badge/release-v1.1.0-blue.svg)\n\n## A fast JSON parser/generator for C++ with both SAX/DOM style API\n\nTencent is pleased to support the open source community by making RapidJSON available.\n\nCopyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.\n\n* [RapidJSON GitHub](https://github.com/Tencent/rapidjson/)\n* RapidJSON Documentation\n  * [English](http://rapidjson.org/)\n  * [简体中文](http://rapidjson.org/zh-cn/)\n  * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/) with downloadable PDF/EPUB/MOBI, without API reference.\n\n## Build status\n\n| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] |\n| :---------------: | :-----------------: | :-------------------: |\n| ![lin-badge]      | ![win-badge]        | ![cov-badge]          |\n\n[lin-badge]: https://travis-ci.org/Tencent/rapidjson.svg?branch=master \"Travis build status\"\n[lin-link]:  https://travis-ci.org/Tencent/rapidjson \"Travis build status\"\n[win-badge]: https://ci.appveyor.com/api/projects/status/l6qulgqahcayidrf/branch/master?svg=true \"AppVeyor build status\"\n[win-link]:  https://ci.appveyor.com/project/miloyip/rapidjson-0fdqj/branch/master \"AppVeyor build status\"\n[cov-badge]: https://coveralls.io/repos/Tencent/rapidjson/badge.svg?branch=master \"Coveralls coverage\"\n[cov-link]:  https://coveralls.io/r/Tencent/rapidjson?branch=master \"Coveralls coverage\"\n\n## Introduction\n\nRapidJSON is a JSON parser and generator for C++. It was inspired by [RapidXml](http://rapidxml.sourceforge.net/).\n\n* RapidJSON is **small** but **complete**. It supports both SAX and DOM style API. The SAX parser is only a half thousand lines of code.\n\n* RapidJSON is **fast**. Its performance can be comparable to `strlen()`. It also optionally supports SSE2/SSE4.2 for acceleration.\n\n* RapidJSON is **self-contained** and **header-only**. It does not depend on external libraries such as BOOST. It even does not depend on STL.\n\n* RapidJSON is **memory-friendly**. Each JSON value occupies exactly 16 bytes for most 32/64-bit machines (excluding text string). By default it uses a fast memory allocator, and the parser allocates memory compactly during parsing.\n\n* RapidJSON is **Unicode-friendly**. It supports UTF-8, UTF-16, UTF-32 (LE \u0026 BE), and their detection, validation and transcoding internally. For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM. It also supports surrogates and \"\\u0000\" (null character).\n\nMore features can be read [here](doc/features.md).\n\nJSON(JavaScript Object Notation) is a light-weight data exchange format. RapidJSON should be in full compliance with RFC7159/ECMA-404, with optional support of relaxed syntax. More information about JSON can be obtained at\n* [Introducing JSON](http://json.org/)\n* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange Format](https://tools.ietf.org/html/rfc7159)\n* [Standard ECMA-404: The JSON Data Interchange Format](https://www.ecma-international.org/publications/standards/Ecma-404.htm)\n\n## Highlights in v1.1 (2016-8-25)\n\n* Added [JSON Pointer](doc/pointer.md)\n* Added [JSON Schema](doc/schema.md)\n* Added [relaxed JSON syntax](doc/dom.md) (comment, trailing comma, NaN/Infinity)\n* Iterating array/object with [C++11 Range-based for loop](doc/tutorial.md)\n* Reduce memory overhead of each `Value` from 24 bytes to 16 bytes in x86-64 architecture.\n\nFor other changes please refer to [change log](CHANGELOG.md).\n\n## Compatibility\n\nRapidJSON is cross-platform. Some platform/compiler combinations which have been tested are shown as follows.\n* Visual C++ 2008/2010/2013 on Windows (32/64-bit)\n* GNU C++ 3.8.x on Cygwin\n* Clang 3.4 on Mac OS X (32/64-bit) and iOS\n* Clang 3.4 on Android NDK\n\nUsers can build and run the unit tests on their platform/compiler.\n\n## Installation\n\nRapidJSON is a header-only C++ library. Just copy the `include/rapidjson` folder to system or project's include path.\n\nAlternatively, if you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install rapidjson with CMake integration in a single command:\n* vcpkg install rapidjson\n\nRapidJSON uses following software as its dependencies:\n* [CMake](https://cmake.org/) as a general build tool\n* (optional) [Doxygen](http://www.doxygen.org) to build documentation\n* (optional) [googletest](https://github.com/google/googletest) for unit and performance testing\n\nTo generate user documentation and run tests please proceed with the steps below:\n\n1. Execute `git submodule update --init` to get the files of thirdparty submodules (google test).\n2. Create directory called `build` in rapidjson source directory.\n3. Change to `build` directory and run `cmake ..` command to configure your build. Windows users can do the same with cmake-gui application.\n4. On Windows, build the solution found in the build directory. On Linux, run `make` from the build directory.\n\nOn successful build you will find compiled test and example binaries in `bin`\ndirectory. The generated documentation will be available in `doc/html`\ndirectory of the build tree. To run tests after finished build please run `make\ntest` or `ctest` from your build tree. You can get detailed output using `ctest\n-V` command.\n\nIt is possible to install library system-wide by running `make install` command\nfrom the build tree with administrative privileges. This will install all files\naccording to system preferences.  Once RapidJSON is installed, it is possible\nto use it from other CMake projects by adding `find_package(RapidJSON)` line to\nyour CMakeLists.txt.\n\n## Usage at a glance\n\nThis simple example parses a JSON string into a document (DOM), make a simple modification of the DOM, and finally stringify the DOM to a JSON string.\n\n~~~~~~~~~~cpp\n// rapidjson/example/simpledom/simpledom.cpp`\n#include \"rapidjson/document.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include \u003ciostream\u003e\n\nusing namespace rapidjson;\n\nint main() {\n    // 1. Parse a JSON string into DOM.\n    const char* json = \"{\\\"project\\\":\\\"rapidjson\\\",\\\"stars\\\":10}\";\n    Document d;\n    d.Parse(json);\n\n    // 2. Modify it by DOM.\n    Value\u0026 s = d[\"stars\"];\n    s.SetInt(s.GetInt() + 1);\n\n    // 3. Stringify the DOM\n    StringBuffer buffer;\n    Writer\u003cStringBuffer\u003e writer(buffer);\n    d.Accept(writer);\n\n    // Output {\"project\":\"rapidjson\",\"stars\":11}\n    std::cout \u003c\u003c buffer.GetString() \u003c\u003c std::endl;\n    return 0;\n}\n~~~~~~~~~~\n\nNote that this example did not handle potential errors.\n\nThe following diagram shows the process.\n\n![simpledom](doc/diagram/simpledom.png)\n\nMore [examples](https://github.com/Tencent/rapidjson/tree/master/example) are available:\n\n* DOM API\n  * [tutorial](https://github.com/Tencent/rapidjson/blob/master/example/tutorial/tutorial.cpp): Basic usage of DOM API.\n\n* SAX API\n  * [simplereader](https://github.com/Tencent/rapidjson/blob/master/example/simplereader/simplereader.cpp): Dumps all SAX events while parsing a JSON by `Reader`.\n  * [condense](https://github.com/Tencent/rapidjson/blob/master/example/condense/condense.cpp): A command line tool to rewrite a JSON, with all whitespaces removed.\n  * [pretty](https://github.com/Tencent/rapidjson/blob/master/example/pretty/pretty.cpp): A command line tool to rewrite a JSON with indents and newlines by `PrettyWriter`.\n  * [capitalize](https://github.com/Tencent/rapidjson/blob/master/example/capitalize/capitalize.cpp): A command line tool to capitalize strings in JSON.\n  * [messagereader](https://github.com/Tencent/rapidjson/blob/master/example/messagereader/messagereader.cpp): Parse a JSON message with SAX API.\n  * [serialize](https://github.com/Tencent/rapidjson/blob/master/example/serialize/serialize.cpp): Serialize a C++ object into JSON with SAX API.\n  * [jsonx](https://github.com/Tencent/rapidjson/blob/master/example/jsonx/jsonx.cpp): Implements a `JsonxWriter` which stringify SAX events into [JSONx](https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonx.html) (a kind of XML) format. The example is a command line tool which converts input JSON into JSONx format.\n\n* Schema\n  * [schemavalidator](https://github.com/Tencent/rapidjson/blob/master/example/schemavalidator/schemavalidator.cpp) : A command line tool to validate a JSON with a JSON schema.\n\n* Advanced\n  * [prettyauto](https://github.com/Tencent/rapidjson/blob/master/example/prettyauto/prettyauto.cpp): A modified version of [pretty](https://github.com/Tencent/rapidjson/blob/master/example/pretty/pretty.cpp) to automatically handle JSON with any UTF encodings.\n  * [parsebyparts](https://github.com/Tencent/rapidjson/blob/master/example/parsebyparts/parsebyparts.cpp): Implements an `AsyncDocumentParser` which can parse JSON in parts, using C++11 thread.\n  * [filterkey](https://github.com/Tencent/rapidjson/blob/master/example/filterkey/filterkey.cpp): A command line tool to remove all values with user-specified key.\n  * [filterkeydom](https://github.com/Tencent/rapidjson/blob/master/example/filterkeydom/filterkeydom.cpp): Same tool as above, but it demonstrates how to use a generator to populate a `Document`.\n\n## Contributing\n\nRapidJSON welcomes contributions. When contributing, please follow the code below.\n\n### Issues\n\nFeel free to submit issues and enhancement requests.\n\nPlease help us by providing **minimal reproducible examples**, because source code is easier to let other people understand what happens.\nFor crash problems on certain platforms, please bring stack dump content with the detail of the OS, compiler, etc.\n\nPlease try breakpoint debugging first, tell us what you found, see if we can start exploring based on more information been prepared.\n\n### Workflow\n\nIn general, we follow the \"fork-and-pull\" Git workflow.\n\n 1. **Fork** the repo on GitHub\n 2. **Clone** the project to your own machine\n 3. **Checkout** a new branch on your fork, start developing on the branch\n 4. **Test** the change before commit, Make sure the changes pass all the tests, including `unittest` and `preftest`, please add test case for each new feature or bug-fix if needed.\n 5. **Commit** changes to your own branch\n 6. **Push** your work back up to your fork\n 7. Submit a **Pull request** so that we can review your changes\n\nNOTE: Be sure to merge the latest from \"upstream\" before making a pull request!\n\n### Copyright and Licensing\n\nYou can copy and paste the license summary from below.\n\n```\nTencent is pleased to support the open source community by making RapidJSON available.\n\nCopyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.\n\nLicensed under the MIT License (the \"License\"); you may not use this file except\nin compliance with the License. You may obtain a copy of the License at\n\nhttp://opensource.org/licenses/MIT\n\nUnless required by applicable law or agreed to in writing, software distributed \nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR \nCONDITIONS OF ANY KIND, either express or implied. See the License for the \nspecific language governing permissions and limitations under the License.\n```\n","funding_links":[],"categories":["TODO scan for Android support in followings","C++","Uncategorized","HarmonyOS","开发资源","Libraries","Objects","Real-World Projects","C/C++ 程序设计","JSON","Data Formats","File Formats","JSON ##"],"sub_categories":["Uncategorized","Windows Manager","C/C++","Saving/Loading Objects, Compositing Packets","Data Processing \u0026 Storage","网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2Frapidjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTencent%2Frapidjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2Frapidjson/lists"}