Class CoreFoundation


  • public class CoreFoundation
    extends java.lang.Object
    Native bindings to <CoreFoundation.h>.
    • Method Detail

      • nCFRetain

        public static long nCFRetain​(long cf)
        Unsafe version of: CFRetain(long)
      • CFRetain

        public static long CFRetain​(long cf)
        Retains a Core Foundation object.

        You should retain a Core Foundation object when you receive it from elsewhere (that is, you did not create or copy it) and you want it to persist. If you retain a Core Foundation object you are responsible for releasing it.

        Parameters:
        cf - the CFType object to retain
      • nCFRelease

        public static void nCFRelease​(long cf)
        Unsafe version of: CFRelease(long)
      • CFRelease

        public static void CFRelease​(long cf)
        Releases a Core Foundation object.

        If the retain count of cf becomes zero the memory allocated to the object is deallocated and the object is destroyed. If you create, copy, or explicitly retain (see the CFRetain(long) function) a Core Foundation object, you are responsible for releasing it when you no longer need it.

        Parameters:
        cf - the CFType object to release
      • nCFBundleCreate

        public static long nCFBundleCreate​(long allocator,
                                           long bundleURL)
        Unsafe version of: CFBundleCreate(long, long)
      • CFBundleCreate

        public static long CFBundleCreate​(long allocator,
                                          long bundleURL)
        Creates a CFBundle object.
        Parameters:
        allocator - the allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
        bundleURL - the location of the bundle for which to create a CFBundle object
      • CFBundleGetBundleWithIdentifier

        public static long CFBundleGetBundleWithIdentifier​(long bundleID)
        Locates a bundle given its program-defined identifier.
        Parameters:
        bundleID - the identifier of the bundle to locate. Note that identifier names are case-sensitive.
      • CFBundleGetFunctionPointerForName

        public static long CFBundleGetFunctionPointerForName​(long bundle,
                                                             long functionName)
        Returns a pointer to a function in a bundle’s executable code using the function name as the search key.
        Parameters:
        bundle - the bundle to examine
        functionName - the name of the function to locate
      • CFURLCreateWithFileSystemPath

        public static long CFURLCreateWithFileSystemPath​(long allocator,
                                                         long filePath,
                                                         long pathStyle,
                                                         boolean isDirectory)
        Creates a CFURL object using a local file system path string.
        Parameters:
        allocator - the allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
        filePath - the path string to convert to a CFURL object. If filePath is not absolute, the resulting URL will be considered relative to the current working directory (evaluated when this function is being invoked).
        pathStyle - the operating system path style used in filePath. One of:
        kCFURLPOSIXPathStylekCFURLHFSPathStylekCFURLWindowsPathStyle
        isDirectory - a Boolean value that specifies whether filePath is treated as a directory path when resolving against relative path components. Pass true if the pathname indicates a directory, false otherwise.