iOS Developer Library

Developer

Core Foundation Framework Reference CFBitVector Reference

Options
Deployment Target:

On This Page
Language:

CFBitVector Reference

CFBitVector and its derived mutable type, CFMutableBitVector, manage ordered collections of bit values, which are either 0 or 1. CFBitVector creates static bit vectors and CFMutableBitVector creates dynamic bit vectors.

Functions

  • Creates an immutable bit vector from a block of memory.

    Declaration

    Swift

    func CFBitVectorCreate(_ allocator: CFAllocator!, _ bytes: UnsafePointer<UInt8>, _ numBits: CFIndex) -> CFBitVector!

    Objective-C

    CFBitVectorRef CFBitVectorCreate ( CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits );

    Parameters

    allocator

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

    bytes

    A pointer to the bit values to store in the new bit vector. The values are copied into the bit vector’s own memory. The bit indices are numbered left-to-right with 0 being the left-most, or most-significant, bit in the byte stream.

    numBits

    The number of bits in the bit vector.

    Return Value

    A new bit vector. Ownership follows the Create Rule.

    Availability

    Available in iOS 2.0 and later.

  • Creates an immutable bit vector that is a copy of another bit vector.

    Declaration

    Swift

    func CFBitVectorCreateCopy(_ allocator: CFAllocator!, _ bv: CFBitVector!) -> CFBitVector!

    Objective-C

    CFBitVectorRef CFBitVectorCreateCopy ( CFAllocatorRef allocator, CFBitVectorRef bv );

    Parameters

    allocator

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

    bv

    The bit vector to copy.

    Return Value

    A new bit vector holding the same bit values as bv. Ownership follows the Create Rule.

    Availability

    Available in iOS 2.0 and later.

  • Returns the type identifier for the CFBitVector opaque type.

    Declaration

    Swift

    func CFBitVectorGetTypeID() -> CFTypeID

    Objective-C

    CFTypeID CFBitVectorGetTypeID ( void );

    Return Value

    The type identifier for the CFBitVector opaque type.

    Discussion

    CFMutableBitVector objects have the same type identifier as CFBitVector objects.

    Availability

    Available in iOS 2.0 and later.

Data Types

Miscellaneous

  • A binary value of either 0 or 1.

    Declaration

    Swift

    typealias CFBit = UInt32

    Objective-C

    typedef UInt32 CFBit;

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • A reference to an immutable bit vector object.

    Declaration

    Swift

    class CFBitVector { }

    Objective-C

    typedef const struct __CFBitVector *CFBitVectorRef;

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.