HexFiend
HFFileReference.h
Go to the documentation of this file.
1 //
2 // HFFileReference.h
3 // HexFiend_2
4 //
5 // Copyright 2008 ridiculous_fish. All rights reserved.
6 //
7 
8 #import <Cocoa/Cocoa.h>
9 
19 @interface HFFileReference : NSObject {
20  @protected
21  int fileDescriptor;
22  dev_t device;
23  unsigned long long inode;
24  unsigned long long fileLength;
25  mode_t fileMode;
26  BOOL isWritable;
27  uint32_t blockSize;
28  BOOL isPrivileged;
29  BOOL isFixedLength;
30 }
31 
32 @property (readonly) BOOL isPrivileged;
33 @property (readonly) BOOL isFixedLength;
34 
36 - (instancetype)initWritableWithPath:(NSString *)path error:(NSError **)error;
37 
39 - (instancetype)initWithPath:(NSString *)path error:(NSError **)error;
40 
42 - (void)close;
43 
49 - (void)readBytes:(unsigned char *)buff length:(NSUInteger)length from:(unsigned long long)offset;
50 
57 - (int)writeBytes:(const unsigned char *)buff length:(NSUInteger)length to:(unsigned long long)offset;
58 
60 - (unsigned long long)length;
61 
63 - (BOOL)setLength:(unsigned long long)length error:(NSError **)error;
64 
66 - (BOOL)isEqual:(id)val;
67 
68 @end
69 
74 @end
unsigned long long length()
A reference to an open file.
Definition: HFFileReference.h:19
BOOL isFixedLength
Definition: HFFileReference.h:22
BOOL isPrivileged
Definition: HFFileReference.h:21
A reference to an open file that can be read (and possibly written) using normal C functions...
Definition: HFFileReference.h:62