Created
September 5, 2011 14:59
-
-
Save mikeash/1195176 to your computer and use it in GitHub Desktop.
A basic sketch of an NSFileReference class interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSFileReference : NSObject { | |
// internal storage would probably be NSURL, but could be | |
// NSString holding a path, FSRef, alias data, whatever | |
} | |
- (id)initWithPath: (NSString *)path; | |
- (id)initWithFileSystemRepresentation: (const char *)path; | |
- (id)initWithFSRef: (FSRef *)ref; | |
- (id)initWithAliasData: (NSData *)data; | |
- (id)initWithURL: (NSURL *)url; | |
- (NSString *)path; | |
- (const char *)fileSystemRepresentation; | |
- (BOOL)getFSRef: (FSRef *)outRef; | |
- (NSData *)aliasData; | |
- (NSURL *)url; | |
// in a perfect world, these two would return two different classes too | |
- (NSString *)name; | |
- (NSString *)displayName; | |
- (NSArray *)displayComponents; | |
- (NSFileReference *)parent; | |
- (NSFileReference *)childNamed: (NSString *)name; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment