Ignore:
Timestamp:
Oct 29, 2010, 1:26:32 PM (14 years ago)
Author:
george
Message:
  • Added: Generic range type.
  • Added: Specialized TListByte type which si simply memory block.
  • Added: New functionality to TGList.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Generic/ListInterface.tpl

    r74 r77  
     1
     2  PGListItem = ^TListItem;
     3  TGList = class;
    14
    25  TGListSortCompare = function(const Item1, Item2: TListItem): Integer of object;
    36  TGListStringConverter = function(Item: TListItem): string;
     7  TGListOperation = procedure(List: TGList; Item: PGListItem);
    48  //TGListNotification = (lnAdded, lnExtracted, lnDeleted);
    59
     
    1620    procedure SetCount(const AValue: TListIndex);
    1721    procedure QuickSort(L, R : TListIndex; Compare: TGListSortCompare);
    18     property Capacity: TListIndex read GetCapacity write SetCapacity;
    1922  public
    2023    // All items
     
    2427    procedure Sort(Compare: TGListSortCompare);
    2528    function Implode(Separator: string; Converter: TGListStringConverter): string;
     29    procedure Perform(Operation: TGListOperation);
    2630    // Many items
    2731    procedure MoveItems(CurIndex, NewIndex, Count: TListIndex);
    2832    procedure DeleteItems(Index, Count: TListIndex);
     33    procedure Fill(Start, Count: TListIndex; Value: TListItem);
    2934    // One item
    3035    function Add(Item: TListItem): TListIndex;
     
    3338    procedure Exchange(Index1, Index2: TListIndex);
    3439    function First: TListItem;
    35     function IndexOf(Item: TListItem): TListIndex;
     40    function IndexOf(Item: TListItem; Start: TListIndex = 0): TListIndex;
    3641    procedure Insert(Index: TListIndex; Item: TListItem);
    3742    function Last: TListItem;
     
    4247    procedure AddList(List: TGList);
    4348    procedure Assign(List: TGList);
    44     //function Equals(Obj: TObject): Boolean; override;
     49    function Equals(List: TGList): Boolean;
    4550    procedure InsertList(Index: TListIndex; List: TGList);
     51    function IndexOfList(List: TGList; Start: TListIndex = 0): TListIndex;
    4652    // Other
    4753    property Count: TListIndex read GetCount write SetCount;
    48     // Additional
     54    property Capacity: TListIndex read GetCapacity write SetCapacity;
     55    // Array
    4956    procedure AddArray(Values: array of TListItem);
     57    procedure SetArray(Values: array of TListItem);
     58    procedure InsertArray(Index: TListIndex; Values: array of TListItem);
    5059  end;
Note: See TracChangeset for help on using the changeset viewer.