FileAlias.h
author Jens Alfke <jens@mooseyard.com>
Sat May 17 13:14:48 2008 -0700 (2008-05-17)
changeset 9 823e7e74088e
permissions -rw-r--r--
* Assert macros now put the failure code in a separate segment.
* Added $string utility.
     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