{"id":13730383,"url":"https://github.com/nbsdx/SimpleJSON","last_synced_at":"2025-05-08T02:32:25.606Z","repository":{"id":27631457,"uuid":"31115943","full_name":"nbsdx/SimpleJSON","owner":"nbsdx","description":"Simple C++ JSON library","archived":true,"fork":false,"pushed_at":"2019-02-24T21:06:08.000Z","size":31,"stargazers_count":205,"open_issues_count":13,"forks_count":83,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-14T21:37:58.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nbsdx.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":"2015-02-21T05:03:48.000Z","updated_at":"2024-10-20T21:32:35.000Z","dependencies_parsed_at":"2022-08-28T19:41:00.174Z","dependency_job_id":null,"html_url":"https://github.com/nbsdx/SimpleJSON","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/nbsdx%2FSimpleJSON","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbsdx%2FSimpleJSON/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbsdx%2FSimpleJSON/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbsdx%2FSimpleJSON/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbsdx","download_url":"https://codeload.github.com/nbsdx/SimpleJSON/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252986966,"owners_count":21836266,"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-03T02:01:14.038Z","updated_at":"2025-05-08T02:32:25.299Z","avatar_url":"https://github.com/nbsdx.png","language":"C++","readme":"# SimpleJSON\nSimple C++ JSON library\n\n## License\nDo what the fuck you want public license\n\n## About\nSimpleJSON is a lightweight JSON library for exporting data in JSON format from C++. By taking advantage of templates and operator overloading on the backend, you're able to create and work with JSON objects right away, just as you would expect from a language such as JavaScript. SimpleJSON is a single C++ Header file, \"json.hpp\". Feel free to download this file on its own, and include it in your project. No other requirements!\n\n#### Platforms\nSimpleJSON should work on any platform; it's only requirement is a C++11 compatible compiler, as it make heavy use of the C++11 move semantics, and variadic templates. The tests are tailored for linux, but could be ported to any platform with python support and a C++11 compiler.\n\n## API\nYou can find the API [over here](API.md). For now it's just a Markdown file with C++ syntax highlighting, but it's better than nothing!\n\n## Upcoming Features\nSimpleJSON is still missing some features, which I hope to get done soon!\n* Write more test cases to cover all major components( mostly parsing )\n\nOne of the biggests goals for SimpleJSON is for it to be lightweight, and small. Having complicated logic isn't bad, but it bloats the codebase in most cases. I'd like to keep things small rather than put in big features that take a ton of space.\n\nIf you run into any bugs, or see that I'm missing a featuer, please submit an issue through GitHub and I'll respond as soon as I can!\n\n## Example\nMore examples can be found in the 'examples' directory. Check out [the API](API.md) for a full list of functions.\n\n```cpp\n#include \"json.hpp\"\n\nint main() {\n  json::JSON obj;\n  // Create a new Array as a field of an Object.\n  obj[\"array\"] = json::Array( true, \"Two\", 3, 4.0 );\n  // Create a new Object as a field of another Object.\n  obj[\"obj\"] = json::Object();\n  // Assign to one of the inner object's fields\n  obj[\"obj\"][\"inner\"] = \"Inside\";\n  \n  // We don't need to specify the type of the JSON object:\n  obj[\"new\"][\"some\"][\"deep\"][\"key\"] = \"Value\";\n  obj[\"array2\"].append( false, \"three\" );\n  \n  // We can also parse a string into a JSON object:\n  obj[\"parsed\"] = JSON::Load( \"[ { \\\"Key\\\" : \\\"Value\\\" }, false ]\" );\n  \n  std::cout \u003c\u003c obj \u003c\u003c std::endl;\n}\n```\nOutput:\n``` \n{\n  \"array\" : [true, \"Two\", 3, 4.000000],\n  \"array2\" : [false, \"three\"],\n  \"new\" : {\n    \"some\" : {\n      \"deep\" : {\n        \"key\" : \"Value\"\n      }\n    }\n  },\n  \"obj\" : {\n    \"inner\" : \"Inside\"\n  },\n  \"parsed\" : [{\n      \"Key\" : \"Value\"\n    }, false]\n}\n```\n\nThis example can also be written another way:\n```cpp\n#include \"json.hpp\"\n#include \u003ciostream\u003e\n\nusing json::JSON;\n\nint main() {\n    JSON obj = {\n        \"array\", json::Array( true, \"Two\", 3, 4.0 ),\n        \"obj\", {\n            \"inner\", \"Inside\"\n        },\n        \"new\", { \n            \"some\", { \n                \"deep\", { \n                    \"key\", \"Value\" \n                } \n            } \n        },\n        \"array2\", json::Array( false, \"three\" )\n    };\n\n    std::cout \u003c\u003c obj \u003c\u003c std::endl;\n```\nSadly, we don't have access to the : character in C++, so we can't use that to seperate key-value pairs, but by using commas, we can achieve a very similar effect. The other point you might notice, is that we have to explictly create arrays. This is a limitation of C++'s operator overloading rules, so we can't use the [] operator to define the array :( I'm looking into ways to make this smoother.\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbsdx%2FSimpleJSON","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbsdx%2FSimpleJSON","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbsdx%2FSimpleJSON/lists"}