Differences From Artifact [b7c2096cd2]:
- File src/OFGZIPStream.h — part of check-in [374e1a1bfa] at 2021-01-02 22:04:26 on branch trunk — Update copyright (user: js, size: 3944) [annotate] [blame] [check-ins using] [more...]
To Artifact [498f0a4cf5]:
- File
src/OFGZIPStream.h
— part of check-in
[2fcf5a3052]
at
2021-04-29 23:24:22
on branch trunk
— Clean up struct and enum typedefs
With TYPEDEF_HIDES_STRUCT set, Doxygen properly handles anonymous
structs and enums that are typedef'd. (user: js, size: 3973) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #import "OFStream.h" #import "OFDate.h" @class OFInflateStream; OF_ASSUME_NONNULL_BEGIN /** * @class OFGZIPStream OFGZIPStream.h ObjFW/OFGZIPStream.h * * @brief A class that handles GZIP compression and decompression transparently * for an underlying stream. */ OF_SUBCLASSING_RESTRICTED @interface OFGZIPStream: OFStream { OFStream *_stream; OFInflateStream *_Nullable _inflateStream; | > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | < < < < < < < < < < < < < < < < | | | < | 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 | #import "OFStream.h" #import "OFDate.h" @class OFInflateStream; OF_ASSUME_NONNULL_BEGIN /** * @brief The operating system on which compressed the data. */ typedef enum { OFGZIPStreamOperatingSystemFAT = 0, OFGZIPStreamOperatingSystemAmiga = 1, OFGZIPStreamOperatingSystemVMS = 2, OFGZIPStreamOperatingSystemUNIX = 3, OFGZIPStreamOperatingSystemVM_CMS = 4, OFGZIPStreamOperatingSystemAtariTOS = 5, OFGZIPStreamOperatingSystemHPFS = 6, OFGZIPStreamOperatingSystemMacintosh = 7, OFGZIPStreamOperatingSystemZSystem = 8, OFGZIPStreamOperatingSystemCPM = 9, OFGZIPStreamOperatingSystemTOPS20 = 10, OFGZIPStreamOperatingSystemNTFS = 11, OFGZIPStreamOperatingSystemQDO = 12, OFGZIPStreamOperatingSystemAcornRISCOS = 13, OFGZIPStreamOperatingSystemUnknown = 255 } OFGZIPStreamOperatingSystem; /** * @class OFGZIPStream OFGZIPStream.h ObjFW/OFGZIPStream.h * * @brief A class that handles GZIP compression and decompression transparently * for an underlying stream. */ OF_SUBCLASSING_RESTRICTED @interface OFGZIPStream: OFStream { OFStream *_stream; OFInflateStream *_Nullable _inflateStream; enum { OFGZIPStreamStateID1, OFGZIPStreamStateID2, OFGZIPStreamStateCompressionMethod, OFGZIPStreamStateFlags, OFGZIPStreamStateModificationDate, OFGZIPStreamStateExtraFlags, OFGZIPStreamStateOperatingSystem, OFGZIPStreamStateExtraLength, OFGZIPStreamStateExtra, OFGZIPStreamStateName, OFGZIPStreamStateComment, OFGZIPStreamStateHeaderCRC16, OFGZIPStreamStateData, OFGZIPStreamStateCRC32, OFGZIPStreamStateUncompressedSize } _state; enum { OFGZIPStreamFlagText = 0x01, OFGZIPStreamFlagHeaderCRC16 = 0x02, OFGZIPStreamFlagExtra = 0x04, OFGZIPStreamFlagName = 0x08, OFGZIPStreamFlagComment = 0x10 } _flags; uint8_t _extraFlags; OFGZIPStreamOperatingSystem _operatingSystemMadeOn; size_t _bytesRead; uint8_t _buffer[4]; OFDate *_Nullable _modificationDate; uint16_t _extraLength; uint32_t _CRC32, _uncompressedSize; } /** * @brief The operating system on which the data was compressed. * * This property is only guaranteed to be available once @ref atEndOfStream is * true. */ @property (readonly, nonatomic) OFGZIPStreamOperatingSystem operatingSystemMadeOn; /** * @brief The modification date of the original file. * * This property is only guaranteed to be available once @ref atEndOfStream is * true. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFDate *modificationDate; /** * @brief Creates a new OFGZIPStream with the specified underlying stream. * * @param stream The underlying stream for the OFGZIPStream * @param mode The mode for the OFGZIPStream. Valid modes are "r" for reading * and "w" for writing. * @return A new, autoreleased OFGZIPStream */ + (instancetype)streamWithStream: (OFStream *)stream mode: (OFString *)mode; - (instancetype)init OF_UNAVAILABLE; /** * @brief Initializes an already allocated OFGZIPStream with the specified * underlying stream. * |
︙ | ︙ |