Mac Developer Library

Developer

DRContentFolder.h Reference

Options
Deployment Target:

On This Page

DRContentFolder.h Reference

Interface to folder objects used in filesystem creation.

Included Headers

  • <DiscRecording/DRContentObject.h>

  • <CoreFoundation/CFURL.h>

  • <AvailabilityMacros.h>

Functions

  • Adds a file or folder object reference as a child of a virtual folder object.

    This function applies only to virtual folders. Real folders are considered "leaf nodes" and cannot have children.

    Declaration

    extern void DRFolderAddChild( DRFolderRef parent, DRFSObjectRef newChild) ;

    Parameters

    parent

    A reference to the folder that will be the new parent.

    newChild

    A reference to the file or folder object that will be the new child.

  • Converts a real folder to a virtual folder. Conversion happens in-place so there is no need to release or reallocate any objects.

    Declaration

    extern void DRFolderConvertRealToVirtual( DRFolderRef realFolder) ;

    Parameters

    realFolder

    A reference to the folder object to convert. The caller should pass in a reference to a real folder. On success it will have been converted to a virtual folder.

    Discussion

    The virtual folder created in this way is a snapshot of the on-disk folder at the moment of the call. The newly-created virtual folder will contain real folder and file objects corresponding to the on-disk children of the original on-disk folder.

    If the on-disk folder attributes change, or if children are added to or removed from the on-disk tree during this call, the virtual folder may or may not reflect the changes. It the on-disk attributes change after this call, the virtual folder will not reflect the changes.

  • Obtains an array containing the children of a virtual folder.

    Declaration

    extern CFArrayRef DRFolderCopyChildren( const DRFolderRef folder) ;

    Parameters

    folder

    The folder reference to query.

    Return Value

    Returns a CFArray object containing the virtual folder's children.

    Discussion

    The order of the children in the array is arbitrary; the various files systems being generated for a burn may have different sorting requirements, so there is no one definitive sort order. The ordering will change only when children are added or removed.

    Your application should sort the children consistently and according to the needs of your user interface.

    This function applies only to virtual folders. Real folders are considered "leaf nodes" and should not be passed to this call.

  • Obtains the number of children of a virtual folder.

    Declaration

    extern UInt32 DRFolderCountChildren( const DRFolderRef folder) ;

    Parameters

    folder

    The folder reference to query.

    Return Value

    Returns the number of children.

    Discussion

    This function applies only to virtual folders. Real folders are considered "leaf nodes" and should not be passed to this call.

  • Creates a new real folder object corresponding to a given FSRef object.

    Declaration

    extern DRFolderRef DRFolderCreateReal( const FSRef *fsRef) ;

    Parameters

    fsRef

    A file-system reference to an on-disk folder.

    Return Value

    Returns a reference to the newly-created folder object, or NULL.

    Discussion

    A real folder object is a folder object corresponding to a real folder on disk. The content of the folder object corresponds to the actual on-disk content of the folder. Items cannot be programatically added to or removed from a real folder object without making it virtual first -- see DRFolderConvertRealToVirtual .

  • Creates a new real folder object corresponding to a given file URL.

    Declaration

    extern DRFolderRef DRFolderCreateRealWithURL( const CFURLRef urlRef) ;

    Parameters

    urlRef

    A URL reference to an on-disk folder.

    Return Value

    Returns a reference to the newly-created folder object, or NULL.

    Discussion

    A real folder object is a folder object corresponding to a real folder on disk. The contents of the folder object corresponds to the actual on-disk contents of the folder. Items cannot be programatically added to or removed from a real folder object without making it virtual first -- see DRFolderConvertRealToVirtual .

  • Creates a new, empty virtual folder object.

    Declaration

    extern DRFolderRef DRFolderCreateVirtual( CFStringRef baseName) ;

    Parameters

    baseName

    The base name to assign to the new virtual folder. For information on base names and how Disc Recording works with them, see DRFSObjectSetBaseName and DRFSObjectSetSpecificName .

    Return Value

    Returns a reference to the newly-created virtual folder object, or NULL.

    Discussion

    A virtual folder object is a folder object which does not correspond to any real folder on disk, but represents a folder you want to appear in the file structure of the disc you are burning. It is created and modified using Disc Recording's 'content' functions -- see the documentation for DRContentObject.h.

  • Returns the type identifier of all DRFolder instances.

    Declaration

    extern CFTypeID DRFolderGetTypeID( void) ;

  • Removes a file or folder object reference so a file or folder is no longer a child of the specified folder object.

    This function applies only to virtual folders. Real folders are considered "leaf nodes" and cannot have children.

    Declaration

    extern void DRFolderRemoveChild( DRFolderRef parent, DRFSObjectRef child) ;

    Parameters

    parent

    A reference to the folder that will no longer be the parent of the child object.

    child

    A reference to the file or folder object that will no longer be a child of the parent object.