148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
static void
addFiles(id <Archive> archive, OFArray OF_GENERIC(OFString *) *files)
{
OFMutableArray *expandedFiles =
[OFMutableArray arrayWithCapacity: files.count];
OFFileManager *fileManager = [OFFileManager defaultManager];
for (OFString *file in files)
if ([fileManager directoryExistsAtPath: file])
[expandedFiles addObjectsFromArray:
[fileManager subpathsOfDirectoryAtPath: file]];
else
[expandedFiles addObject: file];
[archive addFiles: expandedFiles];
}
@implementation OFArc
- (void)applicationDidFinishLaunching
{
|
|
>
>
|
>
>
|
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
static void
addFiles(id <Archive> archive, OFArray OF_GENERIC(OFString *) *files)
{
OFMutableArray *expandedFiles =
[OFMutableArray arrayWithCapacity: files.count];
OFFileManager *fileManager = [OFFileManager defaultManager];
for (OFString *file in files) {
OFFileAttributes attributes =
[fileManager attributesOfItemAtPath: file];
if ([attributes.fileType isEqual: OFFileTypeDirectory])
[expandedFiles addObjectsFromArray:
[fileManager subpathsOfDirectoryAtPath: file]];
else
[expandedFiles addObject: file];
}
[archive addFiles: expandedFiles];
}
@implementation OFArc
- (void)applicationDidFinishLaunching
{
|