| 14 | class RawRead; |
| 15 | |
| 16 | class QuickOpen |
| 17 | { |
| 18 | private: |
| 19 | void Close(); |
| 20 | |
| 21 | |
| 22 | uint ReadBuffer(); |
| 23 | bool ReadRaw(RawRead &Raw); |
| 24 | bool ReadNext(); |
| 25 | |
| 26 | Archive *Arc; |
| 27 | bool WriteMode; |
| 28 | |
| 29 | QuickOpenItem *ListStart; |
| 30 | QuickOpenItem *ListEnd; |
| 31 | |
| 32 | byte *Buf; // Read quick open data here. |
| 33 | static const size_t MaxBufSize=0x10000; // Buf size, must be multiple of CRYPT_BLOCK_SIZE. |
| 34 | size_t CurBufSize; // Current size of buffered data in write mode. |
| 35 | #ifndef RAR_NOCRYPT // For shell extension. |
| 36 | CryptData Crypt; |
| 37 | #endif |
| 38 | |
| 39 | bool Loaded; |
| 40 | uint64 QOHeaderPos; // Main QO header position. |
| 41 | uint64 RawDataStart; // Start of QO data, just after the main header. |
| 42 | uint64 RawDataSize; // Size of entire QO data. |
| 43 | uint64 RawDataPos; // Current read position in QO data. |
| 44 | size_t ReadBufSize; // Size of Buf data currently read from QO. |
| 45 | size_t ReadBufPos; // Current read position in Buf data. |
| 46 | Array<byte> LastReadHeader; |
| 47 | uint64 LastReadHeaderPos; |
| 48 | uint64 SeekPos; |
| 49 | bool UnsyncSeekPos; // QOpen SeekPos does not match an actual file pointer. |
| 50 | public: |
| 51 | QuickOpen(); |
| 52 | ~QuickOpen(); |
| 53 | void Init(Archive *Arc,bool WriteMode); |
| 54 | void Load(uint64 BlockPos); |
| 55 | void Unload() { Loaded=false; } |
| 56 | bool Read(void *Data,size_t Size,size_t &Result); |
| 57 | bool Seek(int64 Offset,int Method); |
| 58 | bool Tell(int64 *Pos); |
| 59 | }; |
| 60 | |
| 61 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected