TStringList
[Properties (by Name)][Methods (by Name)][Events (by Name)]
Standard implementation of the TStrings class.
Declaration
Source position: classesh.inc line 817
Type
  TStringList = class (TStrings)
  private
    FList : PStringItemList;
    FCount : Integer;
    FCapacity : Integer;
    FOnChange : TNotifyEvent;
    FOnChanging : TNotifyEvent;
    FDuplicates : TDuplicates;
    FCaseSensitive : Boolean;
    FForceSort : Boolean;
    FOwnsObjects : Boolean;
    FSortStyle : TStringsSortStyle;
    procedure ExchangeItemsInt(Index1: Integer; Index2: Integer);
    function GetSorted : Boolean;
    procedure Grow;
    procedure InternalClear(FromIndex: Integer; ClearOnly: Boolean);
    procedure SetSorted(Value: Boolean);
    procedure SetCaseSensitive(b: Boolean);
    procedure SetSortStyle(AValue: TStringsSortStyle);
  protected
    procedure CheckIndex(AIndex: Integer);
    procedure ExchangeItems(Index1: Integer; Index2: Integer);  Virtual;
    procedure Changed;  Virtual;
    procedure Changing;  Virtual;
    function Get(Index: Integer) : string;  Override;
    function GetCapacity : Integer;  Override;
    function GetCount : Integer;  Override;
    function GetObject(Index: Integer) : TObject;  Override;
    procedure Put(Index: Integer; const S: string);  Override;
    procedure PutObject(Index: Integer; AObject: TObject);  Override;
    procedure SetCapacity(NewCapacity: Integer);  Override;
    procedure SetUpdateState(Updating: Boolean);  Override;
    procedure InsertItem(Index: Integer; const S: string);  Virtual;
    procedure InsertItem(Index: Integer; const S: string; O: TObject)
                        ;  Virtual;
    function DoCompareText(const s1: string; const s2: string) : PtrInt
                          ;  Override;
  public
    destructor Destroy;  Override;
    function Add(const S: string) : Integer;  Override;
    procedure Clear;  Override;
    procedure Delete(Index: Integer);  Override;
    procedure Exchange(Index1: Integer; Index2: Integer);  Override;
    function Find(const S: string; out Index: Integer) : Boolean;  Virtual;
    function IndexOf(const S: string) : Integer;  Override;
    procedure Insert(Index: Integer; const S: string);  Override;
    procedure Sort;  Virtual;
    procedure Sort(SortingAlgorithm: PSortingAlgorithm);  Virtual;
    procedure CustomSort(CompareFn: TStringListSortCompare);  Virtual;
    procedure CustomSort(CompareFn: TStringListSortCompare; 
                        SortingAlgorithm: PSortingAlgorithm);  Virtual;
    Duplicates : TDuplicates;
    Sorted : Boolean;
    CaseSensitive : Boolean;
    OnChange : TNotifyEvent;
    OnChanging : TNotifyEvent;
    OwnsObjects : Boolean;
    SortStyle : TStringsSortStyle;
  end
  ;
Description
TStringList is a descendant class of TStrings that implements all of the abstract methods introduced there. It also introduces some additional methods:
Sort the list, or keep the list sorted at all times Special handling of duplicates in sorted lists Notification of changes in the list
Members
| Member | Type | Visibility | Description | 
|---|---|---|---|
| Add | Method | public | Implements the TStrings.Add function. | 
| CaseSensitive | Property | public | Indicates whether comparing strings happens in a case sensitive manner. | 
| Changed | Method | protected | Called when the list of strings was modified. | 
| Changing | Method | protected | Called when the list is changing. | 
| CheckIndex | Method | protected | |
| Clear | Method | public | Implements the TStrings.Clear function. | 
| CustomSort | Method | public | Sort the stringlist using a custom sort algorithm | 
| Delete | Method | public | Implements the TStrings.Delete function. | 
| Destroy | Method | public | Destroys the stringlist. | 
| DoCompareText | Method | protected | |
| Duplicates | Property | public | Describes the behaviour of a sorted list with respect to duplicate strings. | 
| Exchange | Method | public | Implements the TStrings.Exchange function. | 
| ExchangeItems | Method | protected | |
| ExchangeItemsInt | Method | private | |
| FCapacity | Field | private | |
| FCaseSensitive | Field | private | |
| FCount | Field | private | |
| FDuplicates | Field | private | |
| FForceSort | Field | private | |
| Find | Method | public | Locates the index for a given string in sorted lists. | 
| FList | Field | private | |
| FOnChange | Field | private | |
| FOnChanging | Field | private | |
| FOwnsObjects | Field | private | |
| FSortStyle | Field | private | |
| Get | Method | protected | Overrides the standard read handler for the TStrings.Strings property. | 
| GetCapacity | Method | protected | Overrides the standard read handler for the TStrings.Capacity property. | 
| GetCount | Method | protected | Overrides the standard read handler for the TStrings.Count property. | 
| GetObject | Method | protected | Overrides the standard read handler for the TStrings.Objects property. | 
| GetSorted | Method | private | |
| Grow | Method | private | |
| IndexOf | Method | public | Overrides the TStrings.IndexOf property. | 
| Insert | Method | public | Overrides the TStrings.Insert method. | 
| InsertItem | Method | protected | |
| InternalClear | Method | private | |
| OnChange | Property | public | Event triggered after the list was modified. | 
| OnChanging | Property | public | Event triggered when the list is about to be modified. | 
| OwnsObjects | Property | public | Determines whether the stringlist owns it's objects or not. | 
| Put | Method | protected | Overrides the standard write handler for the TStrings.Strings property. | 
| PutObject | Method | protected | Overrides the standard write handler for the TStrings.Objects property. | 
| SetCapacity | Method | protected | Overrides the standard write handler for the TStrings.Capacity property. | 
| SetCaseSensitive | Method | private | |
| SetSorted | Method | private | |
| SetSortStyle | Method | private | |
| SetUpdateState | Method | protected | Overrides the standard TStrings.SetUpdateState]() call. | 
| Sort | Method | public | Sorts the strings in the list. | 
| Sorted | Property | public | Determines whether the list is sorted or not. | 
| SortStyle | Property | public | Sort style for strings | 
Inheritance
| Class | Description | 
|---|---|
| TStringList | Standard implementation of the TStrings class. | 
See also
| Name | Description | 
|---|---|
| Integer | A signed 16-bits integer | 
| Integer | A signed 16-bits integer | 
| TDuplicates | Type to describe what to do with duplicate values in a TStringlist . | 
| TDuplicates | Type to describe what to do with duplicate values in a TStringlist . | 
| TNotifyEvent | Standard event handler type. | 
| TNotifyEvent | Standard event handler type. | 
| TNotifyEvent | Standard event handler type. | 
| TNotifyEvent | Standard event handler type. | 
| TStringList.Duplicates | Describes the behaviour of a sorted list with respect to duplicate strings. | 
| TStringList.Sorted | Determines whether the list is sorted or not. | 
| TStrings | Class to manage arrays or collections of strings | 
| TStringsSortStyle | Determines how the strings are sorted | 
| TStringsSortStyle | Determines how the strings are sorted |