Function

CFStringGetCharacterFromInlineBuffer

Returns the Unicode character at a specific location in an in-line buffer.

Declaration

UniChar CFStringGetCharacterFromInlineBuffer(CFStringInlineBuffer *buf, CFIndex idx);

Parameters

buf

The initialized CFStringInlineBuffer structure in which the characters are stored. You should initialize the structure with the CFStringInitInlineBuffer function.

idx

The location of a character in the in-line buffer buf. This index is relative to the range specified when buf was created.

Return Value

A Unicode character, or 0 if a location outside the original range is specified.

Discussion

This function accesses one of the characters of a string written to an in-line buffer. It is typically called from within a loop to access each character in the buffer in sequence. You should initialize the buffer with the CFStringInitInlineBuffer function. The in-line buffer functions, along with the CFStringInlineBuffer structure, give you fast access to the characters of a CFString object. 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

Creates an “external representation” of a CFString object, that is, a CFData object.

CFStringGetBytes

Fetches a range of the characters from a string into a byte buffer after converting the characters to a specified encoding.

CFStringGetCharacterAtIndex

Returns the Unicode character at a specified location in a string.

CFStringGetCharacters

Copies a range of the Unicode characters from a string to a user-provided buffer.

CFStringGetCharactersPtr

Quickly obtains a pointer to the contents of a string as a buffer of Unicode characters.

CFStringGetCString

Copies the character contents of a string to a local C string buffer after converting the characters to a given encoding.

CFStringGetCStringPtr

Quickly obtains a pointer to a C-string buffer containing the characters of a string in a given encoding.

CFStringGetLength

Returns the number (in terms of UTF-16 code pairs) of Unicode characters in a string.

CFStringGetPascalString

Copies the character contents of a CFString object to a local Pascal string buffer after converting the characters to a requested encoding.

CFStringGetPascalStringPtr

Quickly obtains a pointer to a Pascal buffer containing the characters of a string in a given encoding.

CFStringGetRangeOfComposedCharactersAtIndex

Returns the range of the composed character sequence at a specified index.

CFStringInitInlineBuffer

Initializes an in-line buffer to use for efficient access of a CFString object's characters.