Permalink
Browse files

eliminated dependence on Carbon.framework, fixed some comments

  • Loading branch information...
seanm committed Dec 9, 2011
1 parent 76997c7 commit b29d8bc786b09017e1d71ebf3e00d95ef324def6
Showing with 17 additions and 17 deletions.
  1. +6 −6 Classes/NDAlias+AliasFile.m
  2. +11 −11 Classes/NDResourceFork.h
@@ -28,8 +28,9 @@ of this software and associated documentation files (the "Software"), to deal
#import "NSURL+NDCarbonUtilities.h"
#import "NDResourceFork+OtherSorces.h"
-const OSType finderCreatorCode = 0x4D414353; // 'MACS'
-const short aliasRecordId = 0;
+static const ResType aliasResourceType = 0x616C6973; // 'alis'
+static const OSType finderCreatorCode = 0x4D414353; // 'MACS'
+static const short aliasRecordId = 0;
@implementation NDAlias (AliasFile)
@@ -84,7 +85,7 @@ - (id)initWithContentsOfFile:(NSString *)aPath
NDResourceFork * theResourceFork;
theResourceFork = [[NDResourceFork alloc] initForReadingAtPath:aPath];
- self = [self initWithData:[theResourceFork dataForType:formAlias Id:aliasRecordId]];
+ self = [self initWithData:[theResourceFork dataForType:aliasResourceType Id:aliasRecordId]];
[theResourceFork closeFile];
[theResourceFork release];
@@ -97,7 +98,7 @@ - (id)initWithContentsOfURL:(NSURL *)aURL
NDResourceFork * theResourceFork;
theResourceFork = [[NDResourceFork alloc] initForReadingAtURL:aURL];
- self = [self initWithData:[theResourceFork dataForType:formAlias Id:aliasRecordId]];
+ self = [self initWithData:[theResourceFork dataForType:aliasResourceType Id:aliasRecordId]];
[theResourceFork closeFile];
[theResourceFork release];
@@ -126,7 +127,7 @@ - (BOOL)writeToURL:(NSURL *)aURL includeCustomIcon:(BOOL)aCustomIcon
NDResourceFork * theResourceFork;
theResourceFork = [[NDResourceFork alloc] initForWritingAtURL:aURL];
- theSuccess = [theResourceFork addData:[self data] type:formAlias Id:aliasRecordId name:@"created by NDAlias"];
+ theSuccess = [theResourceFork addData:[self data] type:aliasResourceType Id:aliasRecordId name:@"created by NDAlias"];
if( theSuccess )
{
@@ -176,4 +177,3 @@ - (BOOL)writeToURL:(NSURL *)aURL includeCustomIcon:(BOOL)aCustomIcon
}
@end
-
View
@@ -32,7 +32,7 @@
*/
#import <Foundation/Foundation.h>
-#import <Carbon/Carbon.h>
+#import <CoreServices/CoreServices.h>
#import "NDSDKCompatibility.h"
/*!
@@ -49,31 +49,31 @@
/*!
@method resourceForkForReadingAtURL:
@abstract Creates and initalises a <tt>NDResourceFork</tt>.
- @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.
+ @discussion Creates and intializes a <tt>NDResourceFork</tt> and opens a resource fork for reading using the file url. You must invoke closeFile when you are finished with the object.
@param URL A file url specifying the name and location of the file whose resource fork is to be opened.
@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.
*/
+ (id)resourceForkForReadingAtURL:(NSURL *)URL;
/*!
@method resourceForkForWritingAtURL:
@abstract Creates and initalises a <tt>NDResourceFork</tt>.
- @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.
+ @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. You must invoke closeFile when you are finished with the object.
@param URL A file url specifying the name and location of the file whose resource fork is to be opened.
@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.
*/
+ (id)resourceForkForWritingAtURL:(NSURL *)URL;
/*!
@method resourceForkForReadingAtPath:
@abstract Creates and initalises a <tt>NDResourceFork</tt>.
- @discussion Creates and intializes a <tt>NDResourceFork</tt> and opens a resource fork for reading using the path. The receiver's resource fork is closed when the receiver is deallocated.
+ @discussion Creates and intializes a <tt>NDResourceFork</tt> and opens a resource fork for reading using the path. You must invoke closeFile when you are finished with the object.
@param path A path specifying the name and location of the file whose resource fork is to be opened.
@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.
*/
+ (id)resourceForkForReadingAtPath:(NSString *)path;
/*!
@method resourceForkForWritingAtPath:
@abstract Creates and initalises a <tt>NDResourceFork</tt>.
- @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 receiver's resource fork is closed when the receiver is deallocated.
+ @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. You must invoke closeFile when you are finished with the object.
@param path A path specifying the name and location of the file whose resource fork is to be opened.
@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.
*/
@@ -83,30 +83,30 @@
@method initForReadingAtURL:
@abstract Initalises a <tt>NDResourceFork</tt>.
@discussion Intializes the receiver and opens a resource fork for reading using the file url.
- @param URL A file url specifying the name and location of the file whose resource fork is to be opened. The receiver's resource fork is closed when the receiver is deallocated.
+ @param URL A file url specifying the name and location of the file whose resource fork is to be opened. You must invoke closeFile when you are finished with the object.
@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.
*/
- (id)initForReadingAtURL:(NSURL *)URL;
/*!
@method initForReadingAtURL:
@abstract Initalises a <tt>NDResourceFork</tt>.
- @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 receiver's resource fork is closed when the receiver is deallocated.
+ @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. You must invoke closeFile when you are finished with the object.
@param URL A file url specifying the name and location of the file whose resource fork is to be opened.
@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.
*/
- (id)initForWritingAtURL:(NSURL *)URL;
/*!
@method initForReadingAtPath:
@abstract Initalises a <tt>NDResourceFork</tt>.
- @discussion Intializes the receiver and opens a resource fork for reading using the path. The receiver's resource fork is closed when the receiver is deallocated.
+ @discussion Intializes the receiver and opens a resource fork for reading using the path. You must invoke closeFile when you are finished with the object.
@param path A path specifying the name and location of the file whose resource fork is to be opened.
@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.
*/
- (id)initForReadingAtPath:(NSString *)path;
/*!
@method initForWritingAtPath:
@abstract Initalises a <tt>NDResourceFork</tt>.
- @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 receiver's resource fork is closed when the receiver is deallocated.
+ @discussion Intializes the receiver and opens a resource fork for writting, creating it before hand if it does not already exists, using the path. You must invoke closeFile when you are finished with the object.
@param path A path specifying the name and location of the file whose resource fork is to be opened.
@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.
*/
@@ -122,7 +122,7 @@
/*!
@method initForPermission:atURL:
@abstract Initalises a <tt>NDResourceFork</tt>.
- @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 receiver's resource fork is closed when the receiver is deallocated.Possible permission values are as follows;
+ @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. You must invoke closeFile when you are finished with the object.Possible permission values are as follows;
<blockquote>
<table border=0 cellpadding=4>
<tr><td width=80 valign=top><tt>fsCurPerm</tt></td>
@@ -149,7 +149,7 @@
/*!
@method initForPermission:atPath:
@abstract Initalises a <tt>NDResourceFork</tt>.
- @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 receiver's resource fork is closed when the receiver is deallocated. Possible permission values are as follows;
+ @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. You must invoke closeFile when you are finished with the object. Possible permission values are as follows;
<blockquote>
<table border=0 cellpadding=4>
<tr><td width=80 valign=top><tt>fsCurPerm</tt></td>

0 comments on commit b29d8bc

Please sign in to comment.