UNIT ServerLogFiles;
INTERFACE
USES
Windows, Classes, Messages, SysUtils, StrUtils, Generics.Collections, Generics.Defaults, Variants,
LogFiles;
// Klasse TLogFiles
TYPE
TFileListe =
CLASS(Generics.Collections.TObjectList<TLogFiles>)
PRIVATE
Function Compare(Item1, Item2 : TLogFiles): Integer;
PUBLIC
Constructor Create(OwnsObjects : Boolean = true);
END;
TYPE
TServerLogFiles =
CLASS
PRIVATE { Private-Deklarationen }
FileList : TFileListe;
...
END;
IMPLEMENTATION
{ TFileListe }
Function TFileListe.Compare(Item1, Item2 : TLogFiles): Integer;
begin
Result := TComparer<
String>.
Default.Compare(Item1.FileName, Item2.FileName);
end;
Constructor TFileListe.Create(OwnsObjects: Boolean);
begin
inherited Create(TComparer<TLogFiles>.Construct(Compare), OwnsObjects);
// Fehler
end;
{ TSERVERLOGFILES }
...
end.