System.IOUtils.TDirectory
Delphi
TDirectory = record
C++
struct DECLSPEC_DRECORD TDirectory
{
public:
__interface DELPHIINTERFACE TFilterPredicate;
typedef System::DelphiInterface<TFilterPredicate> _di_TFilterPredicate;
__interface TFilterPredicate : public System::IInterface
{
virtual bool __fastcall Invoke(const System::UnicodeString Path, const System::Sysutils::TSearchRec &SearchRec) = 0 ;
};
private:
__interface DELPHIINTERFACE TDirectoryWalkProc;
typedef System::DelphiInterface<TDirectoryWalkProc> _di_TDirectoryWalkProc;
__interface TDirectoryWalkProc : public System::IInterface
{
virtual bool __fastcall Invoke(const System::UnicodeString Path, const System::Sysutils::TSearchRec &FileInfo) = 0 ;
};
class DELPHICLASS TEnumerator;
#ifndef _WIN64
#pragma pack(push,4)
#endif /* not _WIN64 */
class PASCALIMPLEMENTATION TEnumerator : public System::TInterfacedObject
{
typedef System::TInterfacedObject inherited;
private:
class DELPHICLASS TItem;
#ifndef _WIN64
#pragma pack(push,8)
#endif /* not _WIN64 */
class PASCALIMPLEMENTATION TItem : public System::TObject
{
typedef System::TObject inherited;
private:
System::UnicodeString FPath;
System::Sysutils::TSearchRec FSearchRec;
public:
__fastcall TItem(const System::UnicodeString APath);
__fastcall virtual ~TItem();
};
#ifndef _WIN64
#pragma pack(pop)
#endif /* not _WIN64 */
private:
System::UnicodeString FPath;
System::UnicodeString FPattern;
TDirectory::_di_TDirectoryWalkProc FCallback;
bool FRecursive;
System::Generics::Collections::TStack__1<TItem*>* FStack;
bool FInit;
protected:
void __fastcall Reset();
bool __fastcall MoveNext();
System::TObject* __fastcall GetCurrent();
System::UnicodeString __fastcall GetCurrentStr();
System::_di_IEnumerator __fastcall GetEnumerator();
System::DelphiInterface<System::IEnumerator__1<System::UnicodeString> > __fastcall GetEnumeratorStr();
public:
__fastcall TEnumerator(const System::UnicodeString Path, const System::UnicodeString Pattern, const TDirectory::_di_TDirectoryWalkProc Callback, const bool Recursive);
__fastcall virtual ~TEnumerator();
private:
void *__IEnumerable__1; // System::IEnumerable__1<System::UnicodeString>
void *__IEnumerator__1; // System::IEnumerator__1<System::UnicodeString>
void *__IEnumerator; // System::IEnumerator
public:
operator System::IEnumerable__1<System::UnicodeString>*(void) { return (System::IEnumerable__1<System::UnicodeString>*)&__IEnumerable__1; }
operator System::IEnumerator__1<System::UnicodeString>*(void) { return (System::IEnumerator__1<System::UnicodeString>*)&__IEnumerator__1; }
operator System::IEnumerator*(void) { return (System::IEnumerator*)&__IEnumerator; }
};
#ifndef _WIN64
#pragma pack(pop)
#endif /* not _WIN64 */
private:
static void __fastcall InternalCheckDirPathParam(const System::UnicodeString Path, const bool ExistsCheck);
static void __fastcall CheckCreateDirectoryParameters(const System::UnicodeString Path);
static void __fastcall CheckCopyParameters(System::UnicodeString SourceDirName, System::UnicodeString DestDirName);
static void __fastcall CheckDeleteParameters(const System::UnicodeString Path, const bool Recursive);
static void __fastcall CheckGetAttributesParameters(const System::UnicodeString Path);
static void __fastcall CheckGetDirectoriesParameters(const System::UnicodeString Path, const System::UnicodeString SearchPattern);
static void __fastcall CheckGetDirectoryRootParameters(const System::UnicodeString Path);
static void __fastcall CheckGetFilesParameters(System::UnicodeString Path, const System::UnicodeString SearchPattern);
static void __fastcall CheckGetFileSystemEntriesParameters(System::UnicodeString Path, const System::UnicodeString SearchPattern);
static void __fastcall CheckGetCreationTimeParameters(const System::UnicodeString Path);
static void __fastcall CheckGetCreationTimeUtcParameters(const System::UnicodeString Path);
static void __fastcall CheckGetLastAccessTimeParameters(const System::UnicodeString Path);
static void __fastcall CheckGetLastAccessTimeUtcParameters(const System::UnicodeString Path);
static void __fastcall CheckGetLastWriteTimeParameters(const System::UnicodeString Path);
static void __fastcall CheckGetLastWriteTimeUtcParameters(const System::UnicodeString Path);
static void __fastcall CheckGetParentParameters(const System::UnicodeString Path);
static void __fastcall CheckMoveParameters(System::UnicodeString SourceDirName, System::UnicodeString DestDirName);
static void __fastcall CheckSetAttributesParameters(const System::UnicodeString Path);
static void __fastcall CheckSetCurrentDirectoryParameters(const System::UnicodeString Path);
static void __fastcall CheckSetCreationTimeParameters(const System::UnicodeString Path);
static void __fastcall CheckSetCreationTimeUtcParameters(const System::UnicodeString Path);
static void __fastcall CheckSetLastAccessTimeParameters(const System::UnicodeString Path);
static void __fastcall CheckSetLastAccessTimeUtcParameters(const System::UnicodeString Path);
static void __fastcall CheckSetLastWriteTimeParameters(const System::UnicodeString Path);
static void __fastcall CheckSetLastWriteTimeUtcParameters(const System::UnicodeString Path);
static void __fastcall GetDateTimeInfo(const System::UnicodeString Path, /* out */ System::TDateTime &CreationTime, /* out */ System::TDateTime &LastAccessTime, /* out */ System::TDateTime &LastWriteTime, const bool UseLocalTimeZone);
static void __fastcall SetDateTimeInfo(const System::UnicodeString Path, const System::PDateTime CreationTime, const System::PDateTime LastAccessTime, const System::PDateTime LastWriteTime, const bool UseLocalTimeZone);
static Winapi::Windows::TFileTime __fastcall ConvertDateTimeToFileTime(const System::TDateTime DateTime, const bool UseLocalTimeZone);
static System::TDateTime __fastcall DoGetCreationTime(const System::UnicodeString Path);
static System::TDateTime __fastcall DoGetCreationTimeUtc(const System::UnicodeString Path);
static System::TDateTime __fastcall DoGetLastAccessTime(const System::UnicodeString Path);
static System::TDateTime __fastcall DoGetLastAccessTimeUtc(const System::UnicodeString Path);
static System::TDateTime __fastcall DoGetLastWriteTime(const System::UnicodeString Path);
static System::TDateTime __fastcall DoGetLastWriteTimeUtc(const System::UnicodeString Path);
static void __fastcall DoSetCreationTime(const System::UnicodeString Path, const System::TDateTime CreationTime);
static void __fastcall DoSetCreationTimeUtc(const System::UnicodeString Path, const System::TDateTime CreationTime);
static void __fastcall DoSetLastAccessTime(const System::UnicodeString Path, const System::TDateTime LastAccessTime);
static void __fastcall DoSetLastAccessTimeUtc(const System::UnicodeString Path, const System::TDateTime LastAccessTime);
static void __fastcall DoSetLastWriteTime(const System::UnicodeString Path, const System::TDateTime LastWriteTime);
static void __fastcall DoSetLastWriteTimeUtc(const System::UnicodeString Path, const System::TDateTime LastWriteTime);
static System::TStringDynArray __fastcall DoGetFiles(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate);
static System::TStringDynArray __fastcall DoGetDirectories(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate);
static System::TStringDynArray __fastcall DoGetFileSystemEntries(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static void __fastcall WalkThroughDirectory(const System::UnicodeString Path, const System::UnicodeString Pattern, const _di_TDirectoryWalkProc PreCallback, const _di_TDirectoryWalkProc PostCallback, const bool Recursive);
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall DoGetDirectoriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate);
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall DoGetFilesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate);
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall DoGetFileSystemEntriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate);
public:
static void __fastcall Copy(const System::UnicodeString SourceDirName, const System::UnicodeString DestDirName)/* overload */;
static void __fastcall Copy(const System::UnicodeString SourceDirName, const System::UnicodeString DestDirName, bool IgnoreErrors)/* overload */;
static void __fastcall CreateDirectory(const System::UnicodeString Path);
static void __fastcall Delete(const System::UnicodeString Path)/* overload */;
static void __fastcall Delete(const System::UnicodeString Path, const bool Recursive)/* overload */;
static bool __fastcall Exists(const System::UnicodeString Path, bool FollowLink = true);
static TFileAttributes __fastcall GetAttributes(const System::UnicodeString Path, bool FollowLink = true);
static System::UnicodeString __fastcall GetCurrentDirectory();
static void __fastcall SetCurrentDirectory(const System::UnicodeString Path);
static System::TStringDynArray __fastcall GetLogicalDrives();
static System::TDateTime __fastcall GetCreationTime(const System::UnicodeString Path);
static System::TDateTime __fastcall GetCreationTimeUtc(const System::UnicodeString Path);
static System::TDateTime __fastcall GetLastAccessTime(const System::UnicodeString Path);
static System::TDateTime __fastcall GetLastAccessTimeUtc(const System::UnicodeString Path);
static System::TDateTime __fastcall GetLastWriteTime(const System::UnicodeString Path);
static System::TDateTime __fastcall GetLastWriteTimeUtc(const System::UnicodeString Path);
static void __fastcall SetAttributes(const System::UnicodeString Path, const TFileAttributes Attributes);
static void __fastcall SetCreationTime(const System::UnicodeString Path, const System::TDateTime CreationTime);
static void __fastcall SetCreationTimeUtc(const System::UnicodeString Path, const System::TDateTime CreationTime);
static void __fastcall SetLastAccessTime(const System::UnicodeString Path, const System::TDateTime LastAccessTime);
static void __fastcall SetLastAccessTimeUtc(const System::UnicodeString Path, const System::TDateTime LastAccessTime);
static void __fastcall SetLastWriteTime(const System::UnicodeString Path, const System::TDateTime LastWriteTime);
static void __fastcall SetLastWriteTimeUtc(const System::UnicodeString Path, const System::TDateTime LastWriteTime);
static System::UnicodeString __fastcall GetParent(const System::UnicodeString Path);
static System::TStringDynArray __fastcall GetDirectories(const System::UnicodeString Path)/* overload */;
static System::TStringDynArray __fastcall GetDirectories(const System::UnicodeString Path, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetDirectories(const System::UnicodeString Path, const System::UnicodeString SearchPattern)/* overload */;
static System::TStringDynArray __fastcall GetDirectories(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetDirectories(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption)/* overload */;
static System::TStringDynArray __fastcall GetDirectories(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetDirectories(const System::UnicodeString Path, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetDirectoriesEnumerator(const System::UnicodeString Path)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetDirectoriesEnumerator(const System::UnicodeString Path, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetDirectoriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetDirectoriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetDirectoriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetDirectoriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetDirectoriesEnumerator(const System::UnicodeString Path, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::UnicodeString __fastcall GetDirectoryRoot(const System::UnicodeString Path);
static System::TStringDynArray __fastcall GetFiles(const System::UnicodeString Path)/* overload */;
static System::TStringDynArray __fastcall GetFiles(const System::UnicodeString Path, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetFiles(const System::UnicodeString Path, const System::UnicodeString SearchPattern)/* overload */;
static System::TStringDynArray __fastcall GetFiles(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetFiles(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption)/* overload */;
static System::TStringDynArray __fastcall GetFiles(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetFiles(const System::UnicodeString Path, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFilesEnumerator(const System::UnicodeString Path)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFilesEnumerator(const System::UnicodeString Path, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFilesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFilesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFilesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFilesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFilesEnumerator(const System::UnicodeString Path, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetFileSystemEntries(const System::UnicodeString Path)/* overload */;
static System::TStringDynArray __fastcall GetFileSystemEntries(const System::UnicodeString Path, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetFileSystemEntries(const System::UnicodeString Path, const System::UnicodeString SearchPattern)/* overload */;
static System::TStringDynArray __fastcall GetFileSystemEntries(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const _di_TFilterPredicate Predicate)/* overload */;
static System::TStringDynArray __fastcall GetFileSystemEntries(const System::UnicodeString Path, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFileSystemEntriesEnumerator(const System::UnicodeString Path)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFileSystemEntriesEnumerator(const System::UnicodeString Path, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFileSystemEntriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFileSystemEntriesEnumerator(const System::UnicodeString Path, const System::UnicodeString SearchPattern, const _di_TFilterPredicate Predicate)/* overload */;
static System::DelphiInterface<System::IEnumerable__1<System::UnicodeString> > __fastcall GetFileSystemEntriesEnumerator(const System::UnicodeString Path, const TSearchOption SearchOption, const _di_TFilterPredicate Predicate)/* overload */;
static bool __fastcall IsEmpty(const System::UnicodeString Path);
static bool __fastcall IsRelativePath(const System::UnicodeString Path);
static void __fastcall Move(const System::UnicodeString SourceDirName, const System::UnicodeString DestDirName);
};
Propriétés
Type | Visibilité | Source | Unité | Parent |
---|---|---|---|---|
record struct |
public | System.IOUtils.pas System.IOUtils.hpp |
System.IOUtils | System.IOUtils |
Description
Contient un grand nombre de méthodes utilitaires statiques, utilisées dans les manipulations des répertoires.
TDirectory est un enregistrement contenant seulement les méthodes statiques utilisées pour effectuer diverses opérations sur les répertoires. Vous ne devez pas déclarer les variables de type TDirectory, puisque TDirectory n'a pas de champs ou de méthodes d'instance. Voici les opérations qui peuvent être accomplies en utilisant TDirectory :
- Créer, renommer et supprimer des répertoires.
- Traverser des répertoires (aussi de façon récursive).
- Manipuler les horodatages et les attributs des répertoires.
Remarque :
Voir aussi
- System.IOUtils.TPath
- System.IOUtils.TFile
- Application exemple GridExplorer