ObjFW
Loading...
Searching...
No Matches
OFTarArchive.h
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This file is part of ObjFW. It may be distributed under the terms of the
7 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8 * the packaging of this file.
9 *
10 * Alternatively, it may be distributed under the terms of the GNU General
11 * Public License, either version 2 or 3, which can be found in the file
12 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13 * file.
14 */
15
16#import "OFObject.h"
17#import "OFString.h"
18#import "OFTarArchiveEntry.h"
19
20OF_ASSUME_NONNULL_BEGIN
21
22@class OFIRI;
23@class OFStream;
24
30OF_SUBCLASSING_RESTRICTED
32{
33 OFStream *_stream;
34 uint_least8_t _mode;
35 OFStringEncoding _encoding;
36 OFTarArchiveEntry *_Nullable _currentEntry;
37#ifdef OF_TAR_ARCHIVE_M
38@public
39#endif
40 OFStream *_Nullable _lastReturnedStream;
41}
42
46@property (nonatomic) OFStringEncoding encoding;
47
61+ (instancetype)archiveWithStream: (OFStream *)stream mode: (OFString *)mode;
62
75+ (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode;
76
86+ (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI;
87
88- (instancetype)init OF_UNAVAILABLE;
89
104- (instancetype)initWithStream: (OFStream *)stream
105 mode: (OFString *)mode OF_DESIGNATED_INITIALIZER;
106
120- (instancetype)initWithIRI: (OFIRI *)IRI mode: (OFString *)mode;
121
138- (nullable OFTarArchiveEntry *)nextEntry;
139
150- (OFStream *)streamForReadingCurrentEntry;
151
169- (OFStream *)streamForWritingEntry: (OFTarArchiveEntry *)entry;
170
176- (void)close;
177@end
178
179OF_ASSUME_NONNULL_END
OFStringEncoding
The encoding of a string.
Definition: OFString.h:61
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition: OFIRI.h:37
The root class for all other classes inside ObjFW.
Definition: OFObject.h:688
A base class for different types of streams.
Definition: OFStream.h:188
A class for handling strings.
Definition: OFString.h:135
A class which represents an entry of a tar archive.
Definition: OFTarArchiveEntry.h:56
A class for accessing and manipulating tar archives.
Definition: OFTarArchive.h:32