Mac Developer Library

Developer

Core Foundation Framework Reference CFMutableCharacterSet Reference

Options
Deployment Target:

On This Page
Language:

CFMutableCharacterSet Reference

CFMutableCharacterSet manages dynamic character sets. The basic interface for managing character sets is provided by CFCharacterSet. CFMutableCharacterSet adds functions to modify the contents of a character set.

You create a mutable character set object using either the CFCharacterSetCreateMutable or CFCharacterSetCreateMutableCopy function.

CFMutableCharacterSet is “toll-free bridged” with its Cocoa Foundation counterpart, NSMutableCharacterSet. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSMutableCharacterSet * parameter, you can pass in a CFMutableCharacterSetRef, and in a function where you see a CFMutableCharacterSetRef parameter, you can pass in an NSMutableCharacterSet instance. This capability also applies to concrete subclasses of NSMutableCharacterSet. See Toll-Free Bridged Types for more information on toll-free bridging.

Functions

  • Creates a new empty mutable character set.

    Declaration

    Swift

    func CFCharacterSetCreateMutable(_ alloc: CFAllocator!) -> CFMutableCharacterSet!

    Objective-C

    CFMutableCharacterSetRef CFCharacterSetCreateMutable ( CFAllocatorRef alloc );

    Parameters

    alloc

    The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    Return Value

    A new empty mutable character set. Ownership follows the Create Rule.

    Availability

    Available in OS X v10.0 and later.

  • Creates a new mutable character set with the values from another character set.

    Declaration

    Swift

    func CFCharacterSetCreateMutableCopy(_ alloc: CFAllocator!, _ theSet: CFCharacterSet!) -> CFMutableCharacterSet!

    Objective-C

    CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy ( CFAllocatorRef alloc, CFCharacterSetRef theSet );

    Parameters

    alloc

    The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    theSet

    The character set to copy.

    Return Value

    A new mutable character set containing the same characters as theSet. Ownership follows the Create Rule.

    Availability

    Available in OS X v10.0 and later.

  • Forms an intersection of two character sets.

    Declaration

    Swift

    func CFCharacterSetIntersect(_ theSet: CFMutableCharacterSet!, _ theOtherSet: CFCharacterSet!)

    Objective-C

    void CFCharacterSetIntersect ( CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet );

    Parameters

    theSet

    The source character set, modified by intersection with theOtherSet.

    theOtherSet

    The character set with which the intersection is formed.

    Availability

    Available in OS X v10.0 and later.

  • Inverts the content of a given character set.

    Declaration

    Swift

    func CFCharacterSetInvert(_ theSet: CFMutableCharacterSet!)

    Objective-C

    void CFCharacterSetInvert ( CFMutableCharacterSetRef theSet );

    Parameters

    theSet

    The character set to invert.

    Availability

    Available in OS X v10.0 and later.

  • Forms the union of two character sets.

    Declaration

    Swift

    func CFCharacterSetUnion(_ theSet: CFMutableCharacterSet!, _ theOtherSet: CFCharacterSet!)

    Objective-C

    void CFCharacterSetUnion ( CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet );

    Parameters

    theSet

    The source character set, modified by union with theOtherSet.

    theOtherSet

    The character set with which the union is formed.

    Availability

    Available in OS X v10.0 and later.

Data Types

Miscellaneous

  • A reference to a mutable character set object.

    Declaration

    Swift

    typealias CFMutableCharacterSetRef = CFMutableCharacterSet

    Objective-C

    typedef struct __CFCharacterSet *CFMutableCharacterSetRef;

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.