Core Foundation functions have names that indicate when you own a returned
object: Object-creation functions have “Create” embedded in the name, and
Object-duplication functions that have “Copy” embedded in the name. If you
own an object, it is your responsibility to relinquish ownership (using
CFRelease) when you have finished with it.
If you receive an object from any Core Foundation function other than a
creation or copy function—such as a Get function—you do not own it and cannot
be certain of the object’s life span. If you want to ensure that such an
object is not disposed of while you are using it, you must claim ownership
(with the CFRetain function).
| Modifier and Type | Class and Description |
|---|---|
| public static class | CoreFoundation.CFAllocatorRef
A reference type used in many Core Foundation parameters and function results. |
| public static class | CoreFoundation.CFArrayRef
A reference to an immutable |
| public static class | CoreFoundation.CFBooleanRef
A reference to a |
| public static class | CoreFoundation.CFDataRef
A reference to an immutable |
| public static class | CoreFoundation.CFDictionaryRef
A reference to an immutable |
| public static class | CoreFoundation.CFIndex
A wrapper for the |
| public static class | CoreFoundation.CFMutableDictionaryRef
A reference to a mutable |
| public static class | CoreFoundation.CFNumberRef
A reference to a |
| public static enum | CoreFoundation.CFNumberType
Enum of values used for |
| public static class | CoreFoundation.CFStringRef
A reference to a |
| public static class | CoreFoundation.CFTypeID
A type for unique, constant integer values that identify particular Core Foundation opaque types. |
| public static class | CoreFoundation.CFTypeRef
The |
| Modifier and Type | Field and Description |
|---|---|
| public static final CoreFoundation. | |
| public static final CoreFoundation. | |
| public static final CoreFoundation. | |
| public static final CoreFoundation. | |
| public static final CoreFoundation. | |
| public static final CoreFoundation | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final CoreFoundation. | |
| public static final CoreFoundation. |
| Modifier and Type | Method and Description |
|---|---|
| public CoreFoundation. | Returns: A reference to the default allocator for the current thread. If none has been explicitly set, returns the generic system allocator.
The default allocator can never be released, so it is not necessary
to Gets the default allocator object for the current thread. |
| public CoreFoundation. | Returns: A new immutable array containingnumValues from
values, or null if there was a problem creating the
object.The allocator to use to allocate memory for the new array and its
storage for values. Pass alloc,null or
kCFAllocatorDefault to use the current default allocator.A C array of the pointer-sized values to be in the new array. The
values in the new array are ordered in the same order in which
they appear in this C array. This value may be values, CoreFoundation.null if
numValues is 0. This C array is not changed or freed by
this function. If values is not a valid pointer to a C
array of at least numValues elements, the behavior is
undefined.The number of values to copy from the numValues,values C array into
the new array. This number will be the count of the new array—it
must not be negative or greater than the number of elements in
values.A pointer to a callBacks)CFArrayCallBacks structure initialized with
the callbacks for the array to use on each value in the
collection. The retain callback is used within this function, for
example, to retain all of the new values from the values C
array. A copy of the contents of the callbacks structure is made,
so that a pointer to a structure on the stack can be passed in or
can be reused for multiple collection creations.
This value may be Creates a new immutable array with the given values. |
| public CoreFoundation. | Returns: The number of values inarray.a theArrayCFArrayRef object.Returns the number of values currently in an array. |
| public CoreFoundation. | |
| public Pointer | Returns: The value at theidx index in theArray).The array to examine. theArray,The index of the value to retrieve. If the index is outside the
index space of idxtheArray (0 to N-1 inclusive (where N is
the count of theArray)), the behavior is undefined.Retrieves a value at a given index. |
| public CoreFoundation. | |
| public byte | Returns: 1 if the value ofbool is true, 0 otherwise.The boolean to examine. boolReturns the value of a |
| public CoreFoundation. | Returns: A string that contains a description ofcf.The cfCFType object (a generic reference of type
CFTypeRef) from which to derive a description.Returns a textual description of a Core Foundation object. |
| public CoreFoundation. | Returns: A newCFData object, or null if there was a problem
creating the object.The allocator to use to allocate memory for the new object. Pass
alloc,null or kCFAllocatorDefault to use the current
default allocator.A pointer to the byte buffer that contains the raw data to be
copied into the Data. bytes, CoreFoundation.The number of bytes in the buffer ( lengthbytes).Creates an immutable |
| public Pointer | Returns: A read-only pointer to the bytes associated withtheData.The theDataCFData object to examine.Returns a read-only pointer to the bytes of a |
| public CoreFoundation. | Returns: An index that specifies the number of bytes intheData.The theDataCFData object to examine.Returns the number of bytes contained by a |
| public CoreFoundation. | Returns: The type identifier for theCFData opaque type.
|
| public CoreFoundation. | |
| public CoreFoundation. | Returns: A new dictionary, ornull if there was a problem creating the
object.The allocator to use to allocate memory for the new string. Pass
alloc,null or kCFAllocatorDefault to use the current
default allocator.The maximum number of key-value pairs that can be contained by the
new dictionary. The dictionary starts empty and can grow to this
number of key-value pairs (and it can have less).
capacity,Pass 0 to specify that the maximum capacity is not limited. The value must not be negative. A pointer to a keyCallBacks, Pointer CFDictionaryKeyCallBacks structure
initialized with the callbacks to use to retain, release,
describe, and compare keys in the dictionary. A copy of the
contents of the callbacks structure is made, so that a pointer to
a structure on the stack can be passed in or can be reused for
multiple collection creations.
This value may be A pointer to a valueCallBacks)CFDictionaryValueCallBacks structure
initialized with the callbacks to use to retain, release,
describe, and compare values in the dictionary. A copy of the
contents of the callbacks structure is made, so that a pointer to
a structure on the stack can be passed in or can be reused for
multiple collection creations.
This value may be Creates a new mutable dictionary. |
| public CoreFoundation. | Returns: The number of key-value pairs in theDict.The dictionary to examine. theDictReturns the number of key-value pairs in a dictionary. |
| public CoreFoundation. | Returns: The type identifier for theCFDictionary opaque type.
|
| public Pointer | Returns: The value associated with key intheDict, or null if
no key-value pair matching key exists. Since null is also a
valid value in some dictionaries, use
CFDictionaryGetValueIfPresent to distinguish between a value
that is not found, and a null value.The dictionary to examine. theDict,The key for which to find a match in key)theDict. The key hash
and equal callbacks provided when the dictionary was created are
used to compare. If the hash callback was null, the key is
treated as a pointer and converted to an integer. If the equal
callback was null, pointer equality (in C, ==) is used. If
key, or any of the keys in theDict, is not
understood by the equal callback, the behavior is undefined.Returns the value associated with a given key. |
| public byte | Returns: 1 if a matching key was found, otherwise 0.The dictionary to examine. theDict,The key for which to find a match in key, PointerByReference theDict. The key hash
and equal callbacks provided when the dictionary was created are
used to compare. If the hash callback was null, the key is
treated as a pointer and converted to an integer. If the equal
callback was null, pointer equality (in C, ==) is used. If
key, or any of the keys in theDict, is not
understood by the equal callback, the behavior is undefined.A pointer to memory which, on return, is filled with the
pointer-sized value if a matching key is found. If no key match is
found, the contents of the storage pointed to by this parameter
are undefined. This value may be value)null, in which case the
value from the dictionary is not returned (but the return value of
this function still indicates whether or not the key-value pair
was present).Returns a boolean value that indicates whether a given value for a given key is in a dictionary, and returns that value indirectly if it exists. |
| public void | CFDictionarySetValue(CoreFoundation.
The dictionary to modify. If this parameter is a fixed-capacity
dictionary and it is full before this operation, and the key does
not exist in the dictionary, the behavior is undefined. theDict,The key of the value to set in key, PointerType theDict. If a key which
matches key is already present in the dictionary, only the
value for the key is changed ("add if absent, replace if
present"). If no key matches key, the key-value pair is
added to the dictionary.
If a key-value pair is added, both key and value are retained by
the dictionary, using the retain callback provided when
The value to add to or replace in value)theDict. value
is retained using the value retain callback provided when
theDict was created, and the previous value if any is
released. value must be of the type expected by the retain
and release callbacks.Sets the value corresponding to a given key. |
| public boolean | Returns: true if cf1 and cf2 are of the same type and considered equal, otherwise false.A CFType object to compare to cf2. cf1,A CFType object to compare to cf1. cf2Determines whether two Core Foundation objects are considered equal. |
| public CoreFoundation. | Returns: A number representing the reference count of {code cf}.The cfCFType object to examine.Returns the reference count of a Core Foundation object. |
| public CoreFoundation. | CFGetTypeID(CoreFoundation.
The theObjectCFData object to examine.Returns the type of a |
| public CoreFoundation. | CFGetTypeID(Pointer
The pointer to theObject)CFData object to examine.Returns the type of a |
| public CoreFoundation. | Returns: A new number with the value specified byvaluePtr.The allocator to use to allocate memory for the new object. Pass
alloc,null or kCFAllocatorDefault to use the current
default allocator.A constant that specifies the data type of the value to convert.
The ordinal value of the enum.
theType,
The A pointer to the value for the returned number object. valuePtr)Creates a |
| public CoreFoundation. | Returns: A constant that indicates the data type of the value contained in number. SeeCFNumberType for a list of possible values.The numberCFNumber object to examine.Returns the type used by a |
| public CoreFoundation. | |
| public byte | Returns: 1 if the operation was successful, otherwise 0.The number,CFNumber object to examine.A constant that specifies the data type to return. See
theType,CFNumberType for a list of possible values.On return, contains the value of valuePtr)number.Obtains the value of a |
| public void | CFRelease(CoreFoundation.
A cfCFType object to release. This value must not be
null.Releases a Core Foundation object. |
| public CoreFoundation. | Returns: The input value, {code cf}.The cfCFType object to retain. This value must not be
null.Retains a Core Foundation object. |
| public CoreFoundation. | Returns: An immutable string containingchars, or null if
there was a problem creating the object.The allocator to use to allocate memory for the new string. Pass
alloc,null or kCFAllocatorDefault to use the current
default allocator.The buffer of Unicode characters to copy into the new string. chars, CoreFoundation.The number of characters in the buffer pointed to by chars. Only
this number of characters will be copied to internal storage. lengthCreates a string from a buffer of Unicode characters. |
| public byte | Returns: 1 upon success or 0 if the conversion fails or the provided buffer is too small.The string whose contents you wish to access. theString,The C string buffer into which to copy the string. On return, the
buffer contains the converted characters. If there is an error in
conversion, the buffer contains only partial results.
bufferToFill, CoreFoundation.The buffer must be large enough to contain the converted characters and a NUL terminator. The length of bufferSize,buffer in bytes.The string encoding to which the character contents of
encoding)theString should be converted. The encoding must specify
an 8-bit encoding.Copies the character contents of a string to a local C string buffer after converting the characters to a given encoding. |
| public CoreFoundation. | Returns: The number (in terms of UTF-16 code pairs) of characters stored intheString.The string to examine. theStringReturns the number (in terms of UTF-16 code pairs) of Unicode characters in a string. |
| public CoreFoundation. | Returns: The maximum number of bytes that could be needed to represent length number of Unicode characters with the string encoding encoding, orkCFNotFound if the number exceeds Long#MAX_VALUE.The number of Unicode characters to evaluate. length,The string encoding for the number of characters specified by
length. encoding)Returns the maximum number of bytes a string of a specified length (in Unicode characters) will take up if encoded in a specified encoding. |
| public CoreFoundation. |