CFStringGetPascalString |
||||
Header: | CFString.h | Carbon status: | Supported | |
Copies the character contents of a CFString object to a local Pascal string buffer after converting the characters to a requested encoding.
Boolean CFStringGetPascalString ( CFStringRef theString, StringPtr buffer, CFIndex bufferSize, CFStringEncoding encoding );
Pass a reference to the CFString object whose character contents you wish to access.
Pass a pointer to a Pascal string buffer that you have allocated locally. The buffer must be at least bufferSize bytes in length. On return, the buffer contains the converted characters. If there is an error in conversion, the buffer contains only partial results.
Pass an integer specifying the length of the local buffer in bytes (accounting for the length byte).
Pass a constant of type CFStringEncoding that indentifies the encoding to which the character contents of the CFString object should be converted.
TRUE if the operation succeeds or FALSE if the conversion fails or the provided buffer is too small.
The CFStringGetPascalString function is useful when you need your own copy of a CFString object's character data as a Pascal string. You can also call it as a "backup" operation when a prior call to CFStringGetPascalStringPtr fails.
Supported in Carbon. Available in Carbon 1.0.2 and later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)