{"id":20696131,"url":"https://github.com/mirek/corejson","last_synced_at":"2025-04-22T20:43:00.562Z","repository":{"id":137252187,"uuid":"1373502","full_name":"mirek/CoreJSON","owner":"mirek","description":"Core Foundation, libyajl based JSON support.","archived":false,"fork":false,"pushed_at":"2021-12-21T22:06:31.000Z","size":298,"stargazers_count":49,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T18:41:28.706Z","etag":null,"topics":["appstore","c","fast","json-framework","mac-appstore","objective-c-library","osx","parsing"],"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/mirek.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}},"created_at":"2011-02-16T11:25:31.000Z","updated_at":"2024-05-31T15:27:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d80994a-951e-4123-b3e0-cb88d0e6c590","html_url":"https://github.com/mirek/CoreJSON","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/mirek%2FCoreJSON","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirek%2FCoreJSON/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirek%2FCoreJSON/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirek%2FCoreJSON/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirek","download_url":"https://codeload.github.com/mirek/CoreJSON/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250320793,"owners_count":21411442,"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":["appstore","c","fast","json-framework","mac-appstore","objective-c-library","osx","parsing"],"created_at":"2024-11-17T00:12:42.287Z","updated_at":"2025-04-22T20:43:00.554Z","avatar_url":"https://github.com/mirek.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoreJSON Framework\n\nCoreJSON is iOS and OSX Core Foundation based fast parser and generator based on `libyajl` C library.\n\nComparison with other JSON frameworks:\n\n![Chart](http://chart.apis.google.com/chart?chf=bg,s,67676700\u0026chxl=1:|TouchJSON|JSON+Framework|YAJL|Apple+JSON|CoreJSON|JSONKit\u0026chxr=0,0,60\u0026chxt=x,y\u0026chbh=a\u0026chs=300x165\u0026cht=bhg\u0026chco=94AAC8\u0026chds=0,237.904\u0026chd=t:46.582,63.192,128.143,129.231,154.504,237.904\u0026chtt=1+Iteration%2C+iPhone+4+iOS+4.2.1)\n\n_Tests performed with https://github.com/samsoffes/json-benchmarks_\n\n## Usage\n\nParsing in Objective-C:\n\n    NSError *error = nil;\n    id object = (id)JSONCreateWithString(NULL, (CFStringRef)@\"[foo, bar]\", kJSONReadOptionsDefault, (CFErrorRef *)\u0026error);\n    if (object) {\n      // Do something with object (NSArray)\n      [object release];\n    }\n\nParsing in C:\n\n    CFErrorRef error = NULL;\n    CFTypeRef object = JSONCreateWithString(NULL, CFSTR(\"[foo, bar]\"), kJSONReadOptionsDefault, \u0026error);\n    if (object) {\n      // Do something with object\n      CFRelease(object);\n    }\n\nGenerating in Objective-C:\n\n    NSArray *array = [NSArray arrayWithObjects: @\"foo\", @\"bar\", nil];\n    NSError *error = nil;\n    NSString *json = (id)JSONCreateString(NULL, array, kJSONWriteOptionsDefault, (CFErrorRef *)\u0026error);\n    if (json) {\n      // Do something with json string\n      [json release];\n    }\n    [array release];\n\nGenerating in C:\n\n    CFTypeRef values[] = { CFSTR(\"foo\"), CFSTR(\"bar\") };\n    CFArrayRef array = CFArrayCreateMutable(NULL, values, 2, \u0026kCFTypeArrayCallBacks);\n    CFErrorRef error = NULL;\n    CFStringRef json = JSONCreateString(NULL, array, kJSONWriteOptionsDefault, \u0026error);\n    if (json) {\n      // Do something with json string\n      CFRelease(json);\n    }\n    CFRelease(array);\n    \n_You should also take care of `error` object_\n\n## Options\n\n`JSONReadOptions`:\n\n* `kJSONReadOptionCheckUTF8                  = 1` -- Check UTF8 strings\n* `kJSONReadOptionAllowComments              = 2` -- Allow `/* comments */`\n* `kJSONReadOptionsDefault                   = 0` -- Default options (don't check UTF8 strings and do not allow comments)\n* `kJSONReadOptionsCheckUTF8AndAllowComments = 3` -- Check UTF8 strings and allow comments\n\n`JSONWriteOptions`:\n\n* `kJSONWriteOptionIndent   = 1` -- Indent generated JSON string\n* `kJSONWriteOptionsDefault = 0` -- Default options (do not indent JSON string)\n\n## Using in your projects\n\nThere are just 2 files `CoreJSON.h` and `CoreJSON.c` you'll need together with `libyajl`.\n\nFor your own (non Mac AppStore) OSX projects the quick way is to:\n\n1. `brew install yajl`\n2. add `/usr/local/lib` to `Library Search Path` and `/usr/local/include` to `Header Search Path`\n3. Just drop `CoreJSON.h` and `CoreJSON.c` to your project and have fun\n\nFor OSX and iOS (Mac AppStore/AppStore) projects you need to include `libyajl` and drop `CoreJSON.h` and `CoreJSON.c` files to your project.\nOne way to do it:\n\n1. Go to your project's directory (for which you're using `git`, right? ;) and `git submodule add git://github.com/mirek/CoreJSON.git CoreJSON`\n2. From Xcode add `CoreJSON.h` and `CoreJSON.c` files to your project\n3. If you're already using `libyajl` in your project, you are good to go. If not, add `libyajl` files\n\n## License\n\n    The MIT License\n\n    Copyright 2011 Mirek Rusin \u003cmirek [at] me [dot] com\u003e\n                   http://github.com/mirek/CoreJSON\n    \n    Permission to use, copy, modify, and/or distribute this software for any\n    purpose with or without fee is hereby granted, provided that the above\n    copyright notice and this permission notice appear in all copies.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirek%2Fcorejson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirek%2Fcorejson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirek%2Fcorejson/lists"}