HexFiend: HFByteArray.h Source File

HexFiend

HFByteArray.h
Go to the documentation of this file.
1 //
2 // HFByteArray.h
3 // HexFiend_2
4 //
5 // Copyright 2007 ridiculous_fish. All rights reserved.
6 //
7
8 #import <Cocoa/Cocoa.h>
9
10 @class HFByteSlice, HFProgressTracker, HFFileReference, HFByteRangeAttributeArray;
11
12 typedef NS_ENUM(NSUInteger, HFByteArrayDataStringType) {
13 HFHexDataStringType,
14 HFASCIIDataStringType
15 };
16
17
34 @class HFByteRangeAttributeArray;
35
36 @interface HFByteArray : NSObject <NSCopying, NSMutableCopying> {
37 @private
38 NSUInteger changeLockCounter;
39 NSUInteger changeGenerationCount;
40 }
41
46 - (instancetype)initWithByteSlice:(HFByteSlice *)slice;
47
49 - (instancetype)initWithByteArray:(HFByteArray *)array;
51
52
56
58 - (unsigned long long)length;
59
61 - (void)copyBytes:(unsigned char *)dst range:(HFRange)range;
63
69 - (NSArray *)byteSlices;
70
72 - (NSEnumerator *)byteSliceEnumerator;
73
75 - (HFByteSlice *)sliceContainingByteAtIndex:(unsigned long long)offset beginningOffset:(unsigned long long *)actualOffset;
77
83 - (void)insertByteSlice:(HFByteSlice *)slice inRange:(HFRange)lrange;
84
86 - (void)insertByteArray:(HFByteArray *)array inRange:(HFRange)lrange;
87
89 - (void)deleteBytesInRange:(HFRange)range;
90
92 - (HFByteArray *)subarrayWithRange:(HFRange)range;
94
99
101 - (void)incrementChangeLockCounter;
102
104 - (void)decrementChangeLockCounter;
105
107 - (BOOL)changesAreLocked;
109
110 /* @name Generation count
111 Manipulate the generation count */
112 // @{
115 - (void)incrementGenerationOrRaiseIfLockedForSelector:(SEL)sel;
116
118 - (NSUInteger)changeGenerationCount;
119
121
122
123
134 - (unsigned long long)indexOfBytesEqualToBytes:(HFByteArray *)findBytes inRange:(HFRange)range searchingForwards:(BOOL)forwards trackingProgress:(HFProgressTracker *)progressTracker;
136
137 @end
138
139
143 @interface HFByteArray (HFFileWriting)
150 - (BOOL)writeToFile:(NSURL *)targetURL trackingProgress:(HFProgressTracker *)progressTracker error:(NSError **)error;
151
156 - (NSArray *)rangesOfFileModifiedIfSavedToFile:(HFFileReference *)reference;
157
164 - (BOOL)clearDependenciesOnRanges:(NSArray *)ranges inFile:(HFFileReference *)reference hint:(NSMutableDictionary *)hint;
165
166 @end
167
168
172 @interface HFByteArray (HFAttributes)
173
175 - (HFByteRangeAttributeArray *)attributesForBytesInRange:(HFRange)range;
176
178 - (HFByteRangeAttributeArray *)byteRangeAttributeArray;
179
180 @end
-[HFByteArray byteSliceEnumerator]
NSEnumerator * byteSliceEnumerator()
-[HFByteArray incrementChangeLockCounter]
void incrementChangeLockCounter()
HFFileReference
A reference to an open file.
Definition: HFFileReference.h:19
HFByteArrayDataStringType
HFByteArrayDataStringType
Definition: HFByteArray.h:12
-[HFByteArray(HFAttributes) byteRangeAttributeArray]
HFByteRangeAttributeArray * byteRangeAttributeArray()
HFRange
HFRange is the 64 bit analog of NSRange, containing a 64 bit location and length. ...
Definition: HFTypes.h:2
-[HFByteArray changeGenerationCount]
NSUInteger changeGenerationCount()
HFByteRangeAttributeArray
A class that represents sets of attributes, attached to ranges of bytes.
Definition: HFByteRangeAttributeArray.h:13
-[HFByteArray length]
unsigned long long length()
HFProgressTracker
A class that helps handle progress indication and cancellation for long running threaded operations...
Definition: HFProgressTracker.h:29
-[HFByteArray changesAreLocked]
BOOL changesAreLocked()
HFByteArray(HFFileWriting)
HFByteArray methods for writing to files, and preparing other HFByteArrays for potentially destructiv...
Definition: HFByteArray.h:139
HFHexDataStringType
Definition: HFByteArray.h:13
HFByteArray(HFAttributes)
HFByteArray methods for attributes of byte arrays.
Definition: HFByteArray.h:168
-[HFByteArray byteSlices]
NSArray * byteSlices()
HFByteArray
The principal Model class for HexFiend&#39;s MVC architecture.
Definition: HFByteArray.h:36
HFByteSlice
A class representing a source of data for an HFByteArray.
Definition: HFByteSlice.h:19
HFASCIIDataStringType
Definition: HFByteArray.h:14
-[HFByteArray decrementChangeLockCounter]
void decrementChangeLockCounter()