Skip to content

Commit cb68028

Browse files
committed
New TCompilerList class
Added to Compilers.UCompilers unit
1 parent 86d1e8a commit cb68028

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Src/Compilers.UCompilers.pas

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interface
2020

2121

2222
uses
23+
// Delphi
24+
Generics.Collections,
2325
// Project
2426
Compilers.UGlobals, UBaseObjects;
2527

@@ -64,13 +66,18 @@ TCompilersFactory = class(TNoConstructObject)
6466
}
6567
end;
6668

69+
TCompilerList = class(TList<ICompiler>)
70+
public
71+
constructor Create;
72+
end;
73+
6774

6875
implementation
6976

7077

7178
uses
7279
// Delphi
73-
Generics.Collections, SysUtils,
80+
Generics.Defaults, SysUtils,
7481
// Project
7582
Compilers.UBDS, Compilers.UDelphi, Compilers.UFreePascal,
7683
Compilers.USearchDirs, IntfCommon, UConsts, UExceptions, UIStringList,
@@ -378,5 +385,19 @@ procedure TPersistCompilers.Save(const Compilers: ICompilers);
378385
end;
379386
end;
380387

388+
{ TCompilerList }
389+
390+
constructor TCompilerList.Create;
391+
begin
392+
inherited Create(
393+
TDelegatedComparer<ICompiler>.Create(
394+
function (const Left, Right: ICompiler): Integer
395+
begin
396+
Result := Ord(Left.GetID) - Ord(Right.GetID);
397+
end
398+
)
399+
)
400+
end;
401+
381402
end.
382403

0 commit comments

Comments
 (0)