FileAlias.h
author Jens Alfke <jens@mooseyard.com>
Sat Mar 28 09:36:46 2009 -0700 (2009-03-28)
changeset 20 5a71993a1a70
permissions -rw-r--r--
Added some new utilities, taken from Murky.
     1 //
     2 //  FileAlias.h
     3 //  MYUtilities
     4 //
     5 //  Copyright 2008 Jens Alfke. All rights reserved.
     6 //
     7 
     8 #import <Foundation/Foundation.h>
     9 
    10 
    11 /** A wrapper around an AliasHandle: a persistent reference to a file, which works
    12     even if the file is moved or renamed, or its volume unmounted. */
    13 
    14 @interface FileAlias : NSObject <NSCoding>
    15 {
    16     AliasHandle _alias;
    17 }
    18 
    19 - (id) initWithFilePath: (NSString*)path
    20                   error: (NSError**)error;
    21 
    22 - (id) initWithFilePath: (NSString*)path 
    23          relativeToPath: (NSString*)fromPath
    24                   error: (NSError**)error;
    25 
    26 - (NSString*) filePath: (NSError**)error;
    27 - (NSString*) filePathRelativeToPath: (NSString*)fromPath error: (NSError**)error;
    28 
    29 - (NSArray*) findMatchesRelativeToPath: (NSString*)fromPath 
    30                              withRules: (unsigned)rules      // rules = kARMSearch etc.
    31                                  error: (NSError**)error;
    32 - (NSArray*) findMatches: (NSError**)error;
    33 
    34 - (NSString*) originalPath;
    35 - (NSString*) originalFilename;
    36 - (NSString*) originalVolumeName;
    37 - (void) dump;
    38 
    39 @end