/*!
@header NSString+NDCarbonUtilities
@abstract Decalres the category NSString (NDCarbonUtilities)
@discussion Provides method for interacting with Carbon APIs.
Created by Nathan Day on Sat Aug 03 2002.
Copyright © 2002 Nathan Day. All rights reserved.
*/
#import
#import
/*!
@category NSString(NDCarbonUtilitiesPaths)
@abstract Provides method for interacting with Carbon APIs.
@discussion Methods for dealing with FSRef’s and pascal string as well as making some other core foundation methods accessable in Objective-C syntax.
*/
@interface NSString (NDCarbonUtilitiesPaths)
/*!
@method stringWithFSRef:
@abstract Alloc and initialize an NSString.
@discussion Creats a NSString containing a POSIX style path from a FSRef
@param fsRef a pointer to a FSRef.
@result A NSString containing a POSIX path.
*/
+ (NSString *)stringWithFSRef:(const FSRef *)fsRef;
/*!
@method getFSRef:
@abstract Get a FSRef for a path NSString.
@discussion Initializes an FSRef for a POSIX style path NSString.
@param fsRef a pointer to a FSRef.
@result Return YES if the method was successful, if the function returns NO then the FSRef pointed to by fsRef is garbage.
*/
- (BOOL)getFSRef:(FSRef *)fsRef;
/*!
@method getFSSpec:
@abstract Get a FSSpec.
@discussion Obtain a FSSpec for a POSIX path.
@param fsSpec A pointer to a FSSpec struct, to be filled by the method.
@result Returns YES if successful, if the method returns NO then fsSpec contains garbage.
*/
- (BOOL)getFSSpec:(FSSpec *)fsSpec;
/*!
@method fileSystemPathHFSStyle
@abstract Returns a HFS style path.
@discussion 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.
*/
- (NSString *)fileSystemPathHFSStyle;
/*!
@method pathFromFileSystemPathHFSStyle
@abstract Get a path from a HFS style path.
@discussion pathFromFileSystemPathHFSStyle returns a POSIX style path from a HFS style path.
@result A NSString containing a POSIX style path.
*/
- (NSString *)pathFromFileSystemPathHFSStyle;
/*!
@method resolveAliasFile
@abstract Resolve an alias file.
@discussion 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.
*/
- (NSString *)resolveAliasFile;
/*!
@method stringWithPascalString:
@abstract Alloc and initialize an NSString.
@discussion Reurns a new NSString equivelent to the passed in pascal string.
@param pStr A pascal string of type ConstStr255Param.
@result A NSString.
*/
+ (NSString *)stringWithPascalString:(ConstStr255Param)pStr;
/*!
@method pascalString:length:
@abstract Obtain a pascal string equivelent to the receveiver.
@discussion Fill the StringPtr with a pascal string equivelent to the receveiver.
@param buffer A StringPtr that contains the pascal string on completion.
@param length The maximum length the string can be. Pascal string can be no longer than 255 bytes long, 256 if you include the first length byte.
@result Returns YES if the method was successful, if NO is returns then buffer contains garbage.
*/
- (BOOL)pascalString:(StringPtr)buffer length:(short)length;
/*!
@method trimWhitespace
@abstract Trims white space from a NSString.
@discussion 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.
*/
- (NSString *)trimWhitespace;
@end