Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,21 @@
include "NSLog.incl"
local fn DoIt
ErrorRef err = NULL
CFStringRef jsonString = @"{ \"foo\": 1, \"bar\": [10, \"apples\"] }"
CFDataRef strData = fn StringData( jsonString, NSUTF8StringEncoding )
CFTypeRef jsonObj = fn JSONSerializationJSONObjectWithData( strData, NULL, @err )
if err then NSLog( @"%@", fn ErrorLocalizedDescription( err ) )
NSLog( @"%@\n", jsonObj )
CfDictionaryRef dict = @{ @"blue": @[@1, @2], @"ocean": @"water"}
CFDataRef jsonData = fn JSONSerializationDataWithJSONObject( dict, 0, @err )
if err then NSLog( @"%@", fn ErrorLocalizedDescription( err ) )
CFStringRef jsonString2 = fn StringWithData( jsonData, NSUTF8StringEncoding )
NSLog( @"%@\n", jsonString2 )
end fn
fn DoIt
HandleEvents