{"id":13424456,"url":"https://github.com/ortfero/confetti","last_synced_at":"2026-01-16T17:41:11.835Z","repository":{"id":219552459,"uuid":"253780095","full_name":"ortfero/confetti","owner":"ortfero","description":"C++17 one-header library to parse ini files with toml extensions","archived":false,"fork":false,"pushed_at":"2022-04-09T17:43:28.000Z","size":220,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-26T23:55:14.846Z","etag":null,"topics":[],"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/ortfero.png","metadata":{"files":{"readme":"README.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}},"created_at":"2020-04-07T12:01:40.000Z","updated_at":"2022-04-08T15:25:34.000Z","dependencies_parsed_at":"2024-01-28T09:53:19.903Z","dependency_job_id":null,"html_url":"https://github.com/ortfero/confetti","commit_stats":null,"previous_names":["ortfero/confetti"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortfero%2Fconfetti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortfero%2Fconfetti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortfero%2Fconfetti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortfero%2Fconfetti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ortfero","download_url":"https://codeload.github.com/ortfero/confetti/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775847,"owners_count":20346275,"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-31T00:00:54.575Z","updated_at":"2026-01-16T17:41:11.821Z","avatar_url":"https://github.com/ortfero.png","language":"C++","readme":"# confetti\n\nC++17 one-header library to parse ini files with some toml extensions.\n\n\n## Info\n\n* Support for arrays, tables, inline tables\n* Keys and section names are case insensitive (downcased)\n* Keys are ASCII-only, but values can be UTF-8\n* Zero allocation parser\n* No dependencies\n\n\n## Snippets\n\n### Open config\n\n```cpp\n#include \u003ccstdio\u003e\n#include \u003cconfetti/confetti.hpp\u003e\n\nint main() {\n    confetti::result const parsed = confetti::parse(\"example.ini\");\n    if(!parsed) {\n        std::printf(\"Error at line %d: %s\\n\",\n                    parsed.line_no,\n                    parsed.error_code.message().data());\n        return -1;\n    }\n\n    return 0;\n}\n```\n\n### Read basic properties\n\n```cpp\n#include \u003coptional\u003e\n#include \u003cconfetti/confetti.hpp\u003e\n\nint main() {\n    confetti::result const parsed = confetti::parse_text(\n        \"a = -1\\n\"\n        \"b = 3.14\\n\"\n        \"c = value\\n\"\n        \"d = 'string value'\\n\"\n        \"e = false\\n\");\n    if(!parsed)\n        return -1;\n    confetti::value const\u0026 section = parsed.config[\"default\"];\n    std::optional\u003cint\u003e const a = section[\"a\"] | 0;\n    std::optional\u003cdouble\u003e const b = section[\"b\"] | 0.0;\n    std::optional\u003cstd::string\u003e const c = section[\"c\"] | \"\";\n    std::optional\u003cstd::string\u003e const d = section[\"d\"] | \"\";\n    std::optional\u003cbool\u003e const e = section[\"e\"] | false;\n    return 0;\n}\n```\n\n### Read arrays\n\n```cpp\n#include \u003coptional\u003e\n#include \u003cvector\u003e\n#include \u003cconfetti/confetti.hpp\u003e\n\nint main() {\n    confetti::result const parsed = confetti::parse_text(\n        \"[section]\\n\"\n        \"data = [1, 2, 3, 4]\\n\"\n    );\n    if(!parsed)\n        return -1;\n    confetti::value const\u0026 section = parsed.config[\"section\"];\n    std::optional\u003cstd::vector\u003cint\u003e\u003e const data = section[\"data\"] | std::vector\u003cint\u003e{};\n    return 0;\n}\n```\n\n### Read tables\n\n```cpp\n#include \u003cvector\u003e\n#include \u003cconfetti/confetti.hpp\u003e\n\nint main() {\n    confetti::result const parsed = confetti::parse_text(\n        \"[gods]\\n\"\n        \"anubis = {name = 'Anubis', sex = male}\\n\"\n    );\n    if(!parsed)\n        return -1;\n    confetti::value const\u0026 gods = parsed.config[\"gods\"];\n    confetti::value const\u0026 anubis = gods[\"anubis\"];\n    std::optional\u003cstd::string\u003e const name = anubis[\"name\"] | \"\";\n    std::optional\u003cstd::string\u003e const sex = anubis[\"sex\"] | \"\";\n    return 0;\n}\n```\n\n### Check section contains property\n\n```cpp\n#include \u003cconfetti/confetti.hpp\u003e\n\nint main() {\n    confetti::result const parsed = confetti::parse_text(\"\");\n    if(!parsed)\n        return -1;\n    bool const key_exists = parsed.config[\"default\"].contains(\"key\");\n    return 0;\n}\n```\n\n## Tests\n\nTo build tests:\n\n```shell\ncd confetti\nmkdir build\ncd build\nmeson ../tests\nninja\n```\n\n## Installation\n\nDrop `confetti/*` somewhere at include path.\n\n\n## Supported platforms and compilers\n\nconfetti requires C++ 17 compiler.\n\n\n## License\n\nconfetti licensed under [MIT license](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Configuration"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortfero%2Fconfetti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fortfero%2Fconfetti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortfero%2Fconfetti/lists"}