CFStringCreateMutable

Header: CFString.h Carbon status: Supported

Creates an empty mutable CFString object.

CFMutableStringRef CFStringCreateMutable (
    CFAllocatorRef alloc, 
    CFIndex maxLength
);
Parameter descriptions
alloc

Pass a reference to an allocator used for creating the object or pass NULL to request the default allocator.

maxLength

Pass an integer of type CFIndex to specify the maximum number of Unicode characters that can be stored by this mutable object. Pass zero if there should be no character limit. Note that initially the string still has a length of zero; this parameter simply specifies what the maximum size is. CFString might try to optimize its internal storage by paying attention to this value.

function result

A reference to a mutable CFString object that has no character content or NULL if there was a problem creating the object.

DISCUSSION

The CFStringCreateMutable function creates an empty (that is, content-less) but mutable CFString object. You can add character data to this object with any of the CFStringAppend... functions, and thereafter you can insert, delete, replace, pad, and trim characters with the appropriate CFString functions. If the maxLength parameter is greater than zero, any attempt to add characters beyond this limit results in a run-time error.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)