| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //---------------------------------------------------------------------------
- #ifndef CopyParamH
- #define CopyParamH
- #include "FileMasks.h"
- #include "RemoteFiles.h"
- //---------------------------------------------------------------------------
- // When adding new options, mind TCopyParamType::GetLogStr()
- enum TOperationSide { osLocal, osRemote, osCurrent };
- enum TFileNameCase { ncNoChange, ncUpperCase, ncLowerCase, ncFirstUpperCase };
- enum TTransferMode { tmBinary, tmAscii, tmAutomatic };
- enum TResumeSupport { rsOn, rsSmart, rsOff };
- //---------------------------------------------------------------------------
- class TCopyParamType {
- private:
- TFileMasks FAsciiFileMask;
- TFileNameCase FFileNameCase;
- bool FPreserveReadOnly;
- bool FPreserveTime;
- TRights FRights;
- TTransferMode FTransferMode;
- bool FAddXToDirectories;
- bool FPreserveRights;
- TResumeSupport FResumeSupport;
- __int64 FResumeThreshold;
- AnsiString __fastcall GetLogStr() const;
- bool FReplaceInvalidChars;
- AnsiString FLocalInvalidChars;
- bool FCalculateSize;
- AnsiString FFileMask;
- public:
- __fastcall TCopyParamType();
- __fastcall TCopyParamType(const TCopyParamType & Source);
- TCopyParamType & __fastcall operator =(const TCopyParamType & rhp);
- void __fastcall Assign(const TCopyParamType & Source);
- void __fastcall Default();
- AnsiString __fastcall ChangeFileName(AnsiString FileName,
- TOperationSide Side, bool FirstLevel) const;
- int __fastcall LocalFileAttrs(const TRights & Rights) const;
- TRights __fastcall RemoteFileRights(int Attrs) const;
- bool __fastcall UseAsciiTransfer(const AnsiString FileName) const;
- bool __fastcall AllowResume(__int64 Size) const;
- AnsiString __fastcall ValidLocalFileName(AnsiString FileName) const;
- __property TFileMasks AsciiFileMask = { read = FAsciiFileMask, write = FAsciiFileMask };
- __property TFileNameCase FileNameCase = { read = FFileNameCase, write = FFileNameCase };
- __property bool PreserveReadOnly = { read = FPreserveReadOnly, write = FPreserveReadOnly };
- __property bool PreserveTime = { read = FPreserveTime, write = FPreserveTime };
- __property TRights Rights = { read = FRights, write = FRights };
- __property TTransferMode TransferMode = { read = FTransferMode, write = FTransferMode };
- __property AnsiString LogStr = { read=GetLogStr };
- __property bool AddXToDirectories = { read=FAddXToDirectories, write=FAddXToDirectories };
- __property bool PreserveRights = { read = FPreserveRights, write = FPreserveRights };
- __property TResumeSupport ResumeSupport = { read = FResumeSupport, write = FResumeSupport };
- __property __int64 ResumeThreshold = { read = FResumeThreshold, write = FResumeThreshold };
- __property bool ReplaceInvalidChars = { read = FReplaceInvalidChars, write = FReplaceInvalidChars };
- __property AnsiString LocalInvalidChars = { read = FLocalInvalidChars, write = FLocalInvalidChars };
- __property bool CalculateSize = { read = FCalculateSize, write = FCalculateSize };
- __property AnsiString FileMask = { read = FFileMask, write = FFileMask };
- };
- //---------------------------------------------------------------------------
- #endif
|