ADC Home > Reference Library > Reference > Audio > Carbon > Disc Recording Framework Reference

 


DRContentFolder.h

Includes:
<DiscRecording/DRContentObject.h>
<CoreFoundation/CFURL.h>
<AvailabilityMacros.h>

Overview

Interface to folder objects used in filesystem creation.



Functions

DRFolderAddChild
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.
DRFolderConvertRealToVirtual
Converts a real folder to a virtual folder. Conversion happens in-place so there is no need to release or reallocate any objects.
DRFolderCopyChildren
Obtains an array containing the children of a virtual folder.
DRFolderCountChildren
Obtains the number of children of a virtual folder.
DRFolderCreateReal
Creates a new real folder object corresponding to a given FSRef object.
DRFolderCreateRealWithURL
Creates a new real folder object corresponding to a given file URL.
DRFolderCreateVirtual
Creates a new, empty virtual folder object.
DRFolderGetTypeID
Returns the type identifier of all DRFolder instances.
DRFolderRemoveChild
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.

DRFolderAddChild


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.

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.

Availability
Introduced in Mac OS X v10.2

DRFolderConvertRealToVirtual


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

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.

Availability
Introduced in Mac OS X v10.2

DRFolderCopyChildren


Obtains an array containing the children of a virtual folder.

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.

Availability
Introduced in Mac OS X v10.2

DRFolderCountChildren


Obtains the number of children of a virtual folder.

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.

Availability
Introduced in Mac OS X v10.2

DRFolderCreateReal


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

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 .

Availability
Introduced in Mac OS X v10.2

DRFolderCreateRealWithURL


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

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 .

Availability
Introduced in Mac OS X v10.2

DRFolderCreateVirtual


Creates a new, empty virtual folder object.

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.

Availability
Introduced in Mac OS X v10.2

DRFolderGetTypeID


Returns the type identifier of all DRFolder instances.

extern CFTypeID DRFolderGetTypeID(
    void) ;  

Availability
Introduced in Mac OS X v10.2

DRFolderRemoveChild


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.

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.

Availability
Introduced in Mac OS X v10.2


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-04-01