CopyParam.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //---------------------------------------------------------------------------
  2. #ifndef CopyParamH
  3. #define CopyParamH
  4. #include "FileMasks.h"
  5. #include "RemoteFiles.h"
  6. //---------------------------------------------------------------------------
  7. // When adding new options, mind TCopyParamType::GetLogStr()
  8. enum TOperationSide { osLocal, osRemote, osCurrent };
  9. enum TFileNameCase { ncNoChange, ncUpperCase, ncLowerCase, ncFirstUpperCase };
  10. enum TTransferMode { tmBinary, tmAscii, tmAutomatic };
  11. enum TResumeSupport { rsOn, rsSmart, rsOff };
  12. //---------------------------------------------------------------------------
  13. class TCopyParamType {
  14. private:
  15. TFileMasks FAsciiFileMask;
  16. TFileNameCase FFileNameCase;
  17. bool FPreserveReadOnly;
  18. bool FPreserveTime;
  19. TRights FRights;
  20. TTransferMode FTransferMode;
  21. bool FAddXToDirectories;
  22. bool FPreserveRights;
  23. TResumeSupport FResumeSupport;
  24. __int64 FResumeThreshold;
  25. AnsiString __fastcall GetLogStr() const;
  26. bool FReplaceInvalidChars;
  27. AnsiString FLocalInvalidChars;
  28. bool FCalculateSize;
  29. AnsiString FFileMask;
  30. public:
  31. __fastcall TCopyParamType();
  32. __fastcall TCopyParamType(const TCopyParamType & Source);
  33. TCopyParamType & __fastcall operator =(const TCopyParamType & rhp);
  34. void __fastcall Assign(const TCopyParamType & Source);
  35. void __fastcall Default();
  36. AnsiString __fastcall ChangeFileName(AnsiString FileName,
  37. TOperationSide Side, bool FirstLevel) const;
  38. int __fastcall LocalFileAttrs(const TRights & Rights) const;
  39. TRights __fastcall RemoteFileRights(int Attrs) const;
  40. bool __fastcall UseAsciiTransfer(const AnsiString FileName) const;
  41. bool __fastcall AllowResume(__int64 Size) const;
  42. AnsiString __fastcall ValidLocalFileName(AnsiString FileName) const;
  43. __property TFileMasks AsciiFileMask = { read = FAsciiFileMask, write = FAsciiFileMask };
  44. __property TFileNameCase FileNameCase = { read = FFileNameCase, write = FFileNameCase };
  45. __property bool PreserveReadOnly = { read = FPreserveReadOnly, write = FPreserveReadOnly };
  46. __property bool PreserveTime = { read = FPreserveTime, write = FPreserveTime };
  47. __property TRights Rights = { read = FRights, write = FRights };
  48. __property TTransferMode TransferMode = { read = FTransferMode, write = FTransferMode };
  49. __property AnsiString LogStr = { read=GetLogStr };
  50. __property bool AddXToDirectories = { read=FAddXToDirectories, write=FAddXToDirectories };
  51. __property bool PreserveRights = { read = FPreserveRights, write = FPreserveRights };
  52. __property TResumeSupport ResumeSupport = { read = FResumeSupport, write = FResumeSupport };
  53. __property __int64 ResumeThreshold = { read = FResumeThreshold, write = FResumeThreshold };
  54. __property bool ReplaceInvalidChars = { read = FReplaceInvalidChars, write = FReplaceInvalidChars };
  55. __property AnsiString LocalInvalidChars = { read = FLocalInvalidChars, write = FLocalInvalidChars };
  56. __property bool CalculateSize = { read = FCalculateSize, write = FCalculateSize };
  57. __property AnsiString FileMask = { read = FFileMask, write = FFileMask };
  58. };
  59. //---------------------------------------------------------------------------
  60. #endif