CFStringGetPascalString(_:_:_:_:)
Copies the character contents of a CFString object to a local Pascal string buffer after converting the characters to a requested encoding.
Declaration
func CFStringGetPascalString(_ theString: CFString!, _ buffer: StringPtr!, _ bufferSize: CFIndex, _ encoding: CFStringEncoding) -> BoolParameters
- theString:
The string to examine.
- buffer:
The Pascal string buffer into which to copy the
theString. The buffer must be at leastbufferSizebytes in length. On return, contains the converted characters. If there is an error in conversion, the buffer contains only partial results. - bufferSize:
The length of the local
bufferin bytes (accounting for the length byte). - encoding:
The string encoding to which the character contents of
theStringshould be converted.
Return Value
true if the operation succeeds or false if the conversion fails or the provided buffer is too small.
Discussion
This 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 the CFStringGetPascalStringPtr(_:_:) function fails.
See Also
Accessing Characters
CFStringCreateExternalRepresentation(_:_:_:_:)CFStringGetBytes(_:_:_:_:_:_:_:_:)CFStringGetCharacterAtIndex(_:_:)CFStringGetCharacters(_:_:_:)CFStringGetCharactersPtr(_:)CFStringGetCharacterFromInlineBuffer(_:_:)CFStringGetCString(_:_:_:_:)CFStringGetCStringPtr(_:_:)CFStringGetLength(_:)CFStringGetPascalStringPtr(_:_:)CFStringGetRangeOfComposedCharactersAtIndex(_:_:)CFStringInitInlineBuffer(_:_:_:)