RemoteFiles.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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 FCyclicLink;
  97. UnicodeString FFullFileName;
  98. int FIsHidden;
  99. UnicodeString FTypeName;
  100. bool FIsEncrypted;
  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. void __fastcall SetEncrypted();
  138. static bool __fastcall IsTimeShiftingApplicable(TModificationFmt ModificationFmt);
  139. static void __fastcall ShiftTimeInSeconds(TDateTime & DateTime, TModificationFmt ModificationFmt, __int64 Seconds);
  140. __property int Attr = { read = GetAttr };
  141. __property bool BrokenLink = { read = GetBrokenLink };
  142. __property TRemoteFileList * Directory = { read = FDirectory, write = FDirectory };
  143. __property UnicodeString RightsStr = { read = GetRightsStr };
  144. __property __int64 Size = { read = GetSize, write = FSize };
  145. __property TRemoteToken Owner = { read = FOwner, write = FOwner };
  146. __property TRemoteToken Group = { read = FGroup, write = FGroup };
  147. __property UnicodeString FileName = { read = FFileName, write = FFileName };
  148. __property UnicodeString DisplayName = { read = FDisplayName, write = FDisplayName };
  149. __property int INodeBlocks = { read = FINodeBlocks };
  150. __property TDateTime Modification = { read = FModification, write = SetModification };
  151. __property UnicodeString ModificationStr = { read = GetModificationStr };
  152. __property UnicodeString UserModificationStr = { read = GetUserModificationStr };
  153. __property TModificationFmt ModificationFmt = { read = FModificationFmt, write = FModificationFmt };
  154. __property TDateTime LastAccess = { read = FLastAccess, write = FLastAccess };
  155. __property bool IsSymLink = { read = FIsSymLink };
  156. __property bool IsDirectory = { read = GetIsDirectory };
  157. __property TRemoteFile * LinkedFile = { read = GetLinkedFile, write = SetLinkedFile };
  158. __property UnicodeString LinkTo = { read = FLinkTo, write = FLinkTo };
  159. __property UnicodeString ListingStr = { read = GetListingStr, write = SetListingStr };
  160. __property TRights * Rights = { read = FRights, write = SetRights };
  161. __property UnicodeString HumanRights = { read = FHumanRights, write = FHumanRights };
  162. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  163. __property wchar_t Type = { read = GetType, write = SetType };
  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. __property bool IsEncrypted = { read = FIsEncrypted };
  174. };
  175. //---------------------------------------------------------------------------
  176. class TRemoteDirectoryFile : public TRemoteFile
  177. {
  178. public:
  179. __fastcall TRemoteDirectoryFile();
  180. };
  181. //---------------------------------------------------------------------------
  182. class TRemoteParentDirectory : public TRemoteDirectoryFile
  183. {
  184. public:
  185. __fastcall TRemoteParentDirectory(TTerminal * Terminal);
  186. };
  187. //---------------------------------------------------------------------------
  188. class TRemoteFileList : public TObjectList
  189. {
  190. friend class TSCPFileSystem;
  191. friend class TSFTPFileSystem;
  192. friend class TFTPFileSystem;
  193. friend class TWebDAVFileSystem;
  194. friend class TS3FileSystem;
  195. protected:
  196. UnicodeString FDirectory;
  197. TDateTime FTimestamp;
  198. TRemoteFile * __fastcall GetFiles(Integer Index);
  199. virtual void __fastcall SetDirectory(UnicodeString value);
  200. UnicodeString __fastcall GetFullDirectory();
  201. Boolean __fastcall GetIsRoot();
  202. TRemoteFile * __fastcall GetParentDirectory();
  203. UnicodeString __fastcall GetParentPath();
  204. __int64 __fastcall GetTotalSize();
  205. public:
  206. __fastcall TRemoteFileList();
  207. virtual void __fastcall Reset();
  208. TRemoteFile * __fastcall FindFile(const UnicodeString &FileName);
  209. virtual void __fastcall DuplicateTo(TRemoteFileList * Copy);
  210. virtual void __fastcall AddFile(TRemoteFile * File);
  211. static TStrings * __fastcall CloneStrings(TStrings * List);
  212. __property UnicodeString Directory = { read = FDirectory, write = SetDirectory };
  213. __property TRemoteFile * Files[Integer Index] = { read = GetFiles };
  214. __property UnicodeString FullDirectory = { read=GetFullDirectory };
  215. __property Boolean IsRoot = { read = GetIsRoot };
  216. __property UnicodeString ParentPath = { read = GetParentPath };
  217. __property __int64 TotalSize = { read = GetTotalSize };
  218. __property TDateTime Timestamp = { read = FTimestamp };
  219. };
  220. //---------------------------------------------------------------------------
  221. class TRemoteDirectory : public TRemoteFileList
  222. {
  223. friend class TSCPFileSystem;
  224. friend class TSFTPFileSystem;
  225. private:
  226. Boolean FIncludeParentDirectory;
  227. Boolean FIncludeThisDirectory;
  228. TTerminal * FTerminal;
  229. TRemoteFile * FParentDirectory;
  230. TRemoteFile * FThisDirectory;
  231. virtual void __fastcall SetDirectory(UnicodeString value);
  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 Boolean IncludeParentDirectory = { read = FIncludeParentDirectory, write = SetIncludeParentDirectory };
  244. __property Boolean IncludeThisDirectory = { read = FIncludeThisDirectory, write = SetIncludeThisDirectory };
  245. __property Boolean Loaded = { read = GetLoaded };
  246. __property TRemoteFile * ParentDirectory = { read = FParentDirectory };
  247. __property TRemoteFile * ThisDirectory = { read = FThisDirectory };
  248. };
  249. //---------------------------------------------------------------------------
  250. class TRemoteDirectoryCache : private TStringList
  251. {
  252. public:
  253. __fastcall TRemoteDirectoryCache();
  254. virtual __fastcall ~TRemoteDirectoryCache();
  255. bool __fastcall HasFileList(const UnicodeString Directory);
  256. bool __fastcall HasNewerFileList(const UnicodeString Directory, TDateTime Timestamp);
  257. bool __fastcall GetFileList(const UnicodeString Directory,
  258. TRemoteFileList * FileList);
  259. void __fastcall AddFileList(TRemoteFileList * FileList);
  260. void __fastcall ClearFileList(UnicodeString Directory, bool SubDirs);
  261. void __fastcall Clear();
  262. __property bool IsEmpty = { read = GetIsEmpty };
  263. protected:
  264. virtual void __fastcall Delete(int Index);
  265. private:
  266. TCriticalSection * FSection;
  267. bool __fastcall GetIsEmpty() const;
  268. void __fastcall DoClearFileList(UnicodeString Directory, bool SubDirs);
  269. };
  270. //---------------------------------------------------------------------------
  271. class TRemoteDirectoryChangesCache : private TStringList
  272. {
  273. public:
  274. __fastcall TRemoteDirectoryChangesCache(int MaxSize);
  275. void __fastcall AddDirectoryChange(const UnicodeString SourceDir,
  276. const UnicodeString Change, const UnicodeString TargetDir);
  277. void __fastcall ClearDirectoryChange(UnicodeString SourceDir);
  278. void __fastcall ClearDirectoryChangeTarget(UnicodeString TargetDir);
  279. bool __fastcall GetDirectoryChange(const UnicodeString SourceDir,
  280. const UnicodeString Change, UnicodeString & TargetDir);
  281. void __fastcall Clear();
  282. void __fastcall Serialize(UnicodeString & Data);
  283. void __fastcall Deserialize(const UnicodeString Data);
  284. __property bool IsEmpty = { read = GetIsEmpty };
  285. private:
  286. static bool __fastcall DirectoryChangeKey(const UnicodeString SourceDir,
  287. const UnicodeString Change, UnicodeString & Key);
  288. bool __fastcall GetIsEmpty() const;
  289. void __fastcall SetValue(const UnicodeString & Name, const UnicodeString & Value);
  290. UnicodeString __fastcall GetValue(const UnicodeString & Name);
  291. int FMaxSize;
  292. };
  293. //---------------------------------------------------------------------------
  294. class TRights
  295. {
  296. public:
  297. static const int TextLen = 9;
  298. static const wchar_t UndefSymbol = L'$';
  299. static const wchar_t UnsetSymbol = L'-';
  300. // Used by Win32-OpenSSH for permissions that are not applicable on Windows.
  301. // See strmode() in contrib\win32\win32compat\misc.c
  302. static const wchar_t UnsetSymbolWin = L'*';
  303. static const wchar_t BasicSymbols[];
  304. static const wchar_t CombinedSymbols[];
  305. static const wchar_t ExtendedSymbols[];
  306. static const wchar_t ModeGroups[];
  307. enum TRight {
  308. rrUserIDExec, rrGroupIDExec, rrStickyBit,
  309. rrUserRead, rrUserWrite, rrUserExec,
  310. rrGroupRead, rrGroupWrite, rrGroupExec,
  311. rrOtherRead, rrOtherWrite, rrOtherExec,
  312. rrFirst = rrUserIDExec, rrLast = rrOtherExec };
  313. enum TFlag {
  314. rfSetUID = 04000, rfSetGID = 02000, rfStickyBit = 01000,
  315. rfUserRead = 00400, rfUserWrite = 00200, rfUserExec = 00100,
  316. rfGroupRead = 00040, rfGroupWrite = 00020, rfGroupExec = 00010,
  317. rfOtherRead = 00004, rfOtherWrite = 00002, rfOtherExec = 00001,
  318. rfRead = 00444, rfWrite = 00222, rfExec = 00111,
  319. rfNo = 00000, rfDefault = 00644, rfAll = 00777,
  320. rfSpecials = 07000, rfAllSpecials = 07777 };
  321. enum TUnsupportedFlag {
  322. rfDirectory = 040000 };
  323. enum TState { rsNo, rsYes, rsUndef };
  324. public:
  325. static TFlag __fastcall RightToFlag(TRight Right);
  326. __fastcall TRights();
  327. __fastcall TRights(const TRights & Source);
  328. __fastcall TRights(unsigned short Number);
  329. void __fastcall Assign(const TRights * Source);
  330. void __fastcall AddExecute();
  331. void __fastcall AllUndef();
  332. bool __fastcall operator ==(const TRights & rhr) const;
  333. bool __fastcall operator ==(unsigned short rhr) const;
  334. bool __fastcall operator !=(const TRights & rhr) const;
  335. TRights & __fastcall operator =(const TRights & rhr);
  336. TRights & __fastcall operator =(unsigned short rhr);
  337. TRights __fastcall operator ~() const;
  338. TRights __fastcall operator &(unsigned short rhr) const;
  339. TRights __fastcall operator &(const TRights & rhr) const;
  340. TRights & __fastcall operator &=(unsigned short rhr);
  341. TRights & __fastcall operator &=(const TRights & rhr);
  342. TRights __fastcall operator |(unsigned short rhr) const;
  343. TRights __fastcall operator |(const TRights & rhr) const;
  344. TRights & __fastcall operator |=(unsigned short rhr);
  345. TRights & __fastcall operator |=(const TRights & rhr);
  346. __fastcall operator unsigned short() const;
  347. __fastcall operator unsigned long() const;
  348. __property bool AllowUndef = { read = FAllowUndef, write = SetAllowUndef };
  349. __property bool IsUndef = { read = GetIsUndef };
  350. __property UnicodeString ModeStr = { read = GetModeStr };
  351. __property UnicodeString SimplestStr = { read = GetSimplestStr };
  352. __property UnicodeString Octal = { read = GetOctal, write = SetOctal };
  353. __property unsigned short Number = { read = GetNumber, write = SetNumber };
  354. __property unsigned short NumberSet = { read = FSet };
  355. __property unsigned short NumberUnset = { read = FUnset };
  356. __property unsigned long NumberDecadic = { read = GetNumberDecadic };
  357. __property bool ReadOnly = { read = GetReadOnly, write = SetReadOnly };
  358. __property bool Right[TRight Right] = { read = GetRight, write = SetRight };
  359. __property TState RightUndef[TRight Right] = { read = GetRightUndef, write = SetRightUndef };
  360. __property UnicodeString Text = { read = GetText, write = SetText };
  361. __property bool Unknown = { read = FUnknown };
  362. private:
  363. bool FAllowUndef;
  364. unsigned short FSet;
  365. unsigned short FUnset;
  366. UnicodeString FText;
  367. bool FUnknown;
  368. bool __fastcall GetIsUndef() const;
  369. UnicodeString __fastcall GetModeStr() const;
  370. UnicodeString __fastcall GetSimplestStr() const;
  371. void __fastcall SetNumber(unsigned short value);
  372. UnicodeString __fastcall GetText() const;
  373. void __fastcall SetText(const UnicodeString & value);
  374. void __fastcall SetOctal(UnicodeString value);
  375. unsigned short __fastcall GetNumber() const;
  376. unsigned short __fastcall GetNumberSet() const;
  377. unsigned short __fastcall GetNumberUnset() const;
  378. unsigned long __fastcall GetNumberDecadic() const;
  379. UnicodeString __fastcall GetOctal() const;
  380. bool __fastcall GetReadOnly();
  381. bool __fastcall GetRight(TRight Right) const;
  382. TState __fastcall GetRightUndef(TRight Right) const;
  383. void __fastcall SetAllowUndef(bool value);
  384. void __fastcall SetReadOnly(bool value);
  385. void __fastcall SetRight(TRight Right, bool value);
  386. void __fastcall SetRightUndef(TRight Right, TState value);
  387. };
  388. //---------------------------------------------------------------------------
  389. enum TValidProperty { vpRights, vpGroup, vpOwner, vpModification, vpLastAccess, vpEncrypt };
  390. typedef Set<TValidProperty, vpRights, vpEncrypt> TValidProperties;
  391. class TRemoteProperties
  392. {
  393. public:
  394. TValidProperties Valid;
  395. bool Recursive;
  396. TRights Rights;
  397. bool AddXToDirectories;
  398. TRemoteToken Group;
  399. TRemoteToken Owner;
  400. __int64 Modification; // unix time
  401. __int64 LastAccess; // unix time
  402. bool Encrypt;
  403. __fastcall TRemoteProperties();
  404. __fastcall TRemoteProperties(const TRemoteProperties & rhp);
  405. bool __fastcall operator ==(const TRemoteProperties & rhp) const;
  406. bool __fastcall operator !=(const TRemoteProperties & rhp) const;
  407. void __fastcall Default();
  408. void __fastcall Load(THierarchicalStorage * Storage);
  409. void __fastcall Save(THierarchicalStorage * Storage) const;
  410. static TRemoteProperties __fastcall CommonProperties(TStrings * FileList);
  411. static TRemoteProperties __fastcall ChangedProperties(
  412. const TRemoteProperties & OriginalProperties, TRemoteProperties NewProperties);
  413. };
  414. //---------------------------------------------------------------------------
  415. bool __fastcall IsUnixStyleWindowsPath(const UnicodeString & Path);
  416. bool __fastcall UnixIsAbsolutePath(const UnicodeString & Path);
  417. UnicodeString __fastcall UnixIncludeTrailingBackslash(const UnicodeString Path);
  418. UnicodeString __fastcall UnixExcludeTrailingBackslash(const UnicodeString Path, bool Simple = false);
  419. UnicodeString __fastcall SimpleUnixExcludeTrailingBackslash(const UnicodeString Path);
  420. UnicodeString __fastcall UnixCombinePaths(const UnicodeString & Path1, const UnicodeString & Path2);
  421. UnicodeString __fastcall UnixExtractFileDir(const UnicodeString Path);
  422. UnicodeString __fastcall UnixExtractFilePath(const UnicodeString Path);
  423. UnicodeString __fastcall UnixExtractFileName(const UnicodeString Path);
  424. UnicodeString __fastcall UnixExtractFileExt(const UnicodeString Path);
  425. Boolean __fastcall UnixSamePath(const UnicodeString Path1, const UnicodeString Path2);
  426. bool __fastcall UnixIsChildPath(UnicodeString Parent, UnicodeString Child);
  427. bool __fastcall ExtractCommonPath(TStrings * Files, UnicodeString & Path);
  428. bool __fastcall UnixExtractCommonPath(TStrings * Files, UnicodeString & Path);
  429. UnicodeString __fastcall ExtractFileName(const UnicodeString & Path, bool Unix);
  430. bool __fastcall IsUnixRootPath(const UnicodeString Path);
  431. bool __fastcall IsUnixHiddenFile(const UnicodeString Path);
  432. UnicodeString __fastcall AbsolutePath(const UnicodeString & Base, const UnicodeString & Path);
  433. UnicodeString __fastcall FromUnixPath(const UnicodeString Path);
  434. UnicodeString __fastcall ToUnixPath(const UnicodeString Path);
  435. UnicodeString __fastcall MinimizeName(const UnicodeString FileName, int MaxLen, bool Unix);
  436. UnicodeString __fastcall MakeFileList(TStrings * FileList);
  437. TDateTime __fastcall ReduceDateTimePrecision(TDateTime DateTime,
  438. TModificationFmt Precision);
  439. TModificationFmt __fastcall LessDateTimePrecision(
  440. TModificationFmt Precision1, TModificationFmt Precision2);
  441. UnicodeString __fastcall UserModificationStr(TDateTime DateTime,
  442. TModificationFmt Precision);
  443. UnicodeString __fastcall ModificationStr(TDateTime DateTime,
  444. TModificationFmt Precision);
  445. int __fastcall FakeFileImageIndex(UnicodeString FileName, unsigned long Attrs = 0,
  446. UnicodeString * TypeName = NULL);
  447. bool __fastcall SameUserName(const UnicodeString & UserName1, const UnicodeString & UserName2);
  448. UnicodeString __fastcall FormatMultiFilesToOneConfirmation(const UnicodeString & Target, bool Unix);
  449. //---------------------------------------------------------------------------
  450. #endif