Methods



fileSystemPathHFSStyle

Abstract: Returns a HFS style path.
- (NSString *)fileSystemPathHFSStyle; 

Returns a NSString containg a HFS style path (e.g. Macitosh HD:Users:) useful for display purposes.

Result: A new NSString containing a HFS style path for the same file or directory as the receiver.

getFSRef:

Abstract: Get a FSRef for a path NSString.
- (BOOL)getFSRef:(FSRef *)aFSRef; 

Initializes an FSRef for a POSIX style path NSString.

Parameters

NameDescription
aFSRefa pointer to a FSRef.
Result: Return YES if the method was successful, if the function returns NO then the FSRef pointed to by aFSRef is garbage.

getFSSpec:

Abstract: Get a FSSpec.
- (BOOL)getFSSpec:(FSSpec *)aFSSpec; 

Obtain a FSSpec for a POSIX path.

Parameters

NameDescription
aFSSpecA pointer to a FSSpec struct, to be filled by the method.
Result: Returns YES if successful, if the method returns NO then aFSSpec contains garbage.

pascalString:length:

Abstract: Obtain a pascal string equivelent to the receveiver.
- (BOOL)pascalString:(StringPtr)aBuffer length:(short)aLength; 

Fill the StringPtr with a pascal string equivelent to the receveiver.

Parameters

NameDescription
aBufferA StringPtr that contains the pascal string on completion.
aLengthThe maximum length the string can be. Pascal string can be no longer than 255 bytes long, 256 if you include the first length byte, so a value of 256 is the desired length.
Result: Returns YES if the method was successful, if NO is returns then aBuffer contains garbage.

pathFromFileSystemPathHFSStyle

Abstract: Get a path from a HFS style path.
- (NSString *)pathFromFileSystemPathHFSStyle; 

pathFromFileSystemPathHFSStyle returns a POSIX style path from a HFS style path.

Result: A NSString containing a POSIX style path.

resolveAliasFile

Abstract: Resolve an alias file.
- (NSString *)resolveAliasFile; 

Returns an POSIX path NSString refered to by the receveive if the receveive refers to an alias file. If it does not refer to an alias file the a string identical to the receveive is returned.

Result: An POSIX path NSString.

stringWithFSRef:

Abstract: Alloc and initialize an NSString.
+ (NSString *)stringWithFSRef:(const FSRef *)aFSRef; 

Creats a NSString containing a POSIX style path from a FSRef

Parameters

NameDescription
aFSRefa pointer to a FSRef.
Result: A NSString containing a POSIX path.

stringWithPascalString:

Abstract: Alloc and initialize an NSString.
+ (NSString *)stringWithPascalString:(ConstStr255Param)aPStr; 

Reurns a new NSString equivelent to the passed in pascal string.

Parameters

NameDescription
aPStrA pascal string of type ConstStr255Param.
Result: A NSString.

trimWhitespace

Abstract: Trims white space from a NSString.
- (NSString *)trimWhitespace; 

Returns a new NSString equivelent to the receveiver but without any white space (return, new line, space, tab) at the begining or end of the string.

Result: A new NSString.

© 2003 Nathan Day — (Last Updated 11/30/2003)