-
Notifications
You must be signed in to change notification settings - Fork 93
/
URKFileInfo.h
158 lines (127 loc) · 2.77 KB
/
URKFileInfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//
// URKFileInfo.h
// UnrarKit
//
#import <Foundation/Foundation.h>
#import "UnrarKitMacros.h"
RarosHppIgnore
#import "raros.hpp"
#pragma clang diagnostic pop
DllHppIgnore
#import "dll.hpp"
#pragma clang diagnostic pop
/* See http://www.forensicswiki.org/wiki/RAR and
http://www.rarlab.com/technote.htm#filehead for
more information about the RAR File Header spec */
/**
* Defines the packing methods that can be used on a file in an archive
*/
typedef NS_ENUM(NSUInteger, URKCompressionMethod) {
/**
* No compression is used
*/
URKCompressionMethodStorage = 0x30,
/**
* Fastest compression
*/
URKCompressionMethodFastest = 0x31,
/**
* Fast compression
*/
URKCompressionMethodFast = 0x32,
/**
* Normal compression
*/
URKCompressionMethodNormal = 0x33,
/**
* Good compression
*/
URKCompressionMethodGood = 0x34,
/**
* Best compression
*/
URKCompressionMethodBest = 0x35,
};
/**
* Defines the various operating systems that can be used when archiving
*/
typedef NS_ENUM(NSUInteger, URKHostOS) {
/**
* MS-DOS
*/
URKHostOSMSDOS = 0,
/**
* OS/2
*/
URKHostOSOS2 = 1,
/**
* Windows
*/
URKHostOSWindows = 2,
/**
* Unix
*/
URKHostOSUnix = 3,
/**
* Mac OS
*/
URKHostOSMacOS = 4,
/**
* BeOS
*/
URKHostOSBeOS = 5,
};
/**
* A wrapper around a RAR archive's file header, defining the various fields
* it contains
*/
@interface URKFileInfo : NSObject
/**
* The name of the file's archive
*/
@property (readonly, strong) NSString *archiveName;
/**
* The name of the file
*/
@property (readonly, strong) NSString *filename;
/**
* The timestamp of the file
*/
@property (readonly, strong) NSDate *timestamp;
/**
* The CRC checksum of the file
*/
@property (readonly, assign) NSUInteger CRC;
/**
* Size of the uncompressed file
*/
@property (readonly, assign) long long uncompressedSize;
/**
* Size of the compressed file
*/
@property (readonly, assign) long long compressedSize;
/**
* YES if the file will be continued of the next volume
*/
@property (readonly) BOOL isEncryptedWithPassword;
/**
* YES if the file is a directory
*/
@property (readonly) BOOL isDirectory;
/**
* The type of compression
*/
@property (readonly, assign) URKCompressionMethod compressionMethod;
/**
* The OS of the file
*/
@property (readonly, assign) URKHostOS hostOS;
/**
* Returns a URKFileInfo instance for the given extended header data
*
* @param fileHeader The header data for a RAR file
*
* @return an instance of URKFileInfo
*/
+ (instancetype) fileInfo:(struct RARHeaderDataEx *)fileHeader;
@end