CopyParam.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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, ncLowerCaseShort };
  10. // TScript::OptionProc depend on the order
  11. enum TTransferMode { tmBinary, tmAscii, tmAutomatic };
  12. enum TResumeSupport { rsOn, rsSmart, rsOff };
  13. class THierarchicalStorage;
  14. //---------------------------------------------------------------------------
  15. class TCopyParamType {
  16. private:
  17. TFileMasks FAsciiFileMask;
  18. TFileNameCase FFileNameCase;
  19. bool FPreserveReadOnly;
  20. bool FPreserveTime;
  21. TRights FRights;
  22. TTransferMode FTransferMode;
  23. bool FAddXToDirectories;
  24. bool FPreserveRights;
  25. TResumeSupport FResumeSupport;
  26. __int64 FResumeThreshold;
  27. AnsiString __fastcall GetLogStr() const;
  28. bool FReplaceInvalidChars;
  29. AnsiString FLocalInvalidChars;
  30. bool FCalculateSize;
  31. AnsiString FFileMask;
  32. TFileMasks FExcludeFileMask;
  33. bool FNegativeExclude;
  34. bool FClearArchive;
  35. public:
  36. __fastcall TCopyParamType();
  37. __fastcall TCopyParamType(const TCopyParamType & Source);
  38. virtual __fastcall ~TCopyParamType();
  39. TCopyParamType & __fastcall operator =(const TCopyParamType & rhp);
  40. virtual void __fastcall Assign(const TCopyParamType * Source);
  41. virtual void __fastcall Default();
  42. AnsiString __fastcall ChangeFileName(AnsiString FileName,
  43. TOperationSide Side, bool FirstLevel) const;
  44. int __fastcall LocalFileAttrs(const TRights & Rights) const;
  45. TRights __fastcall RemoteFileRights(int Attrs) const;
  46. bool __fastcall UseAsciiTransfer(AnsiString FileName, TOperationSide Side) const;
  47. bool __fastcall AllowResume(__int64 Size) const;
  48. AnsiString __fastcall ValidLocalFileName(AnsiString FileName) const;
  49. bool __fastcall AllowTransfer(AnsiString FileName, TOperationSide Side) const;
  50. void __fastcall Load(THierarchicalStorage * Storage);
  51. void __fastcall Save(THierarchicalStorage * Storage) const;
  52. AnsiString __fastcall GetInfoStr(AnsiString Separator) const;
  53. bool __fastcall operator==(const TCopyParamType & rhp) const;
  54. __property TFileMasks AsciiFileMask = { read = FAsciiFileMask, write = FAsciiFileMask };
  55. __property TFileNameCase FileNameCase = { read = FFileNameCase, write = FFileNameCase };
  56. __property bool PreserveReadOnly = { read = FPreserveReadOnly, write = FPreserveReadOnly };
  57. __property bool PreserveTime = { read = FPreserveTime, write = FPreserveTime };
  58. __property TRights Rights = { read = FRights, write = FRights };
  59. __property TTransferMode TransferMode = { read = FTransferMode, write = FTransferMode };
  60. __property AnsiString LogStr = { read=GetLogStr };
  61. __property bool AddXToDirectories = { read=FAddXToDirectories, write=FAddXToDirectories };
  62. __property bool PreserveRights = { read = FPreserveRights, write = FPreserveRights };
  63. __property TResumeSupport ResumeSupport = { read = FResumeSupport, write = FResumeSupport };
  64. __property __int64 ResumeThreshold = { read = FResumeThreshold, write = FResumeThreshold };
  65. __property bool ReplaceInvalidChars = { read = FReplaceInvalidChars, write = FReplaceInvalidChars };
  66. __property AnsiString LocalInvalidChars = { read = FLocalInvalidChars, write = FLocalInvalidChars };
  67. __property bool CalculateSize = { read = FCalculateSize, write = FCalculateSize };
  68. __property AnsiString FileMask = { read = FFileMask, write = FFileMask };
  69. __property TFileMasks ExcludeFileMask = { read = FExcludeFileMask, write = FExcludeFileMask };
  70. __property bool NegativeExclude = { read = FNegativeExclude, write = FNegativeExclude };
  71. __property bool ClearArchive = { read = FClearArchive, write = FClearArchive };
  72. };
  73. //---------------------------------------------------------------------------
  74. #endif