Contents

CFStringSetExternalCharactersNoCopy(_:_:_:_:)

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

Declaration

func CFStringSetExternalCharactersNoCopy(_ theString: CFMutableString!, _ chars: UnsafeMutablePointer<UniChar>!, _ length: CFIndex, _ capacity: CFIndex)

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