TStringListEx

From Ultibo.org
Jump to: navigation, search

Return to Unit UltiboClasses


Description


To be documented

Class definitions



TStringListEx = class(TStrings)

Note: A String List class that does not use realloc to grow

Mostly identical methods to TStringList with addition of block list

 
Note: Currently does not implement Sorting or Duplicate handling
 
constructor Create;  
public (Public destructor for FPC RTL)
destructor Destroy; override;  
private
FRecent:TStringBlock;  
FBlocks:TLinkedObjList;  
 
FCount:Integer;  
FCapacity:Integer;  
FSorted:Boolean;  
FUpdating:Boolean;  
FDuplicates:TDuplicates;  
FOnChange:TNotifyEvent;  
FOnChanging:TNotifyEvent;  
procedure QuickSort(L,R:Integer);  
procedure SetSorted(Value:Boolean);  
 
function GetBlock(Index:Integer):TStringBlock;  
function AddBlock(Block:TStringBlock; Index:Integer):TStringBlock;  
function DeleteBlock(Block:TStringBlock):Boolean;  
function UpdateBlocks(Block:TStringBlock):Boolean;  
 
function GetItem(Block:TStringBlock; Index:Integer):TStringItemEx;  
function AddItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;  
function DeleteItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;  
protected
procedure ClearList; 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 SetUpdateState(Updating:Boolean); override;  
public
function Add(const S:String):Integer; override;  
procedure Clear; override;  
procedure Delete(Index:Integer); override;  
procedure Exchange(Index1,Index2:Integer); override;  
function Find(const S:String; var Index:Integer):Boolean; virtual;  
function IndexOf(const S:String):Integer; override;  
procedure Insert(Index:Integer; const S:String); override;  
procedure Sort; virtual;  
property Duplicates:TDuplicates read FDuplicates write FDuplicates;  
property Sorted:Boolean read FSorted write SetSorted;  
property OnChange:TNotifyEvent read FOnChange write FOnChange;  
property OnChanging:TNotifyEvent read FOnChanging write FOnChanging;  


Function declarations



constructor TStringListEx.Create;
Description: To be documented
Note None documented


destructor TStringListEx.Destroy;
Description: To be documented
Note None documented


function TStringListEx.GetBlock(Index:Integer):TStringBlock;
Description: To be documented
Note None documented


function TStringListEx.AddBlock(Block:TStringBlock; Index:Integer):TStringBlock;
Description: To be documented
Index Starting Index of Block to be Added
Block Current Block containing Index or nil


function TStringListEx.DeleteBlock(Block:TStringBlock):Boolean;
Description: To be documented
Note None documented


function TStringListEx.UpdateBlocks(Block:TStringBlock):Boolean;
Description: To be documented
Note None documented


function TStringListEx.GetItem(Block:TStringBlock; Index:Integer):TStringItemEx;
Description: To be documented
Note None documented


function TStringListEx.AddItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;
Description: To be documented
Note None documented


function TStringListEx.DeleteItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;
Description: To be documented
Note None documented


procedure TStringListEx.ClearList;
Description: To be documented
Note None documented


procedure TStringListEx.Changed;
Description: To be documented
Note None documented


procedure TStringListEx.Changing;
Description: To be documented
Note None documented


function TStringListEx.Get(Index:Integer):String;
Description: To be documented
Note None documented


function TStringListEx.GetCapacity:Integer;
Description: To be documented
Note None documented


function TStringListEx.GetCount:Integer;
Description: To be documented
Note None documented


function TStringListEx.GetObject(Index:Integer):TObject;
Description: To be documented
Note None documented


procedure TStringListEx.Put(Index:Integer; const S:String);
Description: To be documented
Note None documented


procedure TStringListEx.PutObject(Index:Integer; AObject:TObject);
Description: To be documented
Note None documented


procedure TStringListEx.SetUpdateState(Updating:Boolean);
Description: To be documented
Note None documented


function TStringListEx.Add(const S:String):Integer;
Description: To be documented
Note None documented


procedure TStringListEx.Clear;
Description: To be documented
Note None documented


procedure TStringListEx.Delete(Index:Integer);
Description: To be documented
Note None documented


procedure TStringListEx.Exchange(Index1,Index2:Integer);
Description: To be documented
Note None documented


function TStringListEx.IndexOf(const S:String):Integer;
Description: Uses Counted Index within the Block of the matched String Object
Note None documented


procedure TStringListEx.Insert(Index:Integer; const S:String);
Description: To be documented
Note None documented


Return to Unit Reference