Mac Developer Library

Developer

CoreFoundation Framework Reference CFMutableCharacterSet Reference

Options
Deployment Target:

On This Page
Language:

CFMutableCharacterSet Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import CoreFoundation

Objective-C

@import CoreFoundation;

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.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    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.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Adds a given range to a character set.

    Declaration

    Swift

    func CFCharacterSetAddCharactersInRange(_ theSet: CFMutableCharacterSet!, _ theRange: CFRange)

    Objective-C

    void CFCharacterSetAddCharactersInRange ( CFMutableCharacterSetRef theSet, CFRange theRange );

    Parameters

    theSet

    The character set to modify.

    theRange

    The range to add to the character set. The range is specified in 32-bits in UTF-32 format, and must lie within the valid Unicode character range (from 0x00000 to 0x10FFFF).

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Adds the characters in a given string to a character set.

    Declaration

    Swift

    func CFCharacterSetAddCharactersInString(_ theSet: CFMutableCharacterSet!, _ theString: CFString!)

    Objective-C

    void CFCharacterSetAddCharactersInString ( CFMutableCharacterSetRef theSet, CFStringRef theString );

    Parameters

    theSet

    The character set to modify.

    theString

    A string containing the characters to add to theSet.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Removes a given range of Unicode characters from a character set.

    Declaration

    Swift

    func CFCharacterSetRemoveCharactersInRange(_ theSet: CFMutableCharacterSet!, _ theRange: CFRange)

    Objective-C

    void CFCharacterSetRemoveCharactersInRange ( CFMutableCharacterSetRef theSet, CFRange theRange );

    Parameters

    theSet

    The character set to modify.

    theRange

    The range to remove from the character set. The range is specified in 32-bits in UTF-32 format, and must lie within the valid Unicode character range (from 0x00000 to 0x10FFFF).

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Removes the characters in a given string from a character set.

    Declaration

    Swift

    func CFCharacterSetRemoveCharactersInString(_ theSet: CFMutableCharacterSet!, _ theString: CFString!)

    Objective-C

    void CFCharacterSetRemoveCharactersInString ( CFMutableCharacterSetRef theSet, CFStringRef theString );

    Parameters

    theSet

    The character set to modify.

    theString

    A string containing the characters to remove from theSet.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    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.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    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.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    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.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    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.