-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheclbr.directory.pas
200 lines (164 loc) · 7.72 KB
/
eclbr.directory.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
ECL Brasil - Essential Core Library for Delphi
Copyright (c) 2023, Isaque Pinheiro
All rights reserved.
GNU Lesser General Public License
Versão 3, 29 de junho de 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
A todos é permitido copiar e distribuir cópias deste documento de
licença, mas mudá-lo não é permitido.
Esta versão da GNU Lesser General Public License incorpora
os termos e condições da versão 3 da GNU General Public License
Licença, complementado pelas permissões adicionais listadas no
arquivo LICENSE na pasta principal.
}
{
@abstract(ECLBr Library)
@created(23 Abr 2023)
@author(Isaque Pinheiro <[email protected]>)
@Discord(https://discord.gg/T2zJC8zX)
}
unit eclbr.directory;
interface
uses
SysUtils,
IOUtils,
eclbr.vector;
type
TFilterPredicate = IOUtils.TDirectory.TFilterPredicate;
TSearchOption = IOUtils.TSearchOption;
TFileMode = IOUtils.TFileMode;
TFileAccess = IOUtils.TFileAccess;
TFileShare = IOUtils.TFileShare;
TPath = IOUtils.TPath;
TPathPrefixType = IOUtils.TPathPrefixType;
TDirEx = record
strict private
class var FDirectory: String;
public
class function New(const ADirectory: String): TDirEx; static; inline;
class function GetDirectories(const APath: String): TVector<String>; overload; inline; static;
class function GetDirectories(const APath: String; const APredicate: TFilterPredicate): TVector<String>; overload; inline; static;
class function GetDirectories(const APath, ASearchPattern: String): TVector<String>; overload; inline; static;
class function GetDirectories(const APath, ASearchPattern: String; const APredicate: TFilterPredicate): TVector<String>; overload; inline; static;
class function GetDirectories(const APath, ASearchPattern: String; const ASearchOption: TSearchOption): TVector<String>; overload; static;
class function GetDirectories(const APath, ASearchPattern: String; const ASearchOption: TSearchOption; const APredicate: TFilterPredicate): TVector<String>; overload; static;
class function GetDirectories(const APath: String; const ASearchOption: TSearchOption; const APredicate: TFilterPredicate): TVector<String>; overload; static;
class function GetFileSystemEntries(const APath: String): TVector<String>; overload; inline; static;
class function GetFileSystemEntries(const APath: String; const APredicate: TFilterPredicate): TVector<String>; overload; inline; static;
class function GetFileSystemEntries(const APath, ASearchPattern: String): TVector<String>; overload; static;
class function GetFileSystemEntries(const APath, ASearchPattern: String; const APredicate: TFilterPredicate): TVector<String>; overload; static;
class function GetFileSystemEntries(const APath: String; const ASearchOption: TSearchOption; const APredicate: TFilterPredicate): TVector<String>; overload; static;
class function GetFiles(const APath: String): TVector<String>; overload; inline; static;
class function GetFiles(const APath: String; const APredicate: TFilterPredicate): TVector<String>; overload; inline; static;
class function GetFiles(const APath, ASearchPattern: String): TVector<String>; overload; inline; static;
class function GetFiles(const APath, ASearchPattern: String; const APredicate: TFilterPredicate): TVector<String>; overload; inline; static;
class function GetFiles(const APath, ASearchPattern: String; const ASearchOption: TSearchOption): TVector<String>; overload; static;
class function GetFiles(const APath, ASearchPattern: String; const ASearchOption: TSearchOption; const APredicate: TFilterPredicate): TVector<String>; overload; static;
class function GetFiles(const APath: String; const ASearchOption: TSearchOption; const APredicate: TFilterPredicate): TVector<String>; overload; static;
end;
implementation
{ TDirectoryEx }
class function TDirEx.GetDirectories(const APath,
ASearchPattern: String): TVector<String>;
begin
Result := TDirectory.GetDirectories(APath, ASearchPattern);
end;
class function TDirEx.GetDirectories(const APath: String;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetDirectories(APath, APredicate);
end;
class function TDirEx.GetDirectories(const APath: String): TVector<String>;
begin
Result := TDirectory.GetDirectories(APath);
end;
class function TDirEx.GetDirectories(const APath, ASearchPattern: String;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetDirectories(APath, ASearchPattern, APredicate);
end;
class function TDirEx.GetDirectories(const APath: String;
const ASearchOption: TSearchOption;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetDirectories(APath, ASearchOption, APredicate);
end;
class function TDirEx.GetFileSystemEntries(
const APath: String): TVector<String>;
begin
Result := TDirectory.GetFileSystemEntries(APath);
end;
class function TDirEx.GetFileSystemEntries(const APath: String;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetFileSystemEntries(APath, APredicate);
end;
class function TDirEx.GetFileSystemEntries(const APath,
ASearchPattern: String): TVector<String>;
begin
Result := TDirectory.GetFileSystemEntries(APath, ASearchPattern);
end;
class function TDirEx.GetFileSystemEntries(const APath,
ASearchPattern: String; const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetFileSystemEntries(APath, ASearchPattern, APredicate);
end;
class function TDirEx.GetFiles(const APath,
ASearchPattern: String): TVector<String>;
begin
Result := TDirectory.GetFiles(APath, ASearchPattern);
end;
class function TDirEx.GetFiles(const APath: String;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetFiles(APath, APredicate);
end;
class function TDirEx.GetFiles(const APath: String): TVector<String>;
begin
Result := TDirectory.GetFiles(APath);
end;
class function TDirEx.GetFiles(const APath, ASearchPattern: String;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetFiles(APath, ASearchPattern, APredicate);
end;
class function TDirEx.GetFiles(const APath: String;
const ASearchOption: TSearchOption;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetFiles(APath, ASearchOption, APredicate);
end;
class function TDirEx.GetFiles(const APath, ASearchPattern: String;
const ASearchOption: TSearchOption;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetFiles(APath, ASearchPattern, ASearchOption, APredicate);
end;
class function TDirEx.GetFiles(const APath, ASearchPattern: String;
const ASearchOption: TSearchOption): TVector<String>;
begin
Result := TDirectory.GetFiles(APath, ASearchPattern, ASearchOption);
end;
class function TDirEx.GetFileSystemEntries(const APath: String;
const ASearchOption: TSearchOption;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetFileSystemEntries(APath, ASearchOption, APredicate);
end;
class function TDirEx.GetDirectories(const APath, ASearchPattern: String;
const ASearchOption: TSearchOption;
const APredicate: TFilterPredicate): TVector<String>;
begin
Result := TDirectory.GetDirectories(APath, ASearchPattern, ASearchOption, APredicate);
end;
class function TDirEx.GetDirectories(const APath, ASearchPattern: String;
const ASearchOption: TSearchOption): TVector<String>;
begin
Result := TDirectory.GetDirectories(APath, ASearchPattern, ASearchOption);
end;
class function TDirEx.New(const ADirectory: String): TDirEx;
begin
FDirectory := ADirectory;
end;
end.