3 @abstract Defines the interface for the class <tt>NDResourceFork</tt>.
4 @discussion <tt>NDResourceFork</tt> allows your cocoa application create, delete, open, read, modify, and write resources; get information about them. A resource is data of any kind stored in a defined format in a file's resource fork. On intialization, <tt>NDResourceFork</tt> open the resource fork and then closes the resource for when it is deallocated.
6 @created Wed Dec 05 2001
7 @copyright © 2001 Nathan Day. All rights reserved.
10 #import <Foundation/Foundation.h>
11 #import <Carbon/Carbon.h>
15 @abstract A class to access manipulate resource forks from Cocoa.
16 @discussion <tt>NDResourceFork</tt> allows your cocoa application create, delete, open, read, modify, and write resources; get information about them. A resource is data of any kind stored in a defined format in a file's resource fork. On intialization, <tt>NDResourceFork</tt> open the resource fork and then closes the resource for when it is deallocated.
19 @interface NDResourceFork
: NSObject
22 short int fileReference
;
26 @functiongroup Creating resource fork instance
30 @method dataWithContentsOfURL:type:Id:
31 @abstract Gets resource data for a resource in the receivers resource file.
32 @discussion <tt>dataWithContentsOfType:Id:</tt> searches the receivers resource file's resource map in memory for the specified resource.
33 @param type The resource type of the resource which you wish to read data.
34 @param ID An integer that uniquely identifies the resource which you wish to read data.
35 @result Returns an <tt>NSData</tt> object if successful otherwise returns nil.
37 + (NSData
*)dataWithContentsOfURL
:(NSURL
*)URL type
:(ResType
)type Id
:(short int)ID
;
39 @method dataWithContentsOfURL:type:named:
40 @abstract Gets resource data for a resource in the receivers resource file.
41 @discussion <tt>dataWithContentsOfType:Id:</tt> searches the receivers resource file's resource map in memory for the specified resource.
42 @param type The resource type of the resource which you wish to read data.
43 @param name A name that uniquely identifies the resource which you wish to read data. Strings passed in this parameter are case-sensitive.
44 @result Returns an <tt>NSData</tt> object if successful otherwise returns nil.
46 + (NSData
*)dataWithContentsOfURL
:(NSURL
*)URL type
:(ResType
)type named
:(NSString
*)name
;
48 @method dataWithContentsOfFile:type:Id
49 @abstract Gets resource data for a resource in the receivers resource file.
50 @discussion <tt>dataWithContentsOfType:Id:</tt> searches the receivers resource file's resource map in memory for the specified resource.
51 @param type The resource type of the resource which you wish to read data.
52 @param ID An integer that uniquely identifies the resource which you wish to read data.
53 @result Returns an <tt>NSData</tt> object if successful otherwise returns nil.
55 + (NSData
*)dataWithContentsOfFile
:(NSString
*)path type
:(ResType
)type Id
:(short int)ID
;
57 @method dataWithContentsOfFile:type:named:
58 @abstract Gets resource data for a resource in the receivers resource file.
59 @discussion <tt>dataWithContentsOfType:Id:</tt> searches the receivers resource file's resource map in memory for the specified resource.
60 @param type The resource type of the resource which you wish to read data.
61 @param name A name that uniquely identifies the resource which you wish to read data. Strings passed in this parameter are case-sensitive.
62 @result Returns an <tt>NSData</tt> object if successful otherwise returns nil.
64 + (NSData
*)dataWithContentsOfFile
:(NSString
*)path type
:(ResType
)type named
:(NSString
*)name
;
66 @method resourceForkForReadingAtURL:
67 @abstract Creates and initalises a <tt>NDResourceFork</tt>.
68 @discussion Creates and intializes a <tt>NDResourceFork</tt> and opens a resource fork for reading using the file url.. The <tt>NDResourceFork</tt> resource fork is closed when the receiver is deallocated.
69 @param URL A file url specifying the name and location of the file whose resource fork is to be opened.
70 @result A <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or Create and initalise failed.
72 + (id
)resourceForkForReadingAtURL
:(NSURL
*)URL
;
74 @method resourceForkForWritingAtURL:
75 @abstract Creates and initalises a <tt>NDResourceFork</tt>.
76 @discussion Creates and intializes a <tt>NDResourceFork</tt> and opens a resource fork for writting, creating it before hand if it does not already exists, using the file url. The <tt>NDResourceFork</tt> resource fork is closed when the receiver is deallocated.
77 @param URL A file url specifying the name and location of the file whose resource fork is to be opened.
78 @result A <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or Create and initalise failed.
80 + (id
)resourceForkForWritingAtURL
:(NSURL
*)URL
;
82 @method resourceForkForReadingAtPath:
83 @abstract Creates and initalises a <tt>NDResourceFork</tt>.
84 @discussion Creates and intializes a <tt>NDResourceFork</tt> and opens a resource fork for reading using the path. The receivers resource fork is closed when the receiver is deallocated.
85 @param path A path specifying the name and location of the file whose resource fork is to be opened.
86 @result A <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or Create and initalise failed.
88 + (id
)resourceForkForReadingAtPath
:(NSString
*)path
;
90 @method resourceForkForWritingAtPath:
91 @abstract Creates and initalises a <tt>NDResourceFork</tt>.
92 @discussion Creates and intializes a <tt>NDResourceFork</tt>r and opens a resource fork for writting, creating it before hand if it does not already exists, using the path. The receivers resource fork is closed when the receiver is deallocated.
93 @param path A path specifying the name and location of the file whose resource fork is to be opened.
94 @result A <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or Create and initalise failed.
96 + (id
)resourceForkForWritingAtPath
:(NSString
*)path
;
99 @method initForReadingAtURL:
100 @abstract Initalises a <tt>NDResourceFork</tt>.
101 @discussion Intializes the receiver and opens a resource fork for reading using the file url.
102 @param URL A file url specifying the name and location of the file whose resource fork is to be opened. The receivers resource fork is closed when the receiver is deallocated.
103 @result An initialized <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or initalization failed.
105 - (id
)initForReadingAtURL
:(NSURL
*)URL
;
107 @method initForReadingAtURL:
108 @abstract Initalises a <tt>NDResourceFork</tt>.
109 @discussion Intializes the receiver and opens a resource fork for writting, creating it before hand if it does not already exists, using the file url. The receivers resource fork is closed when the receiver is deallocated.
110 @param URL A file url specifying the name and location of the file whose resource fork is to be opened.
111 @result An initialized <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or initalization failed.
113 - (id
)initForWritingAtURL
:(NSURL
*)URL
;
115 @method initForReadingAtPath:
116 @abstract Initalises a <tt>NDResourceFork</tt>.
117 @discussion Intializes the receiver and opens a resource fork for reading using the path. The receivers resource fork is closed when the receiver is deallocated.
118 @param path A path specifying the name and location of the file whose resource fork is to be opened.
119 @result An initialized <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or initalization failed.
121 - (id
)initForReadingAtPath
:(NSString
*)path
;
123 @method initForWritingAtPath:
124 @abstract Initalises a <tt>NDResourceFork</tt>.
125 @discussion Intializes the receiver and opens a resource fork for writting, creating it before hand if it does not already exists, using the path. The receivers resource fork is closed when the receiver is deallocated.
126 @param path A path specifying the name and location of the file whose resource fork is to be opened.
127 @result An initialized <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or initalization failed.
129 - (id
)initForWritingAtPath
:(NSString
*)path
;
131 @method initForPermission:AtURL:
132 @abstract Initalises a <tt>NDResourceFork</tt>.
133 @discussion Intializes the receiver and opens a resource fork for reading and/or writting using the file url. If write permission is specified, then an empty resource fork created before hand if it does not already exists. The receivers resource fork is closed when the receiver is deallocated.Possible permission values are as follows;
135 <table border=0 cellpadding=4>
136 <tr><td width=80 valign=top><tt>fsCurPerm</tt></td>
137 <td>Requests whatever permissions are currently allowed. If write access in unavailable (because the file is locked or the file is already open with write permission), then read permission is granted. Otherwise read/write permission is granted.</td></tr>
138 <tr><td valign=top><tt>fsRdPerm</tt></td>
139 <td>Requests permission to read the file.</td></tr>
140 <tr><td valign=top><tt>fsWrPerm</tt></td>
141 <td>Requests permission to write to the file. If write permission is granted, no other access paths are granted write permission. Note, however, that the File Manager does not support write-only access to a file. Thus, <tt>fsWrPerm</tt> is synonymous with <tt>fsRdWrPerm</tt> .</td></tr>
142 <tr><td valign=top><tt>fsRdWrPerm</tt></td>
143 <td>Requests exclusive read and write permission. If exclusive read/ write permission is granted, no other users are granted permission to write to the file. Other users may, however, be granted permission to read the file.</td></tr>
144 <tr><td valign=top><tt>fsRdWrShPerm</tt></td>
145 <td>Requests shared read and write permission. Shared read/ write permission allows mutliple access paths for reading and writing. This is safe only if there is some way of locking portions of the file before writing to them. Use the functions <tt>PBLockRangeSync</tt> and <tt>PBUnlockRangeSync</tt> to lock and unlock ranges of bytes within a file. On Mac OS 8 and 9, these functions are supported only on remotely mounted volumes, or on local volumes that are shareable on the network. You should check that range locking is available before requesting shared read/ write permission. On Mac OS X, range locking is available on all volumes.</td></tr>
146 <tr><td valign=top><tt>fsRdDenyPerm</tt></td>
147 <td>Requests that any other paths be prevented from having read access. A path cannot be opened if you request read permission (with the <tt>fsRdPerm</tt> constant) but some other path has requested deny-read access. Similarly, the path cannot be opened if you request deny-read permission, but some other path already has read access. This constant is used with the <tt>PBHOpenDenySync</tt> and <tt>PBHOpenRFDenySync</tt> functions.</td></tr>
148 <tr><td valign=top><tt>fsWrDenyPerm</tt></td>
149 <td>Requests that any other paths be prevented from having write access. A path cannot be opened if you request write permission (with the <tt>fsWrPerm</tt> constant) but some other path has requested deny-write access. Similarly, the path cannot be opened if you request deny-write permission, but some other path already has write access. This constant is used with the <tt>PBHOpenDenySync</tt> and <tt>PBHOpenRFDenySync</tt> functions.</td></tr>
152 @param permission read/write permissions for the opened resource fork.
153 @param URL A file url specifying the name and location of the file whose resource fork is to be opened.
154 @result An initialized <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or initalization failed.
156 - (id
)initForPermission
:(char)permission AtURL
:(NSURL
*)URL
;
158 @method initForPermission:AtPath:
159 @abstract Initalises a <tt>NDResourceFork</tt>.
160 @discussion Intializes the receiver and opens a resource fork for reading and/or writting using the path. If write permission is specified, then an empty resource fork created before hand if it does not already exists. The receivers resource fork is closed when the receiver is deallocated. Possible permission values are as follows;
162 <table border=0 cellpadding=4>
163 <tr><td width=80 valign=top><tt>fsCurPerm</tt></td>
164 <td>Requests whatever permissions are currently allowed. If write access in unavailable (because the file is locked or the file is already open with write permission), then read permission is granted. Otherwise read/write permission is granted.</td></tr>
165 <tr><td valign=top><tt>fsRdPerm</tt></td>
166 <td>Requests permission to read the file.</td></tr>
167 <tr><td valign=top><tt>fsWrPerm</tt></td>
168 <td>Requests permission to write to the file. If write permission is granted, no other access paths are granted write permission. Note, however, that the File Manager does not support write-only access to a file. Thus, <tt>fsWrPerm</tt> is synonymous with <tt>fsRdWrPerm</tt> .</td></tr>
169 <tr><td valign=top><tt>fsRdWrPerm</tt></td>
170 <td>Requests exclusive read and write permission. If exclusive read/ write permission is granted, no other users are granted permission to write to the file. Other users may, however, be granted permission to read the file.</td></tr>
171 <tr><td valign=top><tt>fsRdWrShPerm</tt></td>
172 <td>Requests shared read and write permission. Shared read/ write permission allows mutliple access paths for reading and writing. This is safe only if there is some way of locking portions of the file before writing to them. Use the functions <tt>PBLockRangeSync</tt> and <tt>PBUnlockRangeSync</tt> to lock and unlock ranges of bytes within a file. On Mac OS 8 and 9, these functions are supported only on remotely mounted volumes, or on local volumes that are shareable on the network. You should check that range locking is available before requesting shared read/ write permission. On Mac OS X, range locking is available on all volumes.</td></tr>
173 <tr><td valign=top><tt>fsRdDenyPerm</tt></td>
174 <td>Requests that any other paths be prevented from having read access. A path cannot be opened if you request read permission (with the <tt>fsRdPerm</tt> constant) but some other path has requested deny-read access. Similarly, the path cannot be opened if you request deny-read permission, but some other path already has read access. This constant is used with the <tt>PBHOpenDenySync</tt> and <tt>PBHOpenRFDenySync</tt> functions.</td></tr>
175 <tr><td valign=top><tt>fsWrDenyPerm</tt></td>
176 <td>Requests that any other paths be prevented from having write access. A path cannot be opened if you request write permission (with the <tt>fsWrPerm</tt> constant) but some other path has requested deny-write access. Similarly, the path cannot be opened if you request deny-write permission, but some other path already has write access. This constant is used with the <tt>PBHOpenDenySync</tt> and <tt>PBHOpenRFDenySync</tt> functions.</td></tr>
179 @param permission read/write permissions for the opened resource fork.
180 @param path A path specifying the name and location of the file whose resource fork is to be opened.
181 @result An initialized <tt>NDResourceFork</tt> for an opened resource fork, returns <tt>nil</tt> if the resource fork could not be opened or initalization failed.
183 - (id
)initForPermission
:(char)permission AtPath
:(NSString
*)path
;
186 @functiongroup Adding data to an in memory resource fork
190 @method addData:type:Id:name:
191 @abstract Adds a resource to the receivers resource file.
192 @discussion <tt>addData:type:name:</tt> doesn't verify whether the resource ID you pass in the parameter <tt><i>ID</i></tt> is already assigned to another resource of the same type. You should use the methods <tt>addData:type:name:</tt> or <tt>dataForType:named:</tt> to get a unique resource ID when adding a resource . <tt>addData:type:Id:named:</tt> returns <tt>YES</tt> on success
193 @param data An <tt>NSData</tt> object containing the data to be added as a resource to the receivers resource file.
194 @param type The resource type of the resource to be added.
195 @param ID The resource ID of the resource to be added.
196 @param name The name of the resource to be added.
197 @result Returns <tt>YES</tt> if the resource was successfully added, otherwise it returns <tt>NO</tt>.
199 - (BOOL
)addData
:(NSData
*)data type
:(ResType
)type Id
:(short int)ID name
:(NSString
*)name
;
201 @method addData:type:name:
202 @abstract Adds a resource to the receivers resource file.
203 @discussion <tt>addData:type:name:</tt> uses an unique resource ID when adding a resource . <tt>addData:type:Id:named:</tt> returns <tt>YES</tt> on success
204 @param data An <tt>NSData</tt> object containing the data to be added as a resource to the receivers resource file.
205 @param type The resource type of the resource to be added.
206 @param name The name of the resource to be added.
207 @result Returns <tt>YES</tt> if the resource was successfully added, otherwise it returns <tt>NO</tt>.
209 - (BOOL
)addData
:(NSData
*)data type
:(ResType
)type name
:(NSString
*)name
;
212 @functiongroup Retrieve data from a resource fork
216 @method dataForType:Id:
217 @abstract Gets resource data for a resource in the receivers resource file.
218 @discussion <tt>dataForType:Id:</tt> searches the receivers resource file's resource map in memory for the specified resource.
219 @param type The resource type of the resource which you wish to read data.
220 @param ID An integer that uniquely identifies the resource which you wish to read data.
221 @result Returns an <tt>NSData</tt> object if successful otherwise returns nil.
223 - (NSData
*)dataForType
:(ResType
)type Id
:(short int)ID
;
225 @method dataForType:named:
226 @abstract Gets resource data for a resource in the receivers resource file.
227 @discussion <tt>dataForType:Id:</tt> searches the receivers resource file's resource map in memory for the specified resource.
228 @param type The resource type of the resource which you wish to read data.
229 @param name A name that uniquely identifies the resource which you wish to read data. Strings passed in this parameter are case-sensitive.
230 @result Returns an <tt>NSData</tt> object if successful otherwise returns nil.
232 - (NSData
*)dataForType
:(ResType
)type named
:(NSString
*)name
;
235 @functiongroup Remove data from a resource fork
239 @method removeType:Id:
240 @abstract Removes a resource's entry from the receivers resource file.
241 @discussion If the <tt>resProtected</tt> attribute for the resource is set, <tt>removeType:Id:</tt> does nothing, and returns <tt>NO</tt>.
242 @param type The resource type of the resource which you wish to remove.
243 @param ID An integer that uniquely identifies the resource which you wish to remove.
244 @result Returns <tt>YES</tt> if the resource was successfully removed, otherwise if returns <tt>NO</tt>.
246 - (BOOL
)removeType
:(ResType
)type Id
:(short int)ID
;
249 @functiongroup Obtain information about data with a resource fork
253 @method everyResourceType
254 @abstract Gets every resource type available in the receivers resource file.
255 @discussion <tt>everyResourceType</tt> returns an <tt>NSArray</tt> of <tt>NSNumber</tt>s each containing a <tt>unsigned long</tt> or <tt>ResType</tt>s.
256 @result A <tt>NSArray</tt> of <tt>NSNumber</tt>s containing <tt>ResType</tt>s.
258 - (NSArray
*)everyResourceType
;
261 @method nameOfResourceType:Id:
262 @abstract Gets a resource's resource name.
263 @discussion Returns a resources name as an <tt>NSString</tt>.
264 @param type The resource type of the resource for which you wish to read the name.
265 @param ID An integer that uniquely identifies the resource for which you wish to read the name.
266 @result An <tt>NSString</tt> containing the resources name.
268 - (NSString
*)nameOfResourceType
:(ResType
)type Id
:(short int)ID
;
270 @method getId:ofResourceType:named:
271 @abstract Gets a named resource's resource id.
272 @discussion Returns a resources id in a pointer to a <tt>short int</tt> and returns <tt>YES</tt> if retrieval of the id is succeeded. If <tt>getId:ofResourceType:named:</tt> returns <tt>NO</tt> then the value returned through the pointer <tt><i>ID</i></tt> is garabage.
273 @param ID A pointer to an <tt>short int</tt> that on return contains the resources id, if the returned value is <tt>YES</tt>.
274 @param type The resource type of the resource for which you wish to read the id.
275 @param name The resource name of the resource for which you wish to read the id.
276 @result A <tt>YES</tt> if retrieval was successful.
278 - (BOOL
)getId
:(short int *)ID ofResourceType
:(ResType
)type named
:(NSString
*)name
;
281 @method getAttributeFlags:forResourceType:Id:
282 @abstract Gets a resource's attributes.
283 @discussion Returns the attributes for a resource in a pointer to a <tt>short int</tt> and returns <tt>YES</tt> if retrieval of the attributes is succeeded. If <tt>getAttributeFlags:forResourceType:Id:</tt> returns <tt>NO</tt> then the value returned through the pointer <tt><i>attributes</i></tt> is garabage.
284 @param attributes A pointer to an <tt>short int</tt> that on return contains the resources attributes, if the returned value is <tt>YES</tt>.
285 @param type The resource type of the resource for which you wish to read the attributes.
286 @param ID An integer that uniquely identifies the resource for which you wish to read the attributes.
287 @result A <tt>YES</tt> if retrieval was successful.
289 - (BOOL
)getAttributeFlags
:(short int*)attributes forResourceType
:(ResType
)type Id
:(short int)ID
;
291 @method setAttributeFlags:forResourceType:Id:
292 @abstract Sets a resource's attributes.
293 @discussion Set the attributes for a resource in <tt><i>attributes</i></tt> and returns <tt>YES</tt> if setting of the attributes is succeeded.
294 @param attributes A <tt>short int</tt> that contains the resources attributes to be set.
295 @param type The resource type of the resource for which you wish to set the attributes.
296 @param ID An integer that uniquely identifies the resource for which you wish to set the attributes.
297 @result A <tt>YES</tt> if <tt>setAttributeFlags:forResourceType:Id:</tt> was successful in setting the resources attributes.
299 - (BOOL
)setAttributeFlags
:(short int)attributes forResourceType
:(ResType
)type Id
:(short int)ID
;
302 @functiongroup Get and set the entire resource fork data.
306 @method dataForEntireResourceFork
307 @abstract Reads the receivers entire resource data.
308 @discussion <tt>dataForEntireResourceFork</tt> returns a <tt>NSData</tt> object that contains the entire contents of the resource fork. <tt>dataForEntireResourceFork</tt> and it's conpanion method <tt>writeEntireResourceFork</tt> can be used for duplicating the resource fork for on file to the resource fork of another. <tt>dataForEntireResourceFork</tt> can also be used to convert a resource stored in a files resource fork into a resource stored in a data fork, simple by using the <tt>NSData</tt> methods <tt>writeToFile:atomically:</tt> or <tt>writeToURL:atomically:</tt>.
309 @result A <tt>NSData</tt> object containing the resources data.
311 - (NSData
*)dataForEntireResourceFork
;
313 @method writeEntireResourceFork:
314 @abstract Writes complete resource data to the receivers resource fork.
315 @discussion <tt>writeEntireResourceFork:</tt> writes the data in the <tt>NSData</tt> object out the the recievers resource fork. <tt>writeEntireResourceFork</tt> and it's conpanion method <tt>dataForEntireResourceFork</tt> can be used for duplicating the resource fork for on file to the resource fork of another. <tt>writeEntireResourceFork:</tt> can also be used to convert a resource stored in a files data fork into a resource stored in a files resource fork, simple by creating the <tt>NSData</tt> object with the methods <tt>dataWithContentsOfFile</tt> or <tt>dataWithContentsOfURL:</tt>.
316 @param data The complete resource data in a <tt>NSData</tt> object.
317 @result Returns <tt>YES</tt> if writting was successful, returns <tt>NO</tt> otherwise.
319 - (BOOL
)writeEntireResourceFork
:(NSData
*)data
;
324 @category NSData(NDResourceFork)
325 @abstract Category of <tt>NSData</tt> fro creating <tt>NSData</tt> instances from the contents resource.
326 @discussion The main benifit of theses methods over the equivelent methods of <tt>NDResourceFork</tt> is these methods create autoreased <tt>NSData</tt> instances without leaving any resources forks open by leaving any autoreleased <tt>NDResourceFork</tt> forks open.
328 @interface
NSData (NDResourceFork
)
331 @functiongroup Creat a <tt>NSData</tt> instance from file resource fork data
335 @method dataWithResourceForkContentsOfURL:type:Id:
336 @abstract Create a <tt>NSData</tt> instance.
337 @discussion Data for the resource type <tt><i>type</i></tt> and resource id <tt><i>ID</i></tt> is read from the file URL <tt><i>URL</i></tt> and returned as a <tt>NSData</tt> instance.
338 @param URL A file url specifying the name and location of the file whose resource fork is to be read from.
339 @param type The resource type of the resource which you wish to read data.
340 @param ID An integer that uniquely identifies the resource which you wish to read data.
341 @result If successful an <tt>NSData</tt> instance with the resource fork data of the resource type and resource id.
343 + (NSData
*)dataWithResourceForkContentsOfURL
:(NSURL
*)URL type
:(ResType
)type Id
:(short int)ID
;
346 @method dataWithResourceForkContentsOfURL:type:named:
347 @abstract Create a <tt>NSData</tt> instance.
348 @discussion Data for the resource type <tt><i>type</i></tt> and resource name <tt><i>name</i></tt> is read from the file URL <tt><i>URL</i></tt> and returned as a <tt>NSData</tt> instance.
349 @param URL A file url specifying the name and location of the file whose resource fork is to be read from.
350 @param type The resource type of the resource which you wish to read data.
351 @param name A name that uniquely identifies the resource which you wish to read data. Strings passed in this parameter are case-sensitive.
352 @result If successful an <tt>NSData</tt> instance with the resource fork data of the resource type and resource name.
354 + (NSData
*)dataWithResourceForkContentsOfURL
:(NSURL
*)URL type
:(ResType
)type named
:(NSString
*)name
;
357 @method dataWithResourceForkContentsOfFile:type:Id:
358 @abstract Create a <tt>NSData</tt> instance.
359 @discussion Data for the resource type <tt><i>type</i></tt> and resource id <tt><i>ID</i></tt> is read from the file <tt><i>path</i></tt> and returned as a <tt>NSData</tt> instance.
360 @param path A file path specifying the file whose resource fork is to be read from.
361 @param type The resource type of the resource which you wish to read data.
362 @param ID An integer that uniquely identifies the resource which you wish to read data.
363 @result If successful an <tt>NSData</tt> instance with the resource fork data of the resource type and resource id.
365 + (NSData
*)dataWithResourceForkContentsOfFile
:(NSString
*)path type
:(ResType
)type Id
:(short int)ID
;
368 @method dataWithResourceForkContentsOfFile:type:named:
369 @abstract Create a <tt>NSData</tt> instance.
370 @discussion Data for the resource type <tt><i>type</i></tt> and resource name <tt><i>name</i></tt> is read from the file <tt><i>path</i></tt> and returned as a <tt>NSData</tt> instance.
371 @param path A file path specifying the file whose resource fork is to be read from.
372 @param type The resource type of the resource which you wish to read data.
373 @param name A name that uniquely identifies the resource which you wish to read data. Strings passed in this parameter are case-sensitive.
374 @result If successful an <tt>NSData</tt> instance with the resource fork data of the resource type and resource name.
376 + (NSData
*)dataWithResourceForkContentsOfFile
:(NSString
*)path type
:(ResType
)type named
:(NSString
*)name
;
379 @functiongroup Write to file resource fork data
383 @method writeToResourceForkURL:type:Id:name:
384 @abstract write a <tt>NSData</tt> instance to a resource fork.
385 @discussion Data is written to the resource type <tt><i>type</i></tt> and resource id <tt><i>ID</i></tt> is read from the file URL <tt><i>URL</i></tt> and returned as a <tt>NSData</tt> instance.
386 @param URL A file url specifying the name and location of the file whose resource fork is to be written to.
387 @param type The resource type of the resource which you wish to write data to.
388 @param ID An integer that uniquely identifies the resource which you wish to write data to.
389 @param name A name that uniquely identifies the resource. Strings passed in this parameter are case-sensitive.
390 @result Returns <tt>YES</tt> if successful, other <tt>NO</tt>.
392 - (BOOL
)writeToResourceForkURL
:(NSURL
*)URL type
:(ResType
)type Id
:(int)Id name
:(NSString
*)name
;
395 @method writeToResourceForkFile:type:Id:name:
396 @abstract write a <tt>NSData</tt> instance to a resource fork.
397 @discussion Data is written to the resource type <tt><i>type</i></tt> and resource id <tt><i>ID</i></tt> is read from the file <tt><i>PATH</i></tt> and returned as a <tt>NSData</tt> instance.
398 @param path A file path specifying the file whose resource fork is to be written to.
399 @param type The resource type of the resource which you wish to write data to.
400 @param ID An integer that uniquely identifies the resource which you wish to write data to.
401 @param name A name that uniquely identifies the resource. Strings passed in this parameter are case-sensitive.
402 @result Returns <tt>YES</tt> if successful, other <tt>NO</tt>.
404 - (BOOL
)writeToResourceForkFile
:(NSString
*)path type
:(ResType
)type Id
:(int)Id name
:(NSString
*)name
;