{"id":13755823,"url":"https://github.com/evilncrazy/ctoml","last_synced_at":"2025-05-10T02:33:05.936Z","repository":{"id":149973510,"uuid":"8403055","full_name":"evilncrazy/ctoml","owner":"evilncrazy","description":"Fast TOML parser written in C++","archived":false,"fork":false,"pushed_at":"2013-12-16T21:53:45.000Z","size":140,"stargazers_count":35,"open_issues_count":3,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-16T10:32:17.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/mojombo/toml","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/evilncrazy.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}},"created_at":"2013-02-25T05:40:42.000Z","updated_at":"2023-12-23T08:43:06.000Z","dependencies_parsed_at":"2023-04-02T13:21:01.691Z","dependency_job_id":null,"html_url":"https://github.com/evilncrazy/ctoml","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/evilncrazy%2Fctoml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilncrazy%2Fctoml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilncrazy%2Fctoml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilncrazy%2Fctoml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evilncrazy","download_url":"https://codeload.github.com/evilncrazy/ctoml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253354489,"owners_count":21895436,"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-08-03T11:00:30.801Z","updated_at":"2025-05-10T02:33:05.631Z","avatar_url":"https://github.com/evilncrazy.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"Ctoml\n=====\n\nA statically typed parser for @mojombo's TOML, written in C++11. Currently supports commit c6ea50d of the TOML spec, with a few exceptions:\n\n* Unicode support for strings\n* Null characters ('\\0') in string literals\n\nUsage\n=====\n\n```c\n#include \"toml.h\"\n\n#include \u003ciostream\u003e\n\nusing namespace ctoml;\n\nint main() {\n\tTomlParser toml(\"example.toml\");\n\tauto doc = toml.parse();\n\n\t// Get the value of a key\n\tauto val = doc.get(\"potatoe.cake\");\n\n\t// You can print it out\n\tstd::cout \u003c\u003c val-\u003eto_string() \u003c\u003c std::endl;\n\n\t// Or check equality\n\tif (val-\u003eequals(\"foobar\")) {\n\t\t// ....\n\t}\n\n\t// To use the primitive value of a key, you can do:\n\tstd::cout \u003c\u003c doc.get_as\u003cfloat\u003e(\"pi\") * 2 \u003c\u003c std::endl;\n\n\t// We can iterate through all the keys\n\tfor (auto it = doc.cbegin(); it != doc.cend(); ++it) {\n\t\tstd::cout \u003c\u003c it-\u003efirst \u003c\u003c \" = \" \u003c\u003c it-\u003esecond-\u003eto_string() \u003c\u003c std::endl;\n\t}\n\n\t// We can modify the document on the fly\n\tdoc.set(\"title\", TomlValue::create_string(\"Hello world!\"));\n\n\t// You can even write the document to a stream\n\tdoc.write(std::cout);\n}\n```\n\nCommand line tool\n=================\n\nA command line tool that parses TOML is provided (src/main.cc). It can take a file as input. If the parse is successful, it spews out every key and its value.\n\n```\n./ctoml \"path/to/file\"\n```\n\nLicence\n=======\nThis software is released under the MIT licence (see LICENCE).\n\nTodo\n====\n\n* Needs more powerful write to stream methods\n\t* Write only certain key groups to a stream","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilncrazy%2Fctoml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilncrazy%2Fctoml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilncrazy%2Fctoml/lists"}