"Fossies" - the Fresh Open Source Software Archive

Member "unrar/qopen.hpp" (4 May 2022, 1531 Bytes) of package /linux/misc/unrarsrc-6.1.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "qopen.hpp" see the Fossies "Dox" file reference documentation.

    1 #ifndef _RAR_QOPEN_
    2 #define _RAR_QOPEN_
    3 
    4 struct QuickOpenItem
    5 {
    6   byte *Header;
    7   size_t HeaderSize;
    8   uint64 ArcPos;
    9   QuickOpenItem *Next;
   10 };
   11 
   12 
   13 class Archive;
   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