Ignore:
Timestamp:
11/04/02 20:23:02 (20 years ago)
Author:
Nicholas Riley
Message:

Lots of wonderful changes for which I composed a detailed svn commit
message, which it proceeded to mangle yet AGAIN on failed commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/BDAlias.m

    r34 r39  
    281281}
    282282
     283- (BOOL)aliasIsEqual:(AliasHandle)otherAlias;
     284{
     285    AliasHandle alias = [self alias];
     286    FSRef ref, otherRef;
     287    Boolean wasChanged;
     288
     289    if (alias == otherAlias) return YES;
     290    if (alias == NULL || otherAlias == NULL) return NO;
     291    if (FSResolveAlias(NULL, alias, &ref, &wasChanged) != noErr) return NO;
     292    if (FSResolveAlias(NULL, otherAlias, &otherRef, &wasChanged) != noErr) return NO;
     293    return (FSCompareFSRefs(&ref, &otherRef) == noErr);
     294}
     295
     296- (BOOL)aliasDataIsEqual:(NSData *)data;
     297{
     298    AliasHandle otherAlias;
     299    const UInt8 *aliasPtr = CFDataGetBytePtr((CFDataRef)data);
     300    BOOL result;
     301    if (aliasPtr == NULL) {
     302        otherAlias = (AliasHandle)DataToHandle((CFDataRef)data);
     303    } else {
     304        otherAlias = (AliasHandle)&aliasPtr;
     305    }
     306    result = [self aliasIsEqual: otherAlias];
     307    if (aliasPtr == NULL) DisposeHandle((Handle)otherAlias);
     308    return result;
     309}
     310
     311- (BOOL)isEqual:(id)object;
     312{
     313    if (![object isKindOfClass: [BDAlias class]]) return NO;
     314    return [self aliasIsEqual: [object alias]];
     315}
     316
    283317+ (BDAlias *)aliasWithAliasHandle:(AliasHandle)alias
    284318{
Note: See TracChangeset for help on using the changeset viewer.