RemoteFiles.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. //---------------------------------------------------------------------------
  2. #ifndef RemoteFilesH
  3. #define RemoteFilesH
  4. //---------------------------------------------------------------------------
  5. #include <vector>
  6. #include <map>
  7. //---------------------------------------------------------------------------
  8. enum TModificationFmt { mfNone, mfMDHM, mfMDY, mfFull };
  9. //---------------------------------------------------------------------------
  10. #define SYMLINKSTR L" -> "
  11. #define PARENTDIRECTORY L".."
  12. #define THISDIRECTORY L"."
  13. #define ROOTDIRECTORY L"/"
  14. #define FILETYPE_DEFAULT L'-'
  15. #define FILETYPE_SYMLINK L'L'
  16. #define FILETYPE_DIRECTORY L'D'
  17. #define PARTIAL_EXT L".filepart"
  18. //---------------------------------------------------------------------------
  19. class TTerminal;
  20. class TRights;
  21. class TRemoteFileList;
  22. class THierarchicalStorage;
  23. //---------------------------------------------------------------------------
  24. class TRemoteToken
  25. {
  26. public:
  27. __fastcall TRemoteToken();
  28. explicit __fastcall TRemoteToken(const UnicodeString & Name);
  29. void __fastcall Clear();
  30. bool __fastcall operator ==(const TRemoteToken & rht) const;
  31. bool __fastcall operator !=(const TRemoteToken & rht) const;
  32. TRemoteToken & __fastcall operator =(const TRemoteToken & rht);
  33. int __fastcall Compare(const TRemoteToken & rht) const;
  34. __property UnicodeString Name = { read = FName, write = FName };
  35. __property bool NameValid = { read = GetNameValid };
  36. __property unsigned int ID = { read = FID, write = SetID };
  37. __property bool IDValid = { read = FIDValid };
  38. __property bool IsSet = { read = GetIsSet };
  39. __property UnicodeString LogText = { read = GetLogText };
  40. __property UnicodeString DisplayText = { read = GetDisplayText };
  41. private:
  42. UnicodeString FName;
  43. unsigned int FID;
  44. bool FIDValid;
  45. void __fastcall SetID(unsigned int value);
  46. bool __fastcall GetNameValid() const;
  47. bool __fastcall GetIsSet() const;
  48. UnicodeString __fastcall GetDisplayText() const;
  49. UnicodeString __fastcall GetLogText() const;
  50. };
  51. //---------------------------------------------------------------------------
  52. class TRemoteTokenList
  53. {
  54. public:
  55. TRemoteTokenList * __fastcall Duplicate() const;
  56. void __fastcall Clear();
  57. void __fastcall Add(const TRemoteToken & Token);
  58. void __fastcall AddUnique(const TRemoteToken & Token);
  59. bool __fastcall Exists(const UnicodeString & Name) const;
  60. const TRemoteToken * Find(unsigned int ID) const;
  61. const TRemoteToken * Find(const UnicodeString & Name) const;
  62. void __fastcall Log(TTerminal * Terminal, const wchar_t * Title);
  63. int __fastcall Count() const;
  64. const TRemoteToken * __fastcall Token(int Index) const;
  65. private:
  66. typedef std::vector<TRemoteToken> TTokens;
  67. typedef std::map<UnicodeString, size_t> TNameMap;
  68. typedef std::map<unsigned int, size_t> TIDMap;
  69. TTokens FTokens;
  70. TNameMap FNameMap;
  71. TIDMap FIDMap;
  72. };
  73. //---------------------------------------------------------------------------
  74. class TRemoteFile : public TPersistent
  75. {
  76. private:
  77. TRemoteFileList * FDirectory;
  78. TRemoteToken FOwner;
  79. TModificationFmt FModificationFmt;
  80. __int64 FSize;
  81. UnicodeString FFileName;
  82. UnicodeString FDisplayName;
  83. Integer FINodeBlocks;
  84. TDateTime FModification;
  85. TDateTime FLastAccess;
  86. TRemoteToken FGroup;
  87. Integer FIconIndex;
  88. Boolean FIsSymLink;
  89. TRemoteFile * FLinkedFile;
  90. TRemoteFile * FLinkedByFile;
  91. UnicodeString FLinkTo;
  92. TRights *FRights;
  93. UnicodeString FHumanRights;
  94. TTerminal *FTerminal;
  95. wchar_t FType;
  96. bool FSelected;
  97. bool FCyclicLink;
  98. UnicodeString FFullFileName;
  99. int FIsHidden;
  100. UnicodeString FTypeName;
  101. int __fastcall GetAttr();
  102. bool __fastcall GetBrokenLink();
  103. bool __fastcall GetIsDirectory() const;
  104. TRemoteFile * __fastcall GetLinkedFile();
  105. void __fastcall SetLinkedFile(TRemoteFile * value);
  106. UnicodeString __fastcall GetModificationStr();
  107. void __fastcall SetModification(const TDateTime & value);
  108. void __fastcall SetListingStr(UnicodeString value);
  109. UnicodeString __fastcall GetListingStr();
  110. UnicodeString __fastcall GetRightsStr();
  111. wchar_t __fastcall GetType() const;
  112. void __fastcall SetType(wchar_t AType);
  113. void __fastcall SetTerminal(TTerminal * value);
  114. void __fastcall SetRights(TRights * value);
  115. UnicodeString __fastcall GetFullFileName() const;
  116. bool __fastcall GetHaveFullFileName() const;
  117. int __fastcall GetIconIndex() const;
  118. UnicodeString __fastcall GetTypeName();
  119. bool __fastcall GetIsHidden();
  120. void __fastcall SetIsHidden(bool value);
  121. bool __fastcall GetIsParentDirectory() const;
  122. bool __fastcall GetIsThisDirectory() const;
  123. bool __fastcall GetIsInaccesibleDirectory() const;
  124. UnicodeString __fastcall GetExtension();
  125. UnicodeString __fastcall GetUserModificationStr();
  126. void __fastcall LoadTypeInfo();
  127. __int64 __fastcall GetSize() const;
  128. protected:
  129. void __fastcall FindLinkedFile();
  130. public:
  131. __fastcall TRemoteFile(TRemoteFile * ALinkedByFile = NULL);
  132. virtual __fastcall ~TRemoteFile();
  133. TRemoteFile * __fastcall Duplicate(bool Standalone = true) const;
  134. void __fastcall ShiftTimeInSeconds(__int64 Seconds);
  135. bool __fastcall IsTimeShiftingApplicable();
  136. void __fastcall Complete();
  137. static bool __fastcall IsTimeShiftingApplicable(TModificationFmt ModificationFmt);
  138. static void __fastcall ShiftTimeInSeconds(TDateTime & DateTime, TModificationFmt ModificationFmt, __int64 Seconds);
  139. __property int Attr = { read = GetAttr };
  140. __property bool BrokenLink = { read = GetBrokenLink };
  141. __property TRemoteFileList * Directory = { read = FDirectory, write = FDirectory };
  142. __property UnicodeString RightsStr = { read = GetRightsStr };
  143. __property __int64 Size = { read = GetSize, write = FSize };
  144. __property TRemoteToken Owner = { read = FOwner, write = FOwner };
  145. __property TRemoteToken Group = { read = FGroup, write = FGroup };
  146. __property UnicodeString FileName = { read = FFileName, write = FFileName };
  147. __property UnicodeString DisplayName = { read = FDisplayName, write = FDisplayName };
  148. __property int INodeBlocks = { read = FINodeBlocks };
  149. __property TDateTime Modification = { read = FModification, write = SetModification };
  150. __property UnicodeString ModificationStr = { read = GetModificationStr };
  151. __property UnicodeString UserModificationStr = { read = GetUserModificationStr };
  152. __property TModificationFmt ModificationFmt = { read = FModificationFmt, write = FModificationFmt };
  153. __property TDateTime LastAccess = { read = FLastAccess, write = FLastAccess };
  154. __property bool IsSymLink = { read = FIsSymLink };
  155. __property bool IsDirectory = { read = GetIsDirectory };
  156. __property TRemoteFile * LinkedFile = { read = GetLinkedFile, write = SetLinkedFile };
  157. __property UnicodeString LinkTo = { read = FLinkTo, write = FLinkTo };
  158. __property UnicodeString ListingStr = { read = GetListingStr, write = SetListingStr };
  159. __property TRights * Rights = { read = FRights, write = SetRights };
  160. __property UnicodeString HumanRights = { read = FHumanRights, write = FHumanRights };
  161. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  162. __property wchar_t Type = { read = GetType, write = SetType };
  163. __property bool Selected = { read=FSelected, write=FSelected };
  164. __property UnicodeString FullFileName = { read = GetFullFileName, write = FFullFileName };
  165. __property bool HaveFullFileName = { read = GetHaveFullFileName };
  166. __property int IconIndex = { read = GetIconIndex };
  167. __property UnicodeString TypeName = { read = GetTypeName };
  168. __property bool IsHidden = { read = GetIsHidden, write = SetIsHidden };
  169. __property bool IsParentDirectory = { read = GetIsParentDirectory };
  170. __property bool IsThisDirectory = { read = GetIsThisDirectory };
  171. __property bool IsInaccesibleDirectory = { read=GetIsInaccesibleDirectory };
  172. __property UnicodeString Extension = { read=GetExtension };
  173. };
  174. //---------------------------------------------------------------------------
  175. class TRemoteDirectoryFile : public TRemoteFile
  176. {
  177. public:
  178. __fastcall TRemoteDirectoryFile();
  179. };
  180. //---------------------------------------------------------------------------
  181. class TRemoteParentDirectory : public TRemoteDirectoryFile
  182. {
  183. public:
  184. __fastcall TRemoteParentDirectory(TTerminal * Terminal);
  185. };
  186. //---------------------------------------------------------------------------
  187. class TRemoteFileList : public TObjectList
  188. {
  189. friend class TSCPFileSystem;
  190. friend class TSFTPFileSystem;
  191. friend class TFTPFileSystem;
  192. friend class TWebDAVFileSystem;
  193. protected:
  194. UnicodeString FDirectory;
  195. TDateTime FTimestamp;
  196. TRemoteFile * __fastcall GetFiles(Integer Index);
  197. virtual void __fastcall SetDirectory(UnicodeString value);
  198. UnicodeString __fastcall GetFullDirectory();
  199. Boolean __fastcall GetIsRoot();
  200. TRemoteFile * __fastcall GetParentDirectory();
  201. UnicodeString __fastcall GetParentPath();
  202. __int64 __fastcall GetTotalSize();
  203. public:
  204. __fastcall TRemoteFileList();
  205. virtual void __fastcall Reset();
  206. TRemoteFile * __fastcall FindFile(const UnicodeString &FileName);
  207. virtual void __fastcall DuplicateTo(TRemoteFileList * Copy);
  208. virtual void __fastcall AddFile(TRemoteFile * File);
  209. static TStrings * __fastcall CloneStrings(TStrings * List);
  210. __property UnicodeString Directory = { read = FDirectory, write = SetDirectory };
  211. __property TRemoteFile * Files[Integer Index] = { read = GetFiles };
  212. __property UnicodeString FullDirectory = { read=GetFullDirectory };
  213. __property Boolean IsRoot = { read = GetIsRoot };
  214. __property UnicodeString ParentPath = { read = GetParentPath };
  215. __property __int64 TotalSize = { read = GetTotalSize };
  216. __property TDateTime Timestamp = { read = FTimestamp };
  217. };
  218. //---------------------------------------------------------------------------
  219. class TRemoteDirectory : public TRemoteFileList
  220. {
  221. friend class TSCPFileSystem;
  222. friend class TSFTPFileSystem;
  223. private:
  224. Boolean FIncludeParentDirectory;
  225. Boolean FIncludeThisDirectory;
  226. TTerminal * FTerminal;
  227. TStrings * FSelectedFiles;
  228. TRemoteFile * FParentDirectory;
  229. TRemoteFile * FThisDirectory;
  230. virtual void __fastcall SetDirectory(UnicodeString value);
  231. TStrings * __fastcall GetSelectedFiles();
  232. Boolean __fastcall GetLoaded();
  233. void __fastcall SetIncludeParentDirectory(Boolean value);
  234. void __fastcall SetIncludeThisDirectory(Boolean value);
  235. void __fastcall ReleaseRelativeDirectories();
  236. public:
  237. __fastcall TRemoteDirectory(TTerminal * aTerminal, TRemoteDirectory * Template = NULL);
  238. virtual __fastcall ~TRemoteDirectory();
  239. virtual void __fastcall AddFile(TRemoteFile * File);
  240. virtual void __fastcall DuplicateTo(TRemoteFileList * Copy);
  241. virtual void __fastcall Reset();
  242. __property TTerminal * Terminal = { read = FTerminal, write = FTerminal };
  243. __property TStrings * SelectedFiles = { read=GetSelectedFiles };
  244. __property Boolean IncludeParentDirectory = { read = FIncludeParentDirectory, write = SetIncludeParentDirectory };
  245. __property Boolean IncludeThisDirectory = { read = FIncludeThisDirectory, write = SetIncludeThisDirectory };
  246. __property Boolean Loaded = { read = GetLoaded };
  247. __property TRemoteFile * ParentDirectory = { read = FParentDirectory };
  248. __property TRemoteFile * ThisDirectory = { read = FThisDirectory };
  249. };
  250. //---------------------------------------------------------------------------
  251. class TRemoteDirectoryCache : private TStringList
  252. {
  253. public:
  254. __fastcall TRemoteDirectoryCache();
  255. virtual __fastcall ~TRemoteDirectoryCache();
  256. bool __fastcall HasFileList(const UnicodeString Directory);
  257. bool __fastcall HasNewerFileList(const UnicodeString Directory, TDateTime Timestamp);
  258. bool __fastcall GetFileList(const UnicodeString Directory,
  259. TRemoteFileList * FileList);
  260. void __fastcall AddFileList(TRemoteFileList * FileList);
  261. void __fastcall ClearFileList(UnicodeString Directory, bool SubDirs);
  262. void __fastcall Clear();
  263. __property bool IsEmpty = { read = GetIsEmpty };
  264. protected:
  265. virtual void __fastcall Delete(int Index);
  266. private:
  267. TCriticalSection * FSection;
  268. bool __fastcall GetIsEmpty() const;
  269. void __fastcall DoClearFileList(UnicodeString Directory, bool SubDirs);
  270. };
  271. //---------------------------------------------------------------------------
  272. class TRemoteDirectoryChangesCache : private TStringList
  273. {
  274. public:
  275. __fastcall TRemoteDirectoryChangesCache(int MaxSize);
  276. void __fastcall AddDirectoryChange(const UnicodeString SourceDir,
  277. const UnicodeString Change, const UnicodeString TargetDir);
  278. void __fastcall ClearDirectoryChange(UnicodeString SourceDir);
  279. void __fastcall ClearDirectoryChangeTarget(UnicodeString TargetDir);
  280. bool __fastcall GetDirectoryChange(const UnicodeString SourceDir,
  281. const UnicodeString Change, UnicodeString & TargetDir);
  282. void __fastcall Clear();
  283. void __fastcall Serialize(UnicodeString & Data);
  284. void __fastcall Deserialize(const UnicodeString Data);
  285. __property bool IsEmpty = { read = GetIsEmpty };
  286. private:
  287. static bool __fastcall DirectoryChangeKey(const UnicodeString SourceDir,
  288. const UnicodeString Change, UnicodeString & Key);
  289. bool __fastcall GetIsEmpty() const;
  290. void __fastcall SetValue(const UnicodeString & Name, const UnicodeString & Value);
  291. UnicodeString __fastcall GetValue(const UnicodeString & Name);
  292. int FMaxSize;
  293. };
  294. //---------------------------------------------------------------------------
  295. class TRights
  296. {
  297. public:
  298. static const int TextLen = 9;
  299. static const wchar_t UndefSymbol = L'$';
  300. static const wchar_t UnsetSymbol = L'-';
  301. static const wchar_t BasicSymbols[];
  302. static const wchar_t CombinedSymbols[];
  303. static const wchar_t ExtendedSymbols[];
  304. static const wchar_t ModeGroups[];
  305. enum TRight {
  306. rrUserIDExec, rrGroupIDExec, rrStickyBit,
  307. rrUserRead, rrUserWrite, rrUserExec,
  308. rrGroupRead, rrGroupWrite, rrGroupExec,
  309. rrOtherRead, rrOtherWrite, rrOtherExec,
  310. rrFirst = rrUserIDExec, rrLast = rrOtherExec };
  311. enum TFlag {
  312. rfSetUID = 04000, rfSetGID = 02000, rfStickyBit = 01000,
  313. rfUserRead = 00400, rfUserWrite = 00200, rfUserExec = 00100,
  314. rfGroupRead = 00040, rfGroupWrite = 00020, rfGroupExec = 00010,
  315. rfOtherRead = 00004, rfOtherWrite = 00002, rfOtherExec = 00001,
  316. rfRead = 00444, rfWrite = 00222, rfExec = 00111,
  317. rfNo = 00000, rfDefault = 00644, rfAll = 00777,
  318. rfSpecials = 07000, rfAllSpecials = 07777 };
  319. enum TUnsupportedFlag {
  320. rfDirectory = 040000 };
  321. enum TState { rsNo, rsYes, rsUndef };
  322. public:
  323. static TFlag __fastcall RightToFlag(TRight Right);
  324. __fastcall TRights();
  325. __fastcall TRights(const TRights & Source);
  326. __fastcall TRights(unsigned short Number);
  327. void __fastcall Assign(const TRights * Source);
  328. void __fastcall AddExecute();
  329. void __fastcall AllUndef();
  330. bool __fastcall operator ==(const TRights & rhr) const;
  331. bool __fastcall operator ==(unsigned short rhr) const;
  332. bool __fastcall operator !=(const TRights & rhr) const;
  333. TRights & __fastcall operator =(const TRights & rhr);
  334. TRights & __fastcall operator =(unsigned short rhr);
  335. TRights __fastcall operator ~() const;
  336. TRights __fastcall operator &(unsigned short rhr) const;
  337. TRights __fastcall operator &(const TRights & rhr) const;
  338. TRights & __fastcall operator &=(unsigned short rhr);
  339. TRights & __fastcall operator &=(const TRights & rhr);
  340. TRights __fastcall operator |(unsigned short rhr) const;
  341. TRights __fastcall operator |(const TRights & rhr) const;
  342. TRights & __fastcall operator |=(unsigned short rhr);
  343. TRights & __fastcall operator |=(const TRights & rhr);
  344. __fastcall operator unsigned short() const;
  345. __fastcall operator unsigned long() const;
  346. __property bool AllowUndef = { read = FAllowUndef, write = SetAllowUndef };
  347. __property bool IsUndef = { read = GetIsUndef };
  348. __property UnicodeString ModeStr = { read = GetModeStr };
  349. __property UnicodeString SimplestStr = { read = GetSimplestStr };
  350. __property UnicodeString Octal = { read = GetOctal, write = SetOctal };
  351. __property unsigned short Number = { read = GetNumber, write = SetNumber };
  352. __property unsigned short NumberSet = { read = FSet };
  353. __property unsigned short NumberUnset = { read = FUnset };
  354. __property unsigned long NumberDecadic = { read = GetNumberDecadic };
  355. __property bool ReadOnly = { read = GetReadOnly, write = SetReadOnly };
  356. __property bool Right[TRight Right] = { read = GetRight, write = SetRight };
  357. __property TState RightUndef[TRight Right] = { read = GetRightUndef, write = SetRightUndef };
  358. __property UnicodeString Text = { read = GetText, write = SetText };
  359. __property bool Unknown = { read = FUnknown };
  360. private:
  361. bool FAllowUndef;
  362. unsigned short FSet;
  363. unsigned short FUnset;
  364. UnicodeString FText;
  365. bool FUnknown;
  366. bool __fastcall GetIsUndef() const;
  367. UnicodeString __fastcall GetModeStr() const;
  368. UnicodeString __fastcall GetSimplestStr() const;
  369. void __fastcall SetNumber(unsigned short value);
  370. UnicodeString __fastcall GetText() const;
  371. void __fastcall SetText(const UnicodeString & value);
  372. void __fastcall SetOctal(UnicodeString value);
  373. unsigned short __fastcall GetNumber() const;
  374. unsigned short __fastcall GetNumberSet() const;
  375. unsigned short __fastcall GetNumberUnset() const;
  376. unsigned long __fastcall GetNumberDecadic() const;
  377. UnicodeString __fastcall GetOctal() const;
  378. bool __fastcall GetReadOnly();
  379. bool __fastcall GetRight(TRight Right) const;
  380. TState __fastcall GetRightUndef(TRight Right) const;
  381. void __fastcall SetAllowUndef(bool value);
  382. void __fastcall SetReadOnly(bool value);
  383. void __fastcall SetRight(TRight Right, bool value);
  384. void __fastcall SetRightUndef(TRight Right, TState value);
  385. };
  386. //---------------------------------------------------------------------------
  387. enum TValidProperty { vpRights, vpGroup, vpOwner, vpModification, vpLastAccess };
  388. typedef Set<TValidProperty, vpRights, vpLastAccess> TValidProperties;
  389. class TRemoteProperties
  390. {
  391. public:
  392. TValidProperties Valid;
  393. bool Recursive;
  394. TRights Rights;
  395. bool AddXToDirectories;
  396. TRemoteToken Group;
  397. TRemoteToken Owner;
  398. __int64 Modification; // unix time
  399. __int64 LastAccess; // unix time
  400. __fastcall TRemoteProperties();
  401. __fastcall TRemoteProperties(const TRemoteProperties & rhp);
  402. bool __fastcall operator ==(const TRemoteProperties & rhp) const;
  403. bool __fastcall operator !=(const TRemoteProperties & rhp) const;
  404. void __fastcall Default();
  405. void __fastcall Load(THierarchicalStorage * Storage);
  406. void __fastcall Save(THierarchicalStorage * Storage) const;
  407. static TRemoteProperties __fastcall CommonProperties(TStrings * FileList);
  408. static TRemoteProperties __fastcall ChangedProperties(
  409. const TRemoteProperties & OriginalProperties, TRemoteProperties NewProperties);
  410. };
  411. //---------------------------------------------------------------------------
  412. bool __fastcall IsUnixStyleWindowsPath(const UnicodeString & Path);
  413. bool __fastcall UnixIsAbsolutePath(const UnicodeString & Path);
  414. UnicodeString __fastcall UnixIncludeTrailingBackslash(const UnicodeString Path);
  415. UnicodeString __fastcall UnixExcludeTrailingBackslash(const UnicodeString Path, bool Simple = false);
  416. UnicodeString __fastcall SimpleUnixExcludeTrailingBackslash(const UnicodeString Path);
  417. UnicodeString __fastcall UnixExtractFileDir(const UnicodeString Path);
  418. UnicodeString __fastcall UnixExtractFilePath(const UnicodeString Path);
  419. UnicodeString __fastcall UnixExtractFileName(const UnicodeString Path);
  420. UnicodeString __fastcall UnixExtractFileExt(const UnicodeString Path);
  421. Boolean __fastcall UnixSamePath(const UnicodeString Path1, const UnicodeString Path2);
  422. bool __fastcall UnixIsChildPath(UnicodeString Parent, UnicodeString Child);
  423. bool __fastcall ExtractCommonPath(TStrings * Files, UnicodeString & Path);
  424. bool __fastcall UnixExtractCommonPath(TStrings * Files, UnicodeString & Path);
  425. UnicodeString __fastcall ExtractFileName(const UnicodeString & Path, bool Unix);
  426. bool __fastcall IsUnixRootPath(const UnicodeString Path);
  427. bool __fastcall IsUnixHiddenFile(const UnicodeString Path);
  428. UnicodeString __fastcall AbsolutePath(const UnicodeString & Base, const UnicodeString & Path);
  429. UnicodeString __fastcall FromUnixPath(const UnicodeString Path);
  430. UnicodeString __fastcall ToUnixPath(const UnicodeString Path);
  431. UnicodeString __fastcall MinimizeName(const UnicodeString FileName, int MaxLen, bool Unix);
  432. UnicodeString __fastcall MakeFileList(TStrings * FileList);
  433. TDateTime __fastcall ReduceDateTimePrecision(TDateTime DateTime,
  434. TModificationFmt Precision);
  435. TModificationFmt __fastcall LessDateTimePrecision(
  436. TModificationFmt Precision1, TModificationFmt Precision2);
  437. UnicodeString __fastcall UserModificationStr(TDateTime DateTime,
  438. TModificationFmt Precision);
  439. UnicodeString __fastcall ModificationStr(TDateTime DateTime,
  440. TModificationFmt Precision);
  441. int __fastcall FakeFileImageIndex(UnicodeString FileName, unsigned long Attrs = 0,
  442. UnicodeString * TypeName = NULL);
  443. bool __fastcall SameUserName(const UnicodeString & UserName1, const UnicodeString & UserName2);
  444. UnicodeString __fastcall FormatMultiFilesToOneConfirmation(const UnicodeString & Target, bool Unix);
  445. //---------------------------------------------------------------------------
  446. #endif