00001
00002
00003
00004
00005
00006
00007
00008 #import <Cocoa/Cocoa.h>
00009
00010 @class HFByteSlice, HFProgressTracker, HFFileReference, HFByteRangeAttributeArray;
00011
00028 enum
00029 {
00030 HFHexDataStringType,
00031 HFASCIIDataStringType
00032 };
00033 typedef NSUInteger HFByteArrayDataStringType;
00034
00035 @class HFByteRangeAttributeArray;
00036
00037 @interface HFByteArray : NSObject <NSCopying, NSMutableCopying> {
00038 @private
00039 NSUInteger changeLockCounter;
00040 NSUInteger changeGenerationCount;
00041 }
00042
00046
00048 - (unsigned long long)length;
00049
00051 - (void)copyBytes:(unsigned char *)dst range:(HFRange)range;
00053
00059 - (NSArray *)byteSlices;
00060
00062 - (NSEnumerator *)byteSliceEnumerator;
00063
00065 - (HFByteSlice *)sliceContainingByteAtIndex:(unsigned long long)offset beginningOffset:(unsigned long long *)actualOffset;
00067
00073 - (void)insertByteSlice:(HFByteSlice *)slice inRange:(HFRange)lrange;
00074
00076 - (void)insertByteArray:(HFByteArray *)array inRange:(HFRange)lrange;
00077
00079 - (void)deleteBytesInRange:(HFRange)range;
00080
00082 - (HFByteArray *)subarrayWithRange:(HFRange)range;
00084
00089
00091 - (void)incrementChangeLockCounter;
00092
00094 - (void)decrementChangeLockCounter;
00095
00097 - (BOOL)changesAreLocked;
00099
00100
00101
00102
00105 - (void)incrementGenerationOrRaiseIfLockedForSelector:(SEL)sel;
00106
00108 - (NSUInteger)changeGenerationCount;
00109
00111
00112
00113
00124 - (unsigned long long)indexOfBytesEqualToBytes:(HFByteArray *)findBytes inRange:(HFRange)range searchingForwards:(BOOL)forwards trackingProgress:(HFProgressTracker *)progressTracker;
00126
00127 @end
00128
00129
00133 @interface HFByteArray (HFFileWriting)
00140 - (BOOL)writeToFile:(NSURL *)targetURL trackingProgress:(HFProgressTracker *)progressTracker error:(NSError **)error;
00141
00146 - (NSArray *)rangesOfFileModifiedIfSavedToFile:(HFFileReference *)reference;
00147
00154 - (BOOL)clearDependenciesOnRanges:(NSArray *)ranges inFile:(HFFileReference *)reference hint:(NSMutableDictionary *)hint;
00155
00156 @end
00157
00158
00162 @interface HFByteArray (HFAttributes)
00163
00165 - (HFByteRangeAttributeArray *)attributesForBytesInRange:(HFRange)range;
00166
00168 - (HFByteRangeAttributeArray *)byteRangeAttributeArray;
00169
00170 @end