headers.cpp 993 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "rar.hpp"
  2. void FileHeader::Reset(size_t SubDataSize)
  3. {
  4. SubData.Alloc(SubDataSize);
  5. BaseBlock::Reset();
  6. FileHash.Init(HASH_NONE);
  7. mtime.Reset();
  8. atime.Reset();
  9. ctime.Reset();
  10. SplitBefore=false;
  11. SplitAfter=false;
  12. UnknownUnpSize=0;
  13. SubFlags=0; // Important for RAR 3.0 subhead.
  14. CryptMethod=CRYPT_NONE;
  15. Encrypted=false;
  16. SaltSet=false;
  17. UsePswCheck=false;
  18. UseHashKey=false;
  19. Lg2Count=0;
  20. Solid=false;
  21. Dir=false;
  22. WinSize=0;
  23. Inherited=false;
  24. SubBlock=false;
  25. CommentInHeader=false;
  26. Version=false;
  27. LargeFile=false;
  28. RedirType=FSREDIR_NONE;
  29. DirTarget=false;
  30. UnixOwnerSet=false;
  31. }
  32. FileHeader& FileHeader::operator = (FileHeader &hd)
  33. {
  34. SubData.Reset();
  35. memcpy(this,&hd,sizeof(*this));
  36. SubData.CleanData();
  37. SubData=hd.SubData;
  38. return *this;
  39. }
  40. void MainHeader::Reset()
  41. {
  42. HighPosAV=0;
  43. PosAV=0;
  44. CommentInHeader=false;
  45. PackComment=false;
  46. Locator=false;
  47. QOpenOffset=0;
  48. QOpenMaxSize=0;
  49. RROffset=0;
  50. RRMaxSize=0;
  51. }