Handbook
Glossary
CF>string ( alien -- string )
Vocabulary
core-foundation
.
strings
Inputs
alien
a
CFString
Outputs
string
a
string
Word description
Creates a Factor string from a Core Foundation string.
See also
<NSString>
,
<CFString>
Definition
USING:
accessors
alien.data
byte-vectors
core-foundation
io.encodings.string
io.encodings.utf8
kernel
math
sequences
;
IN:
core-foundation.strings
:
CF>string
( alien -- string )
dup
CFStringGetLength
[
0
swap
<CFRange>
kCFStringEncodingUTF8
0
f
]
keep
4
*
1
+
<byte-vector>
[
underlying>>
dup
length
{
CFIndex
}
[
CFStringGetBytes
drop
]
with-out-parameters
]
1check
>>length
utf8
decode
;