{"id":29538695,"url":"https://github.com/estnafinema0/cpp-format","last_synced_at":"2025-07-17T05:09:58.608Z","repository":{"id":304822185,"uuid":"1017432090","full_name":"estnafinema0/cpp-format","owner":"estnafinema0","description":"C++20 header‑only library providing Python‑style numbered placeholders in format strings with strict syntax and bounds checking. ","archived":false,"fork":false,"pushed_at":"2025-07-15T11:26:16.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-16T01:35:18.035Z","etag":null,"topics":["cpp20","formatting","headeronly","stringformat","variadic-templates"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/estnafinema0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-07-10T14:20:25.000Z","updated_at":"2025-07-15T12:27:02.000Z","dependencies_parsed_at":"2025-07-16T03:42:09.748Z","dependency_job_id":"e10f6370-be6a-4fd7-b7c7-30ffdba2ea26","html_url":"https://github.com/estnafinema0/cpp-format","commit_stats":null,"previous_names":["estnafinema0/cpp-format"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/estnafinema0/cpp-format","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2Fcpp-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2Fcpp-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2Fcpp-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2Fcpp-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/estnafinema0","download_url":"https://codeload.github.com/estnafinema0/cpp-format/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2Fcpp-format/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265566786,"owners_count":23789342,"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":["cpp20","formatting","headeronly","stringformat","variadic-templates"],"created_at":"2025-07-17T05:09:56.050Z","updated_at":"2025-07-17T05:09:58.603Z","avatar_url":"https://github.com/estnafinema0.png","language":"C++","readme":"# C++20 Format String Utility\n\nHeader-only library for formatting to C++ by letting you embed numbered placeholders such as {0} and {1} directly in a template string and replace them at runtime with any types streamable into std::ostream. It enforces strict syntax validation, throwing a FormatError immediately if braces are misused, non-digit characters appear inside placeholders, or an index goes out of range, while leaving any text outside the placeholders untouched.\n\n## Example\n\n```cpp\n#include \u003ciostream\u003e\n#include \"format.hpp\"\n\nint main() {\n    try {\n        auto s = format(\"[{1}] {0} + {0} = {2}\", \"sum\", 42, 84);\n        std::cout \u003c\u003c s \u003c\u003c \"\\n\"; // prints: [42] sum + sum = 84\n    }\n    catch (const FormatError\u0026 e) {\n        std::cerr \u003c\u003c \"Formatting failed: \" \u003c\u003c e.what() \u003c\u003c '\\n';\n    }\n}\n```\n\n## Error Handling\n\nAny misuse of braces, non‑digit characters inside `{}` or references to non‑existent argument indices will immediately throw `FormatError`.\n\n## Build and Test\n\nA simple `Makefile` compiles everything under C++20 and has Google Test for unit tests.\n\n```bash\nmake        # compiles the library and tests\nmake test   # runs the full test suite\nmake clean  \n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festnafinema0%2Fcpp-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Festnafinema0%2Fcpp-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festnafinema0%2Fcpp-format/lists"}