cocoa.plists: fix for recent change to cocoa binding: char* returns are now treated like void* and not like c-string
parent
edddffdadd
commit
4aaab7af34
|
@ -4,8 +4,9 @@
|
||||||
USING: strings arrays hashtables assocs sequences fry macros
|
USING: strings arrays hashtables assocs sequences fry macros
|
||||||
cocoa.messages cocoa.classes cocoa.application cocoa kernel
|
cocoa.messages cocoa.classes cocoa.application cocoa kernel
|
||||||
namespaces io.backend math cocoa.enumeration byte-arrays
|
namespaces io.backend math cocoa.enumeration byte-arrays
|
||||||
combinators alien.c-types alien.data words core-foundation
|
combinators alien.c-types alien.data words quotations
|
||||||
quotations core-foundation.data core-foundation.utilities ;
|
core-foundation core-foundation.data core-foundation.strings
|
||||||
|
core-foundation.utilities ;
|
||||||
IN: cocoa.plists
|
IN: cocoa.plists
|
||||||
|
|
||||||
: >plist ( value -- plist ) >cf -> autorelease ;
|
: >plist ( value -- plist ) >cf -> autorelease ;
|
||||||
|
@ -18,9 +19,6 @@ DEFER: plist>
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: (plist-NSString>) ( NSString -- string )
|
|
||||||
-> UTF8String ;
|
|
||||||
|
|
||||||
: (plist-NSNumber>) ( NSNumber -- number )
|
: (plist-NSNumber>) ( NSNumber -- number )
|
||||||
dup -> doubleValue dup >integer =
|
dup -> doubleValue dup >integer =
|
||||||
[ -> longLongValue ] [ -> doubleValue ] if ;
|
[ -> longLongValue ] [ -> doubleValue ] if ;
|
||||||
|
@ -55,7 +53,7 @@ ERROR: invalid-plist-object object ;
|
||||||
|
|
||||||
: plist> ( plist -- value )
|
: plist> ( plist -- value )
|
||||||
{
|
{
|
||||||
{ NSString [ (plist-NSString>) ] }
|
{ NSString [ CF>string ] }
|
||||||
{ NSNumber [ (plist-NSNumber>) ] }
|
{ NSNumber [ (plist-NSNumber>) ] }
|
||||||
{ NSData [ (plist-NSData>) ] }
|
{ NSData [ (plist-NSData>) ] }
|
||||||
{ NSArray [ (plist-NSArray>) ] }
|
{ NSArray [ (plist-NSArray>) ] }
|
||||||
|
|
Loading…
Reference in New Issue