CFStringInitInlineBuffer(_:_:_:)
Initializes an in-line buffer to use for efficient access of a CFString object’s characters.
Declaration
func CFStringInitInlineBuffer(_ str: CFString!, _ buf: UnsafeMutablePointer<CFStringInlineBuffer>!, _ range: CFRange)Parameters
- str:
The string to copy to the in-line buffer.
- buf:
The (uninitialized) Cfstringinlinebuffer structure to initialize. On return, an initialized structure that can be used in a Cfstringgetcharacterfrominlinebuffer(_:_:) function call. Typically this buffer is allocated on the stack.
- range:
The range of characters in
strto copy tobuf. The specified range must not exceed the length of the string.
Discussion
This function initializes an CFStringInlineBuffer structure that can be used for accessing the characters of a string. Once the buffer is initialized you can call the CFStringGetCharacterFromInlineBuffer(_:_:) function to access the characters in the buffer one at a time. The in-line buffer functions, along with the CFStringInlineBuffer structure, give you fast access to the characters of a string. The technique for in-line buffer access combines the convenience of one-at-a-time character access with the efficiency of bulk access.
See Also
Accessing Characters
CFStringCreateExternalRepresentation(_:_:_:_:)CFStringGetBytes(_:_:_:_:_:_:_:_:)CFStringGetCharacterAtIndex(_:_:)CFStringGetCharacters(_:_:_:)CFStringGetCharactersPtr(_:)CFStringGetCharacterFromInlineBuffer(_:_:)CFStringGetCString(_:_:_:_:)CFStringGetCStringPtr(_:_:)CFStringGetLength(_:)CFStringGetPascalString(_:_:_:_:)CFStringGetPascalStringPtr(_:_:)CFStringGetRangeOfComposedCharactersAtIndex(_:_:)