Function

CFStringSetExternalCharactersNoCopy

Notifies a CFMutableString object that its external backing store of Unicode characters has changed.

Declaration

void CFStringSetExternalCharactersNoCopy(CFMutableStringRef theString, UniChar *chars, CFIndex length, CFIndex capacity);

Parameters

theString

The string to act as a “wrapper” for the external backing store (chars). If this value is not a CFMutableString object, an assertion is raised.

chars

The external (client-owned) Unicode buffer acting as the backing store for theString.

length

The current length of the contents of chars (in Unicode characters).

capacity

The capacity of the Unicode buffer—that is, the total number of Unicode characters that can be stored in it before the buffer has to be grown.

Discussion

You use this function to reallocate memory for a string, if necessary, and change its references to the data in the buffer. The object must have been created with the CFStringCreateMutableWithExternalCharactersNoCopy function; see the discussion of this function for more information.

See Also

CFMutableString Miscellaneous Functions

CFStringAppend

Appends the characters of a string to those of a CFMutableString object.

CFStringAppendCharacters

Appends a buffer of Unicode characters to the character contents of a CFMutableString object.

CFStringAppendCString

Appends a C string to the character contents of a CFMutableString object.

CFStringAppendFormat

Appends a formatted string to the character contents of a CFMutableString object.

CFStringAppendFormatAndArguments

Appends a formatted string to the character contents of a CFMutableString object.

CFStringAppendPascalString

Appends a Pascal string to the character contents of a CFMutableString object.

CFStringCapitalize

Changes the first character in each word of a string to uppercase (if it is a lowercase alphabetical character).

CFStringCreateMutable

Creates an empty CFMutableString object.

CFStringCreateMutableCopy

Creates a mutable copy of a string.

CFStringCreateMutableWithExternalCharactersNoCopy

Creates a CFMutableString object whose Unicode character buffer is controlled externally.

CFStringDelete

Deletes a range of characters in a string.

CFStringFindAndReplace

Replaces all occurrences of a substring within a given range.

CFStringFold

Folds a given string into the form specified by optional flags.

CFStringInsert

Inserts a string at a specified location in the character buffer of a CFMutableString object.

CFStringLowercase

Changes all uppercase alphabetical characters in a CFMutableString to lowercase.

CFStringNormalize

Normalizes the string into the specified form as described in Unicode Technical Report #15.

CFStringPad

Enlarges a string, padding it with specified characters, or truncates the string.

CFStringReplace

Replaces part of the character contents of a CFMutableString object with another string.

CFStringReplaceAll

Replaces all characters of a CFMutableString object with other characters.

CFStringTransform

Perform in-place transliteration on a mutable string.

CFStringTrim

Trims a specified substring from the beginning and end of a CFMutableString object.

CFStringTrimWhitespace

Trims whitespace from the beginning and end of a CFMutableString object.

CFStringUppercase

Changes all lowercase alphabetical characters in a CFMutableString object to uppercase.