{"id":13667471,"url":"https://github.com/Nomango/configor","last_synced_at":"2025-04-26T15:32:58.772Z","repository":{"id":36982556,"uuid":"180745122","full_name":"Nomango/configor","owner":"Nomango","description":"A light weight configuration library for C++","archived":false,"fork":false,"pushed_at":"2024-05-15T07:51:50.000Z","size":707,"stargazers_count":594,"open_issues_count":4,"forks_count":69,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-04T15:11:06.376Z","etag":null,"topics":["configuration","cpp","json"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nomango.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-04-11T08:08:56.000Z","updated_at":"2025-04-02T08:10:55.000Z","dependencies_parsed_at":"2024-01-14T16:13:57.825Z","dependency_job_id":"64859eaa-d3e9-49d3-a336-5560b66a5d16","html_url":"https://github.com/Nomango/configor","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nomango%2Fconfigor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nomango%2Fconfigor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nomango%2Fconfigor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nomango%2Fconfigor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nomango","download_url":"https://codeload.github.com/Nomango/configor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251008920,"owners_count":21522198,"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":["configuration","cpp","json"],"created_at":"2024-08-02T07:00:37.699Z","updated_at":"2025-04-26T15:32:53.763Z","avatar_url":"https://github.com/Nomango.png","language":"C++","readme":"\u003cdiv align=\"center\"\u003e\n\n![logo](./assets/logo.png)\n\n\u003c!-- [![Open in VSCode](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/Nomango/configor) --\u003e\n[![Open in VSCode](https://img.shields.io/badge/open-in%20Visual%20Studio%20Code-blue)](https://open.vscode.dev/Nomango/configor)\n[![Github status](https://github.com/Nomango/configor/actions/workflows/unit_tests.yml/badge.svg?branch=master)](https://github.com/Nomango/configor/actions)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cf98f6b174fe4dd19f1e4574ac527a07)](https://www.codacy.com/gh/Nomango/configor/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Nomango/configor\u0026amp;utm_campaign=Badge_Grade)\n[![codecov](https://codecov.io/gh/Nomango/configor/branch/master/graph/badge.svg?token=OO71U89I5N)](https://codecov.io/gh/Nomango/configor)\n[![GitHub release](https://img.shields.io/github/release/nomango/configor)](https://github.com/Nomango/configor/releases/latest)\n[![GitHub license](https://img.shields.io/github/license/nomango/configor)](https://github.com/Nomango/configor/blob/master/LICENSE)\n\n为 C++11 设计的轻量级配置库\n\n[EN](./README.md) | [中文](./README-zh.md)\n\n\u003c/div\u003e\n\n## 特点\n\n- 仅头文件，低接入成本\n- STL-like，低学习成本\n- 自定义类型转换与序列化\n- 完备的 Unicode 支持\n- ASCII \u0026 宽字符支持\n\n## 快速上手\n\n创建 JSON 文档对象\n\n```cpp\njson::value j;\nj[\"integer\"] = 1;\nj[\"float\"] = 1.5;\nj[\"string\"] = \"something\";\nj[\"boolean\"] = true;\nj[\"user\"][\"id\"] = 10;\nj[\"user\"][\"name\"] = \"Nomango\";\n\njson::value j2 = json::object{\n    { \"null\", nullptr },\n    { \"integer\", 1 },\n    { \"float\", 1.3 },\n    { \"boolean\", true },\n    { \"string\", \"something\" },\n    { \"array\", json::array{ 1, 2 } },\n    { \"object\", json::object{\n        { \"key\", \"value\" },\n        { \"key2\", \"value2\" },\n    }},\n};\n```\n\n类型转换 \u0026 序列化:\n\n```cpp\nstruct User\n{\n    std::string name;\n    int age;\n\n    // 将自定义类型绑定到 configor\n    CONFIGOR_BIND(json::value, User, REQUIRED(name), OPTIONAL(age))\n};\n\n// User -\u003e json\njson::value j = User{\"John\", 18};\n// json -\u003e User\nUser u = json::object{{\"name\", \"John\"}, {\"age\", 18}};\n\n// User -\u003e string\nstd::string str = json::dump(User{\"John\", 18});\n// string -\u003e User\nUser u = json::parse(\"{\\\"name\\\": \\\"John\\\", \\\"age\\\": 18}\");\n\n// User -\u003e stream\nstd::cout \u003c\u003c json::wrap(User{\"John\", 18});\n// stream -\u003e User\nUser u;\nstd::cin \u003e\u003e json::wrap(u);\n```\n\n更多内容请到 [wiki](https://github.com/Nomango/configor/wiki) 查看。\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=nomango/configor\u0026type=Date)](https://star-history.com/#nomango/configor\u0026Date)\n\n## 计划\n\n- [x] 自定义类型转换\n- [x] Unicode 支持\n- [x] 单元测试覆盖率达到 85%\n- [ ] 完善错误信息\n- [ ] YAML 支持\n- [ ] ini 支持\n- [ ] json5 支持\n- [ ] SAX 工具\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNomango%2Fconfigor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNomango%2Fconfigor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNomango%2Fconfigor/lists"}