"Fossies" - the Fresh Open Source Software Archive

Member "unrar/rawread.hpp" (4 May 2022, 1078 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 "rawread.hpp" see the Fossies "Dox" file reference documentation.

    1 #ifndef _RAR_RAWREAD_
    2 #define _RAR_RAWREAD_
    3 
    4 class RawRead
    5 {
    6   private:
    7     Array<byte> Data;
    8     File *SrcFile;
    9     size_t DataSize;
   10     size_t ReadPos;
   11     CryptData *Crypt;
   12   public:
   13     RawRead();
   14     RawRead(File *SrcFile);
   15     void Reset();
   16     size_t Read(size_t Size);
   17     void Read(byte *SrcData,size_t Size);
   18     byte   Get1();
   19     ushort Get2();
   20     uint   Get4();
   21     uint64 Get8();
   22     uint64 GetV();
   23     uint   GetVSize(size_t Pos);
   24     size_t GetB(void *Field,size_t Size);
   25     void GetW(wchar *Field,size_t Size);
   26     uint GetCRC15(bool ProcessedOnly);
   27     uint GetCRC50();
   28     byte* GetDataPtr() {return &Data[0];}
   29     size_t Size() {return DataSize;}
   30     size_t PaddedSize() {return Data.Size()-DataSize;}
   31     size_t DataLeft() {return DataSize-ReadPos;}
   32     size_t GetPos() {return ReadPos;}
   33     void SetPos(size_t Pos) {ReadPos=Pos;}
   34     void Skip(size_t Size) {ReadPos+=Size;}
   35     void Rewind() {SetPos(0);}
   36     void SetCrypt(CryptData *Crypt) {RawRead::Crypt=Crypt;}
   37 };
   38 
   39 uint64 RawGetV(const byte *Data,uint &ReadPos,uint DataSize,bool &Overflow);
   40 
   41 #endif