You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(20) |
May
(48) |
Jun
(8) |
Jul
(23) |
Aug
(41) |
Sep
(42) |
Oct
(22) |
Nov
(17) |
Dec
(36) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(43) |
Feb
(42) |
Mar
(17) |
Apr
(39) |
May
(16) |
Jun
(35) |
Jul
(37) |
Aug
(47) |
Sep
(49) |
Oct
(9) |
Nov
(52) |
Dec
(37) |
| 2008 |
Jan
(48) |
Feb
(21) |
Mar
(7) |
Apr
(2) |
May
(5) |
Jun
(17) |
Jul
(17) |
Aug
(40) |
Sep
(58) |
Oct
(38) |
Nov
(19) |
Dec
(32) |
| 2009 |
Jan
(67) |
Feb
(46) |
Mar
(54) |
Apr
(34) |
May
(37) |
Jun
(52) |
Jul
(67) |
Aug
(72) |
Sep
(48) |
Oct
(35) |
Nov
(27) |
Dec
(12) |
| 2010 |
Jan
(56) |
Feb
(46) |
Mar
(19) |
Apr
(14) |
May
(21) |
Jun
(3) |
Jul
(13) |
Aug
(48) |
Sep
(34) |
Oct
(51) |
Nov
(16) |
Dec
(32) |
| 2011 |
Jan
(36) |
Feb
(14) |
Mar
(12) |
Apr
(3) |
May
(5) |
Jun
(24) |
Jul
(15) |
Aug
(30) |
Sep
(21) |
Oct
(4) |
Nov
(25) |
Dec
(23) |
| 2012 |
Jan
(45) |
Feb
(42) |
Mar
(19) |
Apr
(14) |
May
(13) |
Jun
(7) |
Jul
(3) |
Aug
(46) |
Sep
(21) |
Oct
(10) |
Nov
(2) |
Dec
|
| 2013 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ou...@us...> - 2007-11-27 20:57:02
|
Revision: 2237
http://jcl.svn.sourceforge.net/jcl/?rev=2237&view=rev
Author: outchy
Date: 2007-11-27 12:57:00 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
introduction of general purpose trees.
Modified Paths:
--------------
trunk/jcl/packages/c5/JclC50.bpk
trunk/jcl/packages/c5/JclC50.cpp
trunk/jcl/packages/c5/JclC50.dpk
trunk/jcl/packages/c6/Jcl.bpk
trunk/jcl/packages/c6/Jcl.dpk
trunk/jcl/packages/cs1/Jcl.dpk
trunk/jcl/packages/d10/Jcl.dpk
trunk/jcl/packages/d10.net/Jedi.Jcl.bdsproj
trunk/jcl/packages/d10.net/Jedi.Jcl.dpr
trunk/jcl/packages/d11/Jcl.dpk
trunk/jcl/packages/d11/Jcl.res
trunk/jcl/packages/d11.net/Jedi.Jcl.dpk
trunk/jcl/packages/d11.net/Jedi.Jcl.dproj
trunk/jcl/packages/d5/JclD50.dpk
trunk/jcl/packages/d6/Jcl.dpk
trunk/jcl/packages/d7/Jcl.dpk
trunk/jcl/packages/d8/Jcl.dpk
trunk/jcl/packages/d9/Jcl.dpk
trunk/jcl/packages/d9.net/Jedi.Jcl.bdsproj
trunk/jcl/packages/d9.net/Jedi.Jcl.dpr
trunk/jcl/packages/k3/Jcl.bpk
trunk/jcl/packages/k3/Jcl.dpk
trunk/jcl/packages/xml/Jcl-L.xml
trunk/jcl/packages/xml/Jcl-R.xml
trunk/jcl/source/prototypes/Makefile.mak
Added Paths:
-----------
trunk/jcl/examples/common/containers/trees/TreeStructure.dof
trunk/jcl/examples/common/containers/trees/TreeStructure.dpr
trunk/jcl/examples/common/containers/trees/TreeStructure.res
trunk/jcl/examples/common/containers/trees/TreeStructureMain.dfm
trunk/jcl/examples/common/containers/trees/TreeStructureMain.pas
trunk/jcl/source/common/JclTrees.pas
trunk/jcl/source/prototypes/JclTrees.pas
trunk/jcl/source/prototypes/containers/JclTrees.imp
Added: trunk/jcl/examples/common/containers/trees/TreeStructure.dof
===================================================================
--- trunk/jcl/examples/common/containers/trees/TreeStructure.dof (rev 0)
+++ trunk/jcl/examples/common/containers/trees/TreeStructure.dof 2007-11-27 20:57:00 UTC (rev 2237)
@@ -0,0 +1,2 @@
+[Directories]
+OutputDir=..\..\..\..\bin
Property changes on: trunk/jcl/examples/common/containers/trees/TreeStructure.dof
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/jcl/examples/common/containers/trees/TreeStructure.dpr
===================================================================
--- trunk/jcl/examples/common/containers/trees/TreeStructure.dpr (rev 0)
+++ trunk/jcl/examples/common/containers/trees/TreeStructure.dpr 2007-11-27 20:57:00 UTC (rev 2237)
@@ -0,0 +1,14 @@
+program TreeStructure;
+
+uses
+ Forms,
+ TreeStructureMain in 'TreeStructureMain.pas' {Form1};
+
+{$R *.res}
+{$R ..\..\..\..\source\windows\JclCommCtrlAsInvoker.res}
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
Property changes on: trunk/jcl/examples/common/containers/trees/TreeStructure.dpr
___________________________________________________________________
Name: svn:keywords
+ URL HeadURL Author LastChangedBy Date LastChangedDate Rev Revision LastChangedRevision Id
Name: svn:eol-style
+ native
Added: trunk/jcl/examples/common/containers/trees/TreeStructure.res
===================================================================
(Binary files differ)
Property changes on: trunk/jcl/examples/common/containers/trees/TreeStructure.res
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jcl/examples/common/containers/trees/TreeStructureMain.dfm
===================================================================
--- trunk/jcl/examples/common/containers/trees/TreeStructureMain.dfm (rev 0)
+++ trunk/jcl/examples/common/containers/trees/TreeStructureMain.dfm 2007-11-27 20:57:00 UTC (rev 2237)
@@ -0,0 +1,247 @@
+object Form1: TForm1
+ Left = 0
+ Top = 0
+ Caption = 'Form1'
+ ClientHeight = 423
+ ClientWidth = 426
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ OldCreateOrder = False
+ OnCreate = FormCreate
+ PixelsPerInch = 96
+ TextHeight = 13
+ object GroupBoxOptions: TGroupBox
+ Left = 8
+ Top = 8
+ Width = 410
+ Height = 129
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Options:'
+ TabOrder = 0
+ object CheckBoxBinaryTree: TCheckBox
+ Left = 16
+ Top = 24
+ Width = 161
+ Height = 17
+ Action = ActionBinaryTree
+ TabOrder = 0
+ end
+ object CheckBoxGeneralPurposeTree: TCheckBox
+ Left = 16
+ Top = 48
+ Width = 161
+ Height = 17
+ Action = ActionGeneralPurposeTree
+ State = cbChecked
+ TabOrder = 1
+ end
+ object CheckBoxCaseSensitive: TCheckBox
+ Left = 16
+ Top = 96
+ Width = 97
+ Height = 17
+ Action = ActionCaseSensitive
+ TabOrder = 2
+ end
+ object CheckBoxAllowDefault: TCheckBox
+ Left = 199
+ Top = 24
+ Width = 178
+ Height = 17
+ Action = ActionAllowDefault
+ TabOrder = 3
+ end
+ object CheckBoxAllowDuplicates: TCheckBox
+ Left = 200
+ Top = 48
+ Width = 177
+ Height = 17
+ Action = ActionAllowDuplicates
+ TabOrder = 4
+ end
+ object CheckBoxIgnoreDuplicates: TCheckBox
+ Left = 216
+ Top = 72
+ Width = 161
+ Height = 17
+ Action = ActionIgnoreDuplicates
+ TabOrder = 5
+ end
+ object CheckBoxRemoveSingle: TCheckBox
+ Left = 200
+ Top = 96
+ Width = 177
+ Height = 17
+ Action = ActionRemoveSingle
+ TabOrder = 6
+ end
+ end
+ object TreeViewResults: TTreeView
+ Left = 8
+ Top = 143
+ Width = 193
+ Height = 272
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ Indent = 19
+ TabOrder = 1
+ end
+ object GroupBoxActions: TGroupBox
+ Left = 207
+ Top = 143
+ Width = 211
+ Height = 272
+ Anchors = [akTop, akRight, akBottom]
+ Caption = 'Actions:'
+ TabOrder = 2
+ object ButtonGenerateRandom: TButton
+ Left = 16
+ Top = 24
+ Width = 177
+ Height = 25
+ Action = ActionGenerateRandom
+ TabOrder = 0
+ end
+ object ButtonRemoveSelected: TButton
+ Left = 16
+ Top = 56
+ Width = 177
+ Height = 25
+ Action = ActionRemoveSelected
+ TabOrder = 1
+ end
+ object EditNewItem: TEdit
+ Left = 16
+ Top = 168
+ Width = 177
+ Height = 21
+ TabOrder = 2
+ Text = 'New item'
+ end
+ object ButtonAddNew: TButton
+ Left = 16
+ Top = 200
+ Width = 177
+ Height = 25
+ Action = ActionAddNew
+ TabOrder = 3
+ end
+ object ButtonAddNewChild: TButton
+ Left = 16
+ Top = 231
+ Width = 177
+ Height = 25
+ Action = ActionAddNewChild
+ TabOrder = 4
+ end
+ object Button1: TButton
+ Left = 16
+ Top = 87
+ Width = 177
+ Height = 25
+ Action = ActionPack
+ TabOrder = 5
+ end
+ object Button2: TButton
+ Left = 16
+ Top = 120
+ Width = 177
+ Height = 25
+ Action = ActionTestTree
+ TabOrder = 6
+ end
+ end
+ object ActionListMain: TActionList
+ Left = 160
+ Top = 112
+ object ActionAllowDuplicates: TAction
+ Category = 'Tree options'
+ AutoCheck = True
+ Caption = 'Allow duplicates'
+ OnExecute = ActionDuplicatesExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionIgnoreDuplicates: TAction
+ Category = 'Tree options'
+ AutoCheck = True
+ Caption = 'Ignore duplicates'
+ OnExecute = ActionDuplicatesExecute
+ OnUpdate = ActionIgnoreDuplicatesUpdate
+ end
+ object ActionAllowDefault: TAction
+ Category = 'Tree options'
+ AutoCheck = True
+ Caption = 'Allow defaults (empty strings)'
+ OnExecute = ActionAllowDefaultExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionRemoveSingle: TAction
+ Category = 'Tree options'
+ AutoCheck = True
+ Caption = 'Remove single element'
+ OnExecute = ActionRemoveSingleExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionCaseSensitive: TAction
+ Category = 'Tree options'
+ AutoCheck = True
+ Caption = 'Case sensitive'
+ OnExecute = ActionCaseSensitiveExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionGenerateRandom: TAction
+ Category = 'Tree actions'
+ Caption = 'Generate random tree'
+ OnExecute = ActionGenerateRandomExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionAddNew: TAction
+ Category = 'Tree actions'
+ Caption = 'Add new'
+ OnExecute = ActionAddNewExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionRemoveSelected: TAction
+ Category = 'Tree actions'
+ Caption = 'Remove selected'
+ OnExecute = ActionRemoveSelectedExecute
+ OnUpdate = ActionRemoveSelectedUpdate
+ end
+ object ActionAddNewChild: TAction
+ Category = 'Tree actions'
+ Caption = 'Add new child'
+ OnExecute = ActionAddNewChildExecute
+ OnUpdate = ActionAddNewChildUpdate
+ end
+ object ActionBinaryTree: TAction
+ Category = 'Tree options'
+ AutoCheck = True
+ Caption = 'Binary tree'
+ OnExecute = ActionBinaryTreeExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionGeneralPurposeTree: TAction
+ Category = 'Tree options'
+ AutoCheck = True
+ Caption = 'General purpose tree'
+ Checked = True
+ OnExecute = ActionGeneralPurposeTreeExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionPack: TAction
+ Category = 'Tree actions'
+ Caption = 'Pack'
+ OnExecute = ActionPackExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ object ActionTestTree: TAction
+ Category = 'Tree actions'
+ Caption = 'Test tree'
+ OnExecute = ActionTestTreeExecute
+ OnUpdate = ActionAlwaysEnabled
+ end
+ end
+end
Property changes on: trunk/jcl/examples/common/containers/trees/TreeStructureMain.dfm
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/jcl/examples/common/containers/trees/TreeStructureMain.pas
===================================================================
--- trunk/jcl/examples/common/containers/trees/TreeStructureMain.pas (rev 0)
+++ trunk/jcl/examples/common/containers/trees/TreeStructureMain.pas 2007-11-27 20:57:00 UTC (rev 2237)
@@ -0,0 +1,344 @@
+unit TreeStructureMain;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
+ Dialogs, StdCtrls, ActnList, ComCtrls,
+ JclContainerIntf;
+
+type
+ TForm1 = class(TForm)
+ GroupBoxOptions: TGroupBox;
+ ActionListMain: TActionList;
+ ActionAllowDuplicates: TAction;
+ ActionIgnoreDuplicates: TAction;
+ ActionAllowDefault: TAction;
+ ActionRemoveSingle: TAction;
+ ActionCaseSensitive: TAction;
+ ActionGenerateRandom: TAction;
+ ActionAddNew: TAction;
+ ActionRemoveSelected: TAction;
+ TreeViewResults: TTreeView;
+ GroupBoxActions: TGroupBox;
+ ButtonGenerateRandom: TButton;
+ ButtonRemoveSelected: TButton;
+ EditNewItem: TEdit;
+ ButtonAddNew: TButton;
+ ActionAddNewChild: TAction;
+ ButtonAddNewChild: TButton;
+ CheckBoxBinaryTree: TCheckBox;
+ ActionBinaryTree: TAction;
+ ActionGeneralPurposeTree: TAction;
+ CheckBoxGeneralPurposeTree: TCheckBox;
+ CheckBoxCaseSensitive: TCheckBox;
+ CheckBoxAllowDefault: TCheckBox;
+ CheckBoxAllowDuplicates: TCheckBox;
+ CheckBoxIgnoreDuplicates: TCheckBox;
+ CheckBoxRemoveSingle: TCheckBox;
+ ActionPack: TAction;
+ Button1: TButton;
+ ActionTestTree: TAction;
+ Button2: TButton;
+ procedure FormCreate(Sender: TObject);
+ procedure ActionGeneralPurposeTreeExecute(Sender: TObject);
+ procedure ActionAlwaysEnabled(Sender: TObject);
+ procedure ActionBinaryTreeExecute(Sender: TObject);
+ procedure ActionCaseSensitiveExecute(Sender: TObject);
+ procedure ActionRemoveSingleExecute(Sender: TObject);
+ procedure ActionAllowDefaultExecute(Sender: TObject);
+ procedure ActionDuplicatesExecute(Sender: TObject);
+ procedure ActionIgnoreDuplicatesUpdate(Sender: TObject);
+ procedure ActionGenerateRandomExecute(Sender: TObject);
+ procedure ActionPackExecute(Sender: TObject);
+ procedure ActionAddNewExecute(Sender: TObject);
+ procedure ActionAddNewChildUpdate(Sender: TObject);
+ procedure ActionAddNewChildExecute(Sender: TObject);
+ procedure ActionRemoveSelectedExecute(Sender: TObject);
+ procedure ActionRemoveSelectedUpdate(Sender: TObject);
+ procedure ActionTestTreeExecute(Sender: TObject);
+ private
+ FTree: IJclAnsiStrTree;
+ function GetSelectedIterator: IJclAnsiStrTreeIterator;
+ procedure PrintTree;
+ public
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+uses
+ JclBinaryTrees,
+ JclTrees;
+
+{$R *.dfm}
+
+procedure TForm1.ActionBinaryTreeExecute(Sender: TObject);
+begin
+ if ActionBinaryTree.Checked then
+ begin
+ ActionGeneralPurposeTree.Checked := False;
+
+ FTree := TJclAnsiStrBinaryTree.Create(nil);
+
+ ActionCaseSensitiveExecute(ActionCaseSensitive);
+ ActionRemoveSingleExecute(ActionRemoveSingle);
+ ActionAllowDefaultExecute(ActionAllowDefault);
+ ActionDuplicatesExecute(nil);
+ PrintTree;
+ end;
+end;
+
+procedure TForm1.ActionCaseSensitiveExecute(Sender: TObject);
+begin
+ FTree.CaseSensitive := (Sender as TAction).Checked;
+end;
+
+procedure TForm1.ActionGeneralPurposeTreeExecute(Sender: TObject);
+begin
+ if ActionGeneralPurposeTree.Checked then
+ begin
+ ActionBinaryTree.Checked := False;
+
+ FTree := TJclAnsiStrTree.Create;
+
+ ActionCaseSensitiveExecute(ActionCaseSensitive);
+ ActionRemoveSingleExecute(ActionRemoveSingle);
+ ActionAllowDefaultExecute(ActionAllowDefault);
+ ActionDuplicatesExecute(nil);
+ PrintTree;
+ end;
+end;
+
+procedure TForm1.ActionGenerateRandomExecute(Sender: TObject);
+ var
+ CurrentItem: Integer;
+ function GenerateItem: AnsiString;
+ begin
+ if FTree.Duplicates = dupAccept then
+ Result := Format('Item %.3d', [Random(10)])
+ else
+ begin
+ Result := Format('Item %.3d', [CurrentItem]);
+ Inc(CurrentItem);
+ end;
+ end;
+
+ procedure GenerateRandomChild(const AIterator: IJclAnsiStrIterator; Count: Integer);
+ begin
+ while Count > 0 do
+ begin
+ (AIterator as IJclAnsiStrTreeIterator).AddChild(GenerateItem);
+ Dec(Count);
+ end;
+ end;
+
+ procedure GenerateRandom(Count: Integer);
+ begin
+ while Count > 0 do
+ begin
+ FTree.Add(GenerateItem);
+ Dec(Count);
+ end;
+ end;
+var
+ Index1, Index2: Integer;
+ Iterator0, Iterator1, Iterator2: IJclAnsiStrTreeIterator;
+begin
+ CurrentItem := 0;
+ FTree.Clear;
+
+ if ActionGeneralPurposeTree.Checked then
+ begin
+ // general purpose tree
+ GenerateRandom(5);
+ Iterator0 := FTree.Root;
+ for Index1 := 0 to Iterator0.ChildrenCount - 1 do
+ begin
+ Iterator1 := (Iterator0 as IJclIntfCloneable).Clone as IJclAnsiStrTreeIterator;
+ Iterator1.GetChild(Index1);
+ GenerateRandomChild(Iterator1, 5);
+ for Index2 := 0 to Iterator1.ChildrenCount - 1 do
+ begin
+ Iterator2 := (Iterator1 as IJclIntfCloneable).Clone as IJclAnsiStrTreeIterator;
+ Iterator2.GetChild(Index2);
+ GenerateRandomChild(Iterator2, 5);
+ end;
+ end;
+ end
+ else
+ begin
+ // binary tree
+ GenerateRandom(100);
+ end;
+ PrintTree;
+end;
+
+procedure TForm1.ActionIgnoreDuplicatesUpdate(Sender: TObject);
+begin
+ (Sender as TAction).Enabled := not CheckBoxAllowDuplicates.Checked;
+end;
+
+procedure TForm1.ActionPackExecute(Sender: TObject);
+begin
+ (FTree as IJclPackable).Pack;
+ PrintTree;
+end;
+
+procedure TForm1.ActionRemoveSelectedExecute(Sender: TObject);
+begin
+ GetSelectedIterator.Remove;
+ PrintTree;
+end;
+
+procedure TForm1.ActionRemoveSelectedUpdate(Sender: TObject);
+begin
+ (Sender as TAction).Enabled := TreeViewResults.Selected <> nil;
+end;
+
+procedure TForm1.ActionRemoveSingleExecute(Sender: TObject);
+begin
+ FTree.RemoveSingleElement := (Sender as TAction).Checked;
+end;
+
+procedure TForm1.ActionTestTreeExecute(Sender: TObject);
+ procedure CheckNode(const AIterator: IJclAnsiStrTreeIterator);
+ var
+ Index: Integer;
+ ChildIterator, ParentIterator: IJclAnsiStrTreeIterator;
+ begin
+ for Index := 0 to AIterator.ChildrenCount - 1 do
+ begin
+ ChildIterator := (AIterator as IJclIntfCloneable).Clone as IJclAnsiStrTreeIterator;
+ ChildIterator.GetChild(Index);
+
+ try
+ ParentIterator := (ChildIterator as IJclIntfCloneable).Clone as IJclAnsiStrTreeIterator;
+ ParentIterator.Parent;
+
+ if not AIterator.Equals(ParentIterator) then
+ ShowMessage('difference at parent of node ' + ChildIterator.GetString);
+ except
+ ShowMessage('error at parent of node ' + ChildIterator.GetString);
+ end;
+
+ CheckNode(ChildIterator);
+ end;
+ end;
+var
+ ARootIterator: IJclAnsiStrTreeIterator;
+begin
+ ARootIterator := FTree.Root;
+ ARootIterator.Next; // unlock
+ CheckNode(ARootIterator);
+ ShowMessage('end of test');
+end;
+
+procedure TForm1.ActionAddNewChildExecute(Sender: TObject);
+begin
+ if GetSelectedIterator.AddChild(EditNewItem.Text) then
+ ShowMessage('Success')
+ else
+ ShowMessage('Duplicate');
+ PrintTree;
+end;
+
+procedure TForm1.ActionAddNewChildUpdate(Sender: TObject);
+begin
+ (Sender as TAction).Enabled := ActionGeneralPurposeTree.Checked and (TreeViewResults.Selected <> nil);
+end;
+
+procedure TForm1.ActionAddNewExecute(Sender: TObject);
+begin
+ if FTree.Add(EditNewItem.Text) then
+ ShowMessage('Success')
+ else
+ ShowMessage('Duplicate');
+ PrintTree;
+end;
+
+procedure TForm1.ActionAllowDefaultExecute(Sender: TObject);
+begin
+ FTree.AllowDefaultElements := (Sender as TAction).Checked;
+end;
+
+procedure TForm1.ActionDuplicatesExecute(Sender: TObject);
+begin
+ if ActionAllowDuplicates.Checked then
+ FTree.Duplicates := dupAccept
+ else
+ if ActionIgnoreDuplicates.Checked then
+ FTree.Duplicates := dupIgnore
+ else
+ FTree.Duplicates := dupError;
+end;
+
+procedure TForm1.ActionAlwaysEnabled(Sender: TObject);
+begin
+ (Sender as TAction).Enabled := True;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+ Randomize;
+ ActionGeneralPurposeTreeExecute(ActionGeneralPurposeTree);
+end;
+
+function TForm1.GetSelectedIterator: IJclAnsiStrTreeIterator;
+var
+ Indexes: array of Integer;
+ I: Integer;
+ ANode: TTreeNode;
+begin
+ Result := nil;
+ ANode := TreeViewResults.Selected;
+ if ANode <> nil then
+ begin
+ while ANode.Parent <> nil do
+ begin
+ SetLength(Indexes, Length(Indexes) + 1);
+ Indexes[High(Indexes)] := ANode.Index;
+ ANode := ANode.Parent;
+ end;
+ Result := FTree.Root;
+ for I := High(Indexes) downto Low(Indexes) do
+ Result.GetChild(Indexes[I]);
+ Result.Next;
+ end;
+end;
+
+procedure TForm1.PrintTree;
+ procedure ProcessNode(const AIterator: IJclAnsiStrTreeIterator; ANode: TTreeNode);
+ var
+ Index: Integer;
+ ChildIterator: IJclAnsiStrTreeIterator;
+ ChildNode: TTreeNode;
+ begin
+ ANode.Text := AIterator.GetString;
+ for Index := 0 to AIterator.ChildrenCount - 1 do
+ begin
+ ChildIterator := (AIterator as IJclIntfCloneable).Clone as IJclAnsiStrTreeIterator;
+ ChildIterator.GetChild(Index);
+ ChildNode := TreeViewResults.Items.AddChild(ANode, '');
+ ProcessNode(ChildIterator, ChildNode);
+ end;
+ end;
+var
+ ARootIterator: IJclAnsiStrTreeIterator;
+ ARootNode: TTreeNode;
+begin
+ TreeViewResults.Items.Clear;
+ if FTree.Size > 0 then
+ begin
+ ARootIterator := FTree.Root;
+ ARootIterator.Next; // unlock
+ ARootNode := TreeViewResults.Items.Add(nil, '');
+ ProcessNode(ARootIterator, ARootNode);
+ ARootNode.Expand(True);
+ ARootNode.MakeVisible;
+ end;
+end;
+
+end.
Property changes on: trunk/jcl/examples/common/containers/trees/TreeStructureMain.pas
___________________________________________________________________
Name: svn:keywords
+ URL HeadURL Author LastChangedBy Date LastChangedDate Rev Revision LastChangedRevision Id
Name: svn:eol-style
+ native
Modified: trunk/jcl/packages/c5/JclC50.bpk
===================================================================
--- trunk/jcl/packages/c5/JclC50.bpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/c5/JclC50.bpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -5,7 +5,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:36 UTC
+ Last generated: 22-11-2007 17:05:17 UTC
*****************************************************************************
-->
<PROJECT>
@@ -61,6 +61,7 @@
..\..\lib\c5\JclStrings.obj
..\..\lib\c5\JclSysInfo.obj
..\..\lib\c5\JclSysUtils.obj
+ ..\..\lib\c5\JclTrees.obj
..\..\lib\c5\JclUnitConv.obj
..\..\lib\c5\JclUnitVersioning.obj
..\..\lib\c5\JclUnitVersioningProviders.obj
Modified: trunk/jcl/packages/c5/JclC50.cpp
===================================================================
--- trunk/jcl/packages/c5/JclC50.cpp 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/c5/JclC50.cpp 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:36 UTC
+ Last generated: 22-11-2007 17:05:17 UTC
-----------------------------------------------------------------------------
*/
@@ -58,6 +58,7 @@
USEUNIT("..\..\source\common\JclStrings.pas");
USEUNIT("..\..\source\common\JclSysInfo.pas");
USEUNIT("..\..\source\common\JclSysUtils.pas");
+USEUNIT("..\..\source\common\JclTrees.pas");
USEUNIT("..\..\source\common\JclUnitConv.pas");
USEUNIT("..\..\source\common\JclUnitVersioning.pas");
USEUNIT("..\..\source\common\JclUnitVersioningProviders.pas");
Modified: trunk/jcl/packages/c5/JclC50.dpk
===================================================================
--- trunk/jcl/packages/c5/JclC50.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/c5/JclC50.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:36 UTC
+ Last generated: 22-11-2007 17:05:17 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/c6/Jcl.bpk
===================================================================
--- trunk/jcl/packages/c6/Jcl.bpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/c6/Jcl.bpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -5,7 +5,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:36 UTC
+ Last generated: 22-11-2007 17:05:17 UTC
*****************************************************************************
-->
<PROJECT>
@@ -61,6 +61,7 @@
..\..\lib\c6\JclStrings.obj
..\..\lib\c6\JclSysInfo.obj
..\..\lib\c6\JclSysUtils.obj
+ ..\..\lib\c6\JclTrees.obj
..\..\lib\c6\JclUnitConv.obj
..\..\lib\c6\JclUnitVersioning.obj
..\..\lib\c6\JclUnitVersioningProviders.obj
@@ -199,6 +200,7 @@
<FILE FILENAME="..\..\source\common\JclStrings.pas" FORMNAME="" UNITNAME="JclStrings" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\source\common\JclSysInfo.pas" FORMNAME="" UNITNAME="JclSysInfo" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\source\common\JclSysUtils.pas" FORMNAME="" UNITNAME="JclSysUtils" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\source\common\JclTrees.pas" FORMNAME="" UNITNAME="JclTrees" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\source\common\JclUnitConv.pas" FORMNAME="" UNITNAME="JclUnitConv" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\source\common\JclUnitVersioning.pas" FORMNAME="" UNITNAME="JclUnitVersioning" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\source\common\JclUnitVersioningProviders.pas" FORMNAME="" UNITNAME="JclUnitVersioningProviders" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
Modified: trunk/jcl/packages/c6/Jcl.dpk
===================================================================
--- trunk/jcl/packages/c6/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/c6/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:37 UTC
+ Last generated: 22-11-2007 17:05:18 UTC
-----------------------------------------------------------------------------
}
@@ -86,6 +86,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/cs1/Jcl.dpk
===================================================================
--- trunk/jcl/packages/cs1/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/cs1/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:39 UTC
+ Last generated: 22-11-2007 17:05:19 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d10/Jcl.dpk
===================================================================
--- trunk/jcl/packages/d10/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d10/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:40 UTC
+ Last generated: 22-11-2007 17:05:20 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d10.net/Jedi.Jcl.bdsproj
===================================================================
--- trunk/jcl/packages/d10.net/Jedi.Jcl.bdsproj 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d10.net/Jedi.Jcl.bdsproj 2007-11-27 20:57:00 UTC (rev 2237)
@@ -207,6 +207,7 @@
<File FileName="..\..\source\common\JclStrings.pas" ContainerId="" ModuleName="JclStrings"/>
<File FileName="..\..\source\common\JclSysInfo.pas" ContainerId="" ModuleName="JclSysInfo"/>
<File FileName="..\..\source\common\JclSysUtils.pas" ContainerId="" ModuleName="JclSysUtils"/>
+ <File FileName="..\..\source\common\JclTrees.pas" ContainerId="" ModuleName="JclTrees"/>
<File FileName="..\..\source\common\JclUnitConv.pas" ContainerId="" ModuleName="JclUnitConv"/>
<File FileName="..\..\source\common\JclValidation.pas" ContainerId="" ModuleName="JclValidation"/>
<File FileName="..\..\source\common\JclVectors.pas" ContainerId="" ModuleName="JclVectors"/>
Modified: trunk/jcl/packages/d10.net/Jedi.Jcl.dpr
===================================================================
--- trunk/jcl/packages/d10.net/Jedi.Jcl.dpr 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d10.net/Jedi.Jcl.dpr 2007-11-27 20:57:00 UTC (rev 2237)
@@ -32,6 +32,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclValidation in '..\..\source\common\JclValidation.pas' ,
JclVectors in '..\..\source\common\JclVectors.pas'
Modified: trunk/jcl/packages/d11/Jcl.dpk
===================================================================
--- trunk/jcl/packages/d11/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d11/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:41 UTC
+ Last generated: 27-11-2007 19:51:56 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d11/Jcl.res
===================================================================
(Binary files differ)
Modified: trunk/jcl/packages/d11.net/Jedi.Jcl.dpk
===================================================================
--- trunk/jcl/packages/d11.net/Jedi.Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d11.net/Jedi.Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -28,8 +28,7 @@
requires
Borland.Delphi,
Borland.Vcl,
- System.Drawing,
- Borland.VclRtl;
+ System.Drawing;
contains
JclAbstractContainers in '..\..\source\common\JclAbstractContainers.pas',
@@ -73,7 +72,8 @@
JclUnitConv in '..\..\source\common\JclUnitConv.pas',
JclValidation in '..\..\source\common\JclValidation.pas',
JclVectors in '..\..\source\common\JclVectors.pas',
- JclSynch in '..\..\source\windows\JclSynch.pas';
+ JclSynch in '..\..\source\windows\JclSynch.pas',
+ JclTrees in '..\..\source\common\JclTrees.pas';
[assembly: AssemblyDescription('')]
[assembly: AssemblyConfiguration('')]
Modified: trunk/jcl/packages/d11.net/Jedi.Jcl.dproj
===================================================================
--- trunk/jcl/packages/d11.net/Jedi.Jcl.dproj 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d11.net/Jedi.Jcl.dproj 2007-11-27 20:57:00 UTC (rev 2237)
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <ProjectGuid>{42539ecc-f491-48a0-929a-5b8ff3a9fb1f}</ProjectGuid>
- <MainSource>Jedi.Jcl.dpk</MainSource>
+ <ProjectGuid>{44DB645B-C167-410D-9334-38AF9F0C7913}</ProjectGuid>
+ <MainSource>Jedi.Jcl.dpr</MainSource>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<DCC_DCCCompiler>DCCIL</DCC_DCCCompiler>
- <DCC_DependencyCheckOutputName>C:\Dokumente und Einstellungen\All Users\Dokumente\RAD Studio\5.0\Bpl\Jedi.Jcl.dll</DCC_DependencyCheckOutputName>
- <DCC_UsePackage>Borland.VclRtl;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll;Borland.Vcl;Borland.Delphi</DCC_UsePackage>
+ <DCC_DependencyCheckOutputName>Jedi.Jcl.dll</DCC_DependencyCheckOutputName>
<DCC_EnabledPackages>true</DCC_EnabledPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -16,109 +15,111 @@
<DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE</DCC_Define>
+ <DCC_DcuOutput>..\..\lib\d11.net</DCC_DcuOutput>
+ <DCC_ObjOutput>..\..\lib\d11.net</DCC_ObjOutput>
+ <DCC_HppOutput>..\..\lib\d11.net</DCC_HppOutput>
+ <DCC_DcpOutput>..\..\lib\d11.net</DCC_DcpOutput>
+ <DCC_UnitSearchPath>..\..\lib\d11.net;..\..\source</DCC_UnitSearchPath>
+ <DCC_ResourcePath>..\..\lib\d11.net;..\..\source</DCC_ResourcePath>
+ <DCC_ObjPath>..\..\lib\d11.net;..\..\source</DCC_ObjPath>
+ <DCC_IncludePath>..\..\lib\d11.net;..\..\source</DCC_IncludePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Version>7.0</Version>
<DCC_DebugInfoInExe>True</DCC_DebugInfoInExe>
<DCC_DebugVN>True</DCC_DebugVN>
<DCC_Define>DEBUG</DCC_Define>
- <DCC_Platform>x86</DCC_Platform>
- <DCC_NameSpace>Borland.Vcl</DCC_NameSpace>
- <DCC_UnitSearchPath>..\..\source;C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;$(BDSCOMMONDIR)\Bpl;C:\WINDOWS\assembly\GAC_MSIL\Borland.VclRtl\11.0.5000.9245__91d62ebb5b0d1b1b</DCC_UnitSearchPath>
- <DCC_ResourcePath>..\..\source;C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;$(BDSCOMMONDIR)\Bpl;C:\WINDOWS\assembly\GAC_MSIL\Borland.VclRtl\11.0.5000.9245__91d62ebb5b0d1b1b</DCC_ResourcePath>
- <DCC_IncludePath>..\..\source;C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;$(BDSCOMMONDIR)\Bpl;C:\WINDOWS\assembly\GAC_MSIL\Borland.VclRtl\11.0.5000.9245__91d62ebb5b0d1b1b</DCC_IncludePath>
<DCC_DcuOutput>..\..\lib\d11.net</DCC_DcuOutput>
<DCC_ObjOutput>..\..\lib\d11.net</DCC_ObjOutput>
<DCC_HppOutput>..\..\lib\d11.net</DCC_HppOutput>
<DCC_DcpOutput>..\..\lib\d11.net</DCC_DcpOutput>
- <DCC_SYMBOL_DEPRECATED>False</DCC_SYMBOL_DEPRECATED>
- <DCC_SYMBOL_PLATFORM>False</DCC_SYMBOL_PLATFORM>
- <DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM>
- <DCC_UNIT_DEPRECATED>False</DCC_UNIT_DEPRECATED>
- <DCC_WIDECHAR_REDUCED>False</DCC_WIDECHAR_REDUCED>
+ <DCC_UnitSearchPath>..\..\lib\d11.net;..\..\source</DCC_UnitSearchPath>
+ <DCC_ResourcePath>..\..\lib\d11.net;..\..\source</DCC_ResourcePath>
+ <DCC_ObjPath>..\..\lib\d11.net;..\..\source</DCC_ObjPath>
+ <DCC_IncludePath>..\..\lib\d11.net;..\..\source</DCC_IncludePath>
</PropertyGroup>
<ProjectExtensions>
<Borland.Personality>DelphiDotNet.Personality</Borland.Personality>
- <Borland.ProjectType>Package</Borland.ProjectType>
+ <Borland.ProjectType>Library</Borland.ProjectType>
<BorlandProject>
-<BorlandProject><DelphiDotNet.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">False</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">True</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1031</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Jedi.Jcl.dpk</Source></Source></DelphiDotNet.Personality></BorlandProject></BorlandProject>
+ <BorlandProject xmlns="">
+ <DelphiDotNet.Personality>
+ <Parameters>
+ <Parameters Name="UseLauncher">False</Parameters>
+ <Parameters Name="LoadAllSymbols">True</Parameters>
+ <Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
+ </Parameters>
+ <VersionInfo>
+ <VersionInfo Name="IncludeVerInfo">True</VersionInfo>
+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+ <VersionInfo Name="MajorVer">1</VersionInfo>
+ <VersionInfo Name="MinorVer">102</VersionInfo>
+ <VersionInfo Name="Release">0</VersionInfo>
+ <VersionInfo Name="Build">2726</VersionInfo>
+ <VersionInfo Name="Debug">False</VersionInfo>
+ <VersionInfo Name="PreRelease">False</VersionInfo>
+ <VersionInfo Name="Special">False</VersionInfo>
+ <VersionInfo Name="Private">False</VersionInfo>
+ <VersionInfo Name="DLL">True</VersionInfo>
+ <VersionInfo Name="Locale">1031</VersionInfo>
+ <VersionInfo Name="CodePage">1252</VersionInfo>
+ </VersionInfo>
+ <VersionInfoKeys>
+ <VersionInfoKeys Name="CompanyName">Project JEDI</VersionInfoKeys>
+ <VersionInfoKeys Name="FileDescription">JEDI Code Library RTL package</VersionInfoKeys>
+ <VersionInfoKeys Name="FileVersion">1.102.0.2726</VersionInfoKeys>
+ <VersionInfoKeys Name="InternalName">Jedi.Jcl</VersionInfoKeys>
+ <VersionInfoKeys Name="LegalCopyright">Copyright (C) 1999, 2007 Project JEDI</VersionInfoKeys>
+ <VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
+ <VersionInfoKeys Name="OriginalFilename">Jedi.Jcl.dll</VersionInfoKeys>
+ <VersionInfoKeys Name="ProductName">JEDI Code Library</VersionInfoKeys>
+ <VersionInfoKeys Name="ProductVersion">1.102 Build 2726</VersionInfoKeys>
+ <VersionInfoKeys Name="Comments"></VersionInfoKeys>
+ </VersionInfoKeys>
+ <Source>
+ <Source Name="MainSource">Jedi.Jcl.dpr</Source>
+ </Source>
+ </DelphiDotNet.Personality>
+ </BorlandProject>
+ </BorlandProject>
</ProjectExtensions>
- <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
+ <ItemGroup />
<ItemGroup>
- <Reference Include="$(SystemRoot)\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll">
- <AssemblyName>System.Drawing</AssemblyName>
- <Version>2.0.0.0</Version>
- <HintPath>$(SystemRoot)\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll</HintPath>
- <AssemblyTag>$(SystemRoot)\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll</AssemblyTag>
- <LinkUnits>False</LinkUnits>
- </Reference>
- <Reference Include="C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Delphi.dll">
- <AssemblyName>Borland.Delphi</AssemblyName>
- <Version>11.0.5000.9245</Version>
- <HintPath>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Delphi.dll</HintPath>
- <AssemblyTag>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Delphi.dll</AssemblyTag>
- <LinkUnits>False</LinkUnits>
- </Reference>
- <Reference Include="C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Vcl.dll">
- <AssemblyName>Borland.Vcl</AssemblyName>
- <Version>11.0.5000.9245</Version>
- <HintPath>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Vcl.dll</HintPath>
- <AssemblyTag>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Vcl.dll</AssemblyTag>
- <LinkUnits>False</LinkUnits>
- </Reference>
- <Reference Include="C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.VclRtl.dll">
- <AssemblyName>Borland.VclRtl</AssemblyName>
- <Version>11.0.5000.9245</Version>
- <HintPath>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.VclRtl.dll</HintPath>
- <AssemblyTag>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.VclRtl.dll</AssemblyTag>
- <LinkUnits>False</LinkUnits>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <DelphiCompile Include="Jedi.Jcl.dpk">
+ <DelphiCompile Include="Jedi.Jcl.dpr">
<MainSource>MainSource</MainSource>
</DelphiCompile>
- <DCCReference Include="..\..\source\common\JclAbstractContainers.pas" />
- <DCCReference Include="..\..\source\common\JclAlgorithms.pas" />
- <DCCReference Include="..\..\source\common\JclAnsiStrings.pas" />
- <DCCReference Include="..\..\source\common\JclArrayLists.pas" />
- <DCCReference Include="..\..\source\common\JclArraySets.pas" />
- <DCCReference Include="..\..\source\common\JclBase.pas" />
- <DCCReference Include="..\..\source\common\JclBinaryTrees.pas" />
- <DCCReference Include="..\..\source\common\JclComplex.pas" />
- <DCCReference Include="..\..\source\common\JclContainerIntf.pas" />
- <DCCReference Include="..\..\source\common\JclCounter.pas" />
- <DCCReference Include="..\..\source\common\JclDateTime.pas" />
- <DCCReference Include="..\..\source\common\JclEDI.pas" />
- <DCCReference Include="..\..\source\common\JclEDISEF.pas" />
- <DCCReference Include="..\..\source\common\JclEDITranslators.pas" />
- <DCCReference Include="..\..\source\common\JclEDIXML.pas" />
- <DCCReference Include="..\..\source\common\JclEDI_ANSIX12.pas" />
- <DCCReference Include="..\..\source\common\JclEDI_ANSIX12_Ext.pas" />
- <DCCReference Include="..\..\source\common\JclEDI_UNEDIFACT.pas" />
- <DCCReference Include="..\..\source\common\JclEDI_UNEDIFACT_Ext.pas" />
- <DCCReference Include="..\..\source\common\JclFileUtils.pas" />
- <DCCReference Include="..\..\source\common\JclHashMaps.pas" />
- <DCCReference Include="..\..\source\common\JclHashSets.pas" />
- <DCCReference Include="..\..\source\common\JclIniFiles.pas" />
- <DCCReference Include="..\..\source\common\JclLinkedLists.pas" />
- <DCCReference Include="..\..\source\common\JclLogic.pas" />
- <DCCReference Include="..\..\source\common\JclMath.pas" />
- <DCCReference Include="..\..\source\common\JclMime.pas" />
- <DCCReference Include="..\..\source\common\JclQueues.pas" />
- <DCCReference Include="..\..\source\common\JclResources.pas" />
- <DCCReference Include="..\..\source\common\JclRTTI.pas" />
- <DCCReference Include="..\..\source\common\JclSimpleXml.pas" />
- <DCCReference Include="..\..\source\common\JclStacks.pas" />
- <DCCReference Include="..\..\source\common\JclStatistics.pas" />
- <DCCReference Include="..\..\source\common\JclStreams.pas" />
- <DCCReference Include="..\..\source\common\JclStringLists.pas" />
- <DCCReference Include="..\..\source\common\JclStrings.pas" />
- <DCCReference Include="..\..\source\common\JclSysInfo.pas" />
- <DCCReference Include="..\..\source\common\JclSysUtils.pas" />
- <DCCReference Include="..\..\source\common\JclUnitConv.pas" />
- <DCCReference Include="..\..\source\common\JclValidation.pas" />
- <DCCReference Include="..\..\source\common\JclVectors.pas" />
- <DCCReference Include="..\..\source\windows\JclSynch.pas" />
+ <DCCReference Include="..\..\source\common\JclAbstractContainers.pas"/>
+ <DCCReference Include="..\..\source\common\JclAlgorithms.pas"/>
+ <DCCReference Include="..\..\source\common\JclAnsiStrings.pas"/>
+ <DCCReference Include="..\..\source\common\JclArrayLists.pas"/>
+ <DCCReference Include="..\..\source\common\JclArraySets.pas"/>
+ <DCCReference Include="..\..\source\common\JclBase.pas"/>
+ <DCCReference Include="..\..\source\common\JclBinaryTrees.pas"/>
+ <DCCReference Include="..\..\source\common\JclComplex.pas"/>
+ <DCCReference Include="..\..\source\common\JclContainerIntf.pas"/>
+ <DCCReference Include="..\..\source\common\JclDateTime.pas"/>
+ <DCCReference Include="..\..\source\common\JclFileUtils.pas"/>
+ <DCCReference Include="..\..\source\common\JclHashMaps.pas"/>
+ <DCCReference Include="..\..\source\common\JclHashSets.pas"/>
+ <DCCReference Include="..\..\source\common\JclIniFiles.pas"/>
+ <DCCReference Include="..\..\source\common\JclLinkedLists.pas"/>
+ <DCCReference Include="..\..\source\common\JclLogic.pas"/>
+ <DCCReference Include="..\..\source\common\JclMath.pas"/>
+ <DCCReference Include="..\..\source\common\JclMime.pas"/>
+ <DCCReference Include="..\..\source\common\JclQueues.pas"/>
+ <DCCReference Include="..\..\source\common\JclResources.pas"/>
+ <DCCReference Include="..\..\source\common\JclRTTI.pas"/>
+ <DCCReference Include="..\..\source\common\JclSortedMaps.pas"/>
+ <DCCReference Include="..\..\source\common\JclStacks.pas"/>
+ <DCCReference Include="..\..\source\common\JclStatistics.pas"/>
+ <DCCReference Include="..\..\source\common\JclStreams.pas"/>
+ <DCCReference Include="..\..\source\common\JclStrings.pas"/>
+ <DCCReference Include="..\..\source\common\JclSysInfo.pas"/>
+ <DCCReference Include="..\..\source\common\JclSysUtils.pas"/>
+ <DCCReference Include="..\..\source\common\JclTrees.pas"/>
+ <DCCReference Include="..\..\source\common\JclUnitConv.pas"/>
+ <DCCReference Include="..\..\source\common\JclValidation.pas"/>
+ <DCCReference Include="..\..\source\common\JclVectors.pas"/>
</ItemGroup>
-</Project>
\ No newline at end of file
+ <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
+</Project>
Modified: trunk/jcl/packages/d5/JclD50.dpk
===================================================================
--- trunk/jcl/packages/d5/JclD50.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d5/JclD50.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:37 UTC
+ Last generated: 22-11-2007 17:05:18 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d6/Jcl.dpk
===================================================================
--- trunk/jcl/packages/d6/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d6/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:38 UTC
+ Last generated: 22-11-2007 17:05:19 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d7/Jcl.dpk
===================================================================
--- trunk/jcl/packages/d7/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d7/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:38 UTC
+ Last generated: 22-11-2007 17:05:19 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d8/Jcl.dpk
===================================================================
--- trunk/jcl/packages/d8/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d8/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:39 UTC
+ Last generated: 22-11-2007 17:05:19 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d9/Jcl.dpk
===================================================================
--- trunk/jcl/packages/d9/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d9/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:40 UTC
+ Last generated: 22-11-2007 17:05:19 UTC
-----------------------------------------------------------------------------
}
@@ -87,6 +87,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclUnitVersioning in '..\..\source\common\JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '..\..\source\common\JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/d9.net/Jedi.Jcl.bdsproj
===================================================================
--- trunk/jcl/packages/d9.net/Jedi.Jcl.bdsproj 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d9.net/Jedi.Jcl.bdsproj 2007-11-27 20:57:00 UTC (rev 2237)
@@ -207,6 +207,7 @@
<File FileName="..\..\source\common\JclStrings.pas" ContainerId="" ModuleName="JclStrings"/>
<File FileName="..\..\source\common\JclSysInfo.pas" ContainerId="" ModuleName="JclSysInfo"/>
<File FileName="..\..\source\common\JclSysUtils.pas" ContainerId="" ModuleName="JclSysUtils"/>
+ <File FileName="..\..\source\common\JclTrees.pas" ContainerId="" ModuleName="JclTrees"/>
<File FileName="..\..\source\common\JclUnitConv.pas" ContainerId="" ModuleName="JclUnitConv"/>
<File FileName="..\..\source\common\JclValidation.pas" ContainerId="" ModuleName="JclValidation"/>
<File FileName="..\..\source\common\JclVectors.pas" ContainerId="" ModuleName="JclVectors"/>
Modified: trunk/jcl/packages/d9.net/Jedi.Jcl.dpr
===================================================================
--- trunk/jcl/packages/d9.net/Jedi.Jcl.dpr 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/d9.net/Jedi.Jcl.dpr 2007-11-27 20:57:00 UTC (rev 2237)
@@ -32,6 +32,7 @@
JclStrings in '..\..\source\common\JclStrings.pas' ,
JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
+ JclTrees in '..\..\source\common\JclTrees.pas' ,
JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
JclValidation in '..\..\source\common\JclValidation.pas' ,
JclVectors in '..\..\source\common\JclVectors.pas'
Modified: trunk/jcl/packages/k3/Jcl.bpk
===================================================================
--- trunk/jcl/packages/k3/Jcl.bpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/k3/Jcl.bpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -52,6 +52,7 @@
..\..\lib\k3\JclStrings.obj
..\..\lib\k3\JclSysInfo.obj
..\..\lib\k3\JclSysUtils.obj
+ ..\..\lib\k3\JclTrees.obj
..\..\lib\k3\JclUnitConv.obj
..\..\lib\k3\JclUnitVersioning.obj
..\..\lib\k3\JclUnitVersioningProviders.obj
@@ -153,6 +154,7 @@
<FILE FILENAME="../../source/common/JclStrings.pas" FORMNAME="" UNITNAME="JclStrings" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="../../source/common/JclSysInfo.pas" FORMNAME="" UNITNAME="JclSysInfo" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="../../source/common/JclSysUtils.pas" FORMNAME="" UNITNAME="JclSysUtils" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="../../source/common/JclTrees.pas" FORMNAME="" UNITNAME="JclTrees" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="../../source/common/JclUnitConv.pas" FORMNAME="" UNITNAME="JclUnitConv" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="../../source/common/JclUnitVersioning.pas" FORMNAME="" UNITNAME="JclUnitVersioning" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="../../source/common/JclUnitVersioningProviders.pas" FORMNAME="" UNITNAME="JclUnitVersioningProviders" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
Modified: trunk/jcl/packages/k3/Jcl.dpk
===================================================================
--- trunk/jcl/packages/k3/Jcl.dpk 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/k3/Jcl.dpk 2007-11-27 20:57:00 UTC (rev 2237)
@@ -4,7 +4,7 @@
DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
ALWAYS EDIT THE RELATED XML FILE (Jcl-R.xml)
- Last generated: 10-11-2007 23:18:41 UTC
+ Last generated: 22-11-2007 17:05:20 UTC
-----------------------------------------------------------------------------
}
@@ -88,6 +88,7 @@
JclStrings in '../../source/common/JclStrings.pas' ,
JclSysInfo in '../../source/common/JclSysInfo.pas' ,
JclSysUtils in '../../source/common/JclSysUtils.pas' ,
+ JclTrees in '../../source/common/JclTrees.pas' ,
JclUnitConv in '../../source/common/JclUnitConv.pas' ,
JclUnitVersioning in '../../source/common/JclUnitVersioning.pas' ,
JclUnitVersioningProviders in '../../source/common/JclUnitVersioningProviders.pas' ,
Modified: trunk/jcl/packages/xml/Jcl-L.xml
===================================================================
--- trunk/jcl/packages/xml/Jcl-L.xml 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/xml/Jcl-L.xml 2007-11-27 20:57:00 UTC (rev 2237)
@@ -44,6 +44,7 @@
<File Name="..\..\source\common\JclStrings.pas" Targets="JclDotNet" Formname="" Condition=""/>
<File Name="..\..\source\common\JclSysInfo.pas" Targets="JclDotNet" Formname="" Condition=""/>
<File Name="..\..\source\common\JclSysUtils.pas" Targets="JclDotNet" Formname="" Condition=""/>
+ <File Name="..\..\source\common\JclTrees.pas" Targets="JclDotNet" Formname="" Condition=""/>
<File Name="..\..\source\common\JclUnitConv.pas" Targets="JclDotNet" Formname="" Condition=""/>
<File Name="..\..\source\common\JclValidation.pas" Targets="JclDotNet" Formname="" Condition=""/>
<File Name="..\..\source\common\JclVectors.pas" Targets="JclDotNet" Formname="" Condition=""/>
Modified: trunk/jcl/packages/xml/Jcl-R.xml
===================================================================
--- trunk/jcl/packages/xml/Jcl-R.xml 2007-11-27 20:19:25 UTC (rev 2236)
+++ trunk/jcl/packages/xml/Jcl-R.xml 2007-11-27 20:57:00 UTC (rev 2237)
@@ -64,6 +64,7 @@
<File Name="..\..\source\common\JclStrings.pas" Targets="JclDev" Formname="" Condition=""/>
<File Name="..\..\source\common\JclSysInfo.pas" Targets="JclDev" Formname="" Condition=""/>
<File Name="..\..\source\common\JclSysUtils.pas" Targets="JclDev" Formname="" Condition=""/>
+ <File Name="..\..\source\common\JclTrees.pas" Targets="JclDev" Formname="" Condition=""/>
<File Name="..\..\source\common\JclUnitConv.pas" Targets="JclDev" Formname="" Condition=""/>
<File Name="..\..\source\common\JclUnitVersioning.pas" Targets="JclDev" Formname="" Condition=""/>
<File Name="..\..\source\common\JclUnitVersioningProviders.pas" Targets="JclDev" Formname="" Condition=""/>
Added: trunk/jcl/source/common/JclTrees.pas
===================================================================
--- trunk/jcl/source/common/JclTrees.pas (rev 0)
+++ trunk/jcl/source/common/JclTrees.pas 2007-11-27 20:57:00 UTC (rev 2237)
@@ -0,0 +1,15373 @@
+{**************************************************************************************************}
+{ WARNING: JEDI preprocessor generated unit. Do not edit. }
+{**************************************************************************************************}
+
+{**************************************************************************************************}
+{ }
+{ Project JEDI Code Library (JCL) ...
[truncated message content] |
|
From: <ou...@us...> - 2007-11-27 20:19:27
|
Revision: 2236
http://jcl.svn.sourceforge.net/jcl/?rev=2236&view=rev
Author: outchy
Date: 2007-11-27 12:19:25 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
fix for tree corruption on deletion of item with left and right child assigned.
Modified Paths:
--------------
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
Modified: trunk/jcl/source/common/JclBinaryTrees.pas
===================================================================
--- trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-27 18:37:09 UTC (rev 2235)
+++ trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-27 20:19:25 UTC (rev 2236)
@@ -9635,18 +9635,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -10328,18 +10329,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -11021,18 +11023,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -11714,18 +11717,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -12407,18 +12411,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -13100,18 +13105,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -13793,18 +13799,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -14486,18 +14493,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -15179,18 +15187,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -15873,18 +15882,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -16567,18 +16577,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
@@ -17256,18 +17267,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
Modified: trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-27 18:37:09 UTC (rev 2235)
+++ trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-27 20:19:25 UTC (rev 2236)
@@ -1318,18 +1318,19 @@
if Successor <> Current.Right then
begin
// remove references to successor
- if Successor.Parent.Left = Successor then
- Successor.Parent.Left := Successor.Right
- else
- Successor.Parent.Right := Successor.Right;
+ Successor.Parent.Left := Successor.Right;
if Successor.Right <> nil then
Successor.Right.Parent := Successor.Parent;
Successor.Right := Current.Right;
+ if Successor.Right <> nil then
+ Successor.Right.Parent := Successor;
end;
// insert successor in new position
+ Successor.Left := Current.Left;
+ if Current.Left <> nil then
+ Current.Left.Parent := Successor;
Successor.Parent := Current.Parent;
- Successor.Left := Current.Left;
if Current.Parent <> nil then
begin
if Current.Parent.Left = Current then
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-27 18:37:14
|
Revision: 2235
http://jcl.svn.sourceforge.net/jcl/?rev=2235&view=rev
Author: outchy
Date: 2007-11-27 10:37:09 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
Added iterator comparison for equality.
Modified Paths:
--------------
trunk/jcl/source/common/JclArrayLists.pas
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/common/JclLinkedLists.pas
trunk/jcl/source/common/JclVectors.pas
trunk/jcl/source/prototypes/containers/JclArrayLists.imp
trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
trunk/jcl/source/prototypes/containers/JclLinkedLists.imp
trunk/jcl/source/prototypes/containers/JclVectors.imp
Modified: trunk/jcl/source/common/JclArrayLists.pas
===================================================================
--- trunk/jcl/source/common/JclArrayLists.pas 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/common/JclArrayLists.pas 2007-11-27 18:37:09 UTC (rev 2235)
@@ -690,6 +690,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIntfIterator }
function Add(const AInterface: IInterface): Boolean;
+ function Equals(const AIterator: IJclIntfIterator): Boolean;
function GetObject: IInterface;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -738,6 +739,22 @@
Result := TIntfItr.Create(FOwnList, FCursor, Valid);
end;
+function TIntfItr.Equals(const AIterator: IJclIntfIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntfItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntfItr then
+ begin
+ ItrObj := TIntfItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntfItr.GetObject: IInterface;
begin
CheckValid;
@@ -839,6 +856,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclAnsiStrIterator }
function Add(const AString: AnsiString): Boolean;
+ function Equals(const AIterator: IJclAnsiStrIterator): Boolean;
function GetString: AnsiString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -887,6 +905,22 @@
Result := TAnsiStrItr.Create(FOwnList, FCursor, Valid);
end;
+function TAnsiStrItr.Equals(const AIterator: IJclAnsiStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TAnsiStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TAnsiStrItr then
+ begin
+ ItrObj := TAnsiStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TAnsiStrItr.GetString: AnsiString;
begin
CheckValid;
@@ -988,6 +1022,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclWideStrIterator }
function Add(const AString: WideString): Boolean;
+ function Equals(const AIterator: IJclWideStrIterator): Boolean;
function GetString: WideString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1036,6 +1071,22 @@
Result := TWideStrItr.Create(FOwnList, FCursor, Valid);
end;
+function TWideStrItr.Equals(const AIterator: IJclWideStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TWideStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TWideStrItr then
+ begin
+ ItrObj := TWideStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TWideStrItr.GetString: WideString;
begin
CheckValid;
@@ -1137,6 +1188,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclSingleIterator }
function Add(const AValue: Single): Boolean;
+ function Equals(const AIterator: IJclSingleIterator): Boolean;
function GetValue: Single;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1185,6 +1237,22 @@
Result := TSingleItr.Create(FOwnList, FCursor, Valid);
end;
+function TSingleItr.Equals(const AIterator: IJclSingleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TSingleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TSingleItr then
+ begin
+ ItrObj := TSingleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TSingleItr.GetValue: Single;
begin
CheckValid;
@@ -1286,6 +1354,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclDoubleIterator }
function Add(const AValue: Double): Boolean;
+ function Equals(const AIterator: IJclDoubleIterator): Boolean;
function GetValue: Double;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1334,6 +1403,22 @@
Result := TDoubleItr.Create(FOwnList, FCursor, Valid);
end;
+function TDoubleItr.Equals(const AIterator: IJclDoubleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TDoubleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TDoubleItr then
+ begin
+ ItrObj := TDoubleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TDoubleItr.GetValue: Double;
begin
CheckValid;
@@ -1435,6 +1520,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclExtendedIterator }
function Add(const AValue: Extended): Boolean;
+ function Equals(const AIterator: IJclExtendedIterator): Boolean;
function GetValue: Extended;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1483,6 +1569,22 @@
Result := TExtendedItr.Create(FOwnList, FCursor, Valid);
end;
+function TExtendedItr.Equals(const AIterator: IJclExtendedIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TExtendedItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TExtendedItr then
+ begin
+ ItrObj := TExtendedItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TExtendedItr.GetValue: Extended;
begin
CheckValid;
@@ -1584,6 +1686,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIntegerIterator }
function Add(AValue: Integer): Boolean;
+ function Equals(const AIterator: IJclIntegerIterator): Boolean;
function GetValue: Integer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1632,6 +1735,22 @@
Result := TIntegerItr.Create(FOwnList, FCursor, Valid);
end;
+function TIntegerItr.Equals(const AIterator: IJclIntegerIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntegerItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntegerItr then
+ begin
+ ItrObj := TIntegerItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntegerItr.GetValue: Integer;
begin
CheckValid;
@@ -1733,6 +1852,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclCardinalIterator }
function Add(AValue: Cardinal): Boolean;
+ function Equals(const AIterator: IJclCardinalIterator): Boolean;
function GetValue: Cardinal;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1781,6 +1901,22 @@
Result := TCardinalItr.Create(FOwnList, FCursor, Valid);
end;
+function TCardinalItr.Equals(const AIterator: IJclCardinalIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TCardinalItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TCardinalItr then
+ begin
+ ItrObj := TCardinalItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TCardinalItr.GetValue: Cardinal;
begin
CheckValid;
@@ -1882,6 +2018,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclInt64Iterator }
function Add(const AValue: Int64): Boolean;
+ function Equals(const AIterator: IJclInt64Iterator): Boolean;
function GetValue: Int64;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1930,6 +2067,22 @@
Result := TInt64Itr.Create(FOwnList, FCursor, Valid);
end;
+function TInt64Itr.Equals(const AIterator: IJclInt64Iterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TInt64Itr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TInt64Itr then
+ begin
+ ItrObj := TInt64Itr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TInt64Itr.GetValue: Int64;
begin
CheckValid;
@@ -2032,6 +2185,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclPtrIterator }
function Add(APtr: Pointer): Boolean;
+ function Equals(const AIterator: IJclPtrIterator): Boolean;
function GetPtr: Pointer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2080,6 +2234,22 @@
Result := TPtrItr.Create(FOwnList, FCursor, Valid);
end;
+function TPtrItr.Equals(const AIterator: IJclPtrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TPtrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TPtrItr then
+ begin
+ ItrObj := TPtrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TPtrItr.GetPtr: Pointer;
begin
CheckValid;
@@ -2182,6 +2352,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIterator }
function Add(AObject: TObject): Boolean;
+ function Equals(const AIterator: IJclIterator): Boolean;
function GetObject: TObject;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2230,6 +2401,22 @@
Result := TItr.Create(FOwnList, FCursor, Valid);
end;
+function TItr.Equals(const AIterator: IJclIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr then
+ begin
+ ItrObj := TItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr.GetObject: TObject;
begin
CheckValid;
@@ -2333,6 +2520,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIterator<T> }
function Add(const AItem: T): Boolean;
+ function Equals(const AIterator: IJclIterator<T>): Boolean;
function GetItem: T;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2381,6 +2569,22 @@
Result := TItr<T>.Create(FOwnList, FCursor, Valid);
end;
+function TItr<T>.Equals(const AIterator: IJclIterator<T>): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr<T>;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr<T> then
+ begin
+ ItrObj := TItr<T>(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr<T>.GetItem: T;
begin
CheckValid;
Modified: trunk/jcl/source/common/JclBinaryTrees.pas
===================================================================
--- trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-27 18:37:09 UTC (rev 2235)
@@ -797,6 +797,7 @@
function GetPreviousCursor: TJclIntfBinaryNode; virtual; abstract;
{ IJclIntfIterator }
function Add(const AInterface: IInterface): Boolean;
+ function Equals(const AIterator: IJclIntfIterator): Boolean;
function GetObject: IInterface;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -895,6 +896,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TIntfItr.Equals(const AIterator: IJclIntfIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntfItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntfItr then
+ begin
+ ItrObj := TIntfItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntfItr.GetChild(Index: Integer): IInterface;
begin
{$IFDEF THREADSAFE}
@@ -1469,6 +1486,7 @@
function GetPreviousCursor: TJclAnsiStrBinaryNode; virtual; abstract;
{ IJclAnsiStrIterator }
function Add(const AString: AnsiString): Boolean;
+ function Equals(const AIterator: IJclAnsiStrIterator): Boolean;
function GetString: AnsiString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1567,6 +1585,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TAnsiStrItr.Equals(const AIterator: IJclAnsiStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TAnsiStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TAnsiStrItr then
+ begin
+ ItrObj := TAnsiStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TAnsiStrItr.GetChild(Index: Integer): AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -2141,6 +2175,7 @@
function GetPreviousCursor: TJclWideStrBinaryNode; virtual; abstract;
{ IJclWideStrIterator }
function Add(const AString: WideString): Boolean;
+ function Equals(const AIterator: IJclWideStrIterator): Boolean;
function GetString: WideString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2239,6 +2274,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TWideStrItr.Equals(const AIterator: IJclWideStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TWideStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TWideStrItr then
+ begin
+ ItrObj := TWideStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TWideStrItr.GetChild(Index: Integer): WideString;
begin
{$IFDEF THREADSAFE}
@@ -2813,6 +2864,7 @@
function GetPreviousCursor: TJclSingleBinaryNode; virtual; abstract;
{ IJclSingleIterator }
function Add(const AValue: Single): Boolean;
+ function Equals(const AIterator: IJclSingleIterator): Boolean;
function GetValue: Single;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2911,6 +2963,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TSingleItr.Equals(const AIterator: IJclSingleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TSingleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TSingleItr then
+ begin
+ ItrObj := TSingleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TSingleItr.GetChild(Index: Integer): Single;
begin
{$IFDEF THREADSAFE}
@@ -3485,6 +3553,7 @@
function GetPreviousCursor: TJclDoubleBinaryNode; virtual; abstract;
{ IJclDoubleIterator }
function Add(const AValue: Double): Boolean;
+ function Equals(const AIterator: IJclDoubleIterator): Boolean;
function GetValue: Double;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -3583,6 +3652,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TDoubleItr.Equals(const AIterator: IJclDoubleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TDoubleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TDoubleItr then
+ begin
+ ItrObj := TDoubleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TDoubleItr.GetChild(Index: Integer): Double;
begin
{$IFDEF THREADSAFE}
@@ -4157,6 +4242,7 @@
function GetPreviousCursor: TJclExtendedBinaryNode; virtual; abstract;
{ IJclExtendedIterator }
function Add(const AValue: Extended): Boolean;
+ function Equals(const AIterator: IJclExtendedIterator): Boolean;
function GetValue: Extended;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -4255,6 +4341,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TExtendedItr.Equals(const AIterator: IJclExtendedIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TExtendedItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TExtendedItr then
+ begin
+ ItrObj := TExtendedItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TExtendedItr.GetChild(Index: Integer): Extended;
begin
{$IFDEF THREADSAFE}
@@ -4829,6 +4931,7 @@
function GetPreviousCursor: TJclIntegerBinaryNode; virtual; abstract;
{ IJclIntegerIterator }
function Add(AValue: Integer): Boolean;
+ function Equals(const AIterator: IJclIntegerIterator): Boolean;
function GetValue: Integer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -4927,6 +5030,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TIntegerItr.Equals(const AIterator: IJclIntegerIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntegerItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntegerItr then
+ begin
+ ItrObj := TIntegerItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntegerItr.GetChild(Index: Integer): Integer;
begin
{$IFDEF THREADSAFE}
@@ -5501,6 +5620,7 @@
function GetPreviousCursor: TJclCardinalBinaryNode; virtual; abstract;
{ IJclCardinalIterator }
function Add(AValue: Cardinal): Boolean;
+ function Equals(const AIterator: IJclCardinalIterator): Boolean;
function GetValue: Cardinal;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -5599,6 +5719,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TCardinalItr.Equals(const AIterator: IJclCardinalIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TCardinalItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TCardinalItr then
+ begin
+ ItrObj := TCardinalItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TCardinalItr.GetChild(Index: Integer): Cardinal;
begin
{$IFDEF THREADSAFE}
@@ -6173,6 +6309,7 @@
function GetPreviousCursor: TJclInt64BinaryNode; virtual; abstract;
{ IJclInt64Iterator }
function Add(const AValue: Int64): Boolean;
+ function Equals(const AIterator: IJclInt64Iterator): Boolean;
function GetValue: Int64;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -6271,6 +6408,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TInt64Itr.Equals(const AIterator: IJclInt64Iterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TInt64Itr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TInt64Itr then
+ begin
+ ItrObj := TInt64Itr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TInt64Itr.GetChild(Index: Integer): Int64;
begin
{$IFDEF THREADSAFE}
@@ -6846,6 +6999,7 @@
function GetPreviousCursor: TJclPtrBinaryNode; virtual; abstract;
{ IJclPtrIterator }
function Add(APtr: Pointer): Boolean;
+ function Equals(const AIterator: IJclPtrIterator): Boolean;
function GetPtr: Pointer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -6944,6 +7098,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TPtrItr.Equals(const AIterator: IJclPtrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TPtrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TPtrItr then
+ begin
+ ItrObj := TPtrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TPtrItr.GetChild(Index: Integer): Pointer;
begin
{$IFDEF THREADSAFE}
@@ -7519,6 +7689,7 @@
function GetPreviousCursor: TJclBinaryNode; virtual; abstract;
{ IJclIterator }
function Add(AObject: TObject): Boolean;
+ function Equals(const AIterator: IJclIterator): Boolean;
function GetObject: TObject;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -7617,6 +7788,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TItr.Equals(const AIterator: IJclIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr then
+ begin
+ ItrObj := TItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr.GetChild(Index: Integer): TObject;
begin
{$IFDEF THREADSAFE}
@@ -8192,6 +8379,7 @@
function GetPreviousCursor: TJclBinaryNode<T>; virtual; abstract;
{ IJclIterator<T> }
function Add(const AItem: T): Boolean;
+ function Equals(const AIterator: IJclIterator<T>): Boolean;
function GetItem: T;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -8290,6 +8478,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TItr<T>.Equals(const AIterator: IJclIterator<T>): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr<T>;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr<T> then
+ begin
+ ItrObj := TItr<T>(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr<T>.GetChild(Index: Integer): T;
begin
{$IFDEF THREADSAFE}
Modified: trunk/jcl/source/common/JclContainerIntf.pas
===================================================================
--- trunk/jcl/source/common/JclContainerIntf.pas 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/common/JclContainerIntf.pas 2007-11-27 18:37:09 UTC (rev 2235)
@@ -613,6 +613,7 @@
IJclIntfIterator = interface(IJclAbstractIterator)
['{E121A98A-7C43-4587-806B-9189E8B2F106}']
function Add(const AInterface: IInterface): Boolean;
+ function Equals(const AIterator: IJclIntfIterator): Boolean;
function GetObject: IInterface;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -632,6 +633,7 @@
IJclAnsiStrIterator = interface(IJclAbstractIterator)
['{D5D4B681-F902-49C7-B9E1-73007C9D64F0}']
function Add(const AString: AnsiString): Boolean;
+ function Equals(const AIterator: IJclAnsiStrIterator): Boolean;
function GetString: AnsiString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -651,6 +653,7 @@
IJclWideStrIterator = interface(IJclAbstractIterator)
['{F03BC7D4-CCDA-4C4A-AF3A-E51FDCDE8ADE}']
function Add(const AString: WideString): Boolean;
+ function Equals(const AIterator: IJclWideStrIterator): Boolean;
function GetString: WideString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -677,6 +680,7 @@
IJclSingleIterator = interface(IJclAbstractIterator)
['{FD1124F8-CB2B-4AD7-B12D-C05702F4204B}']
function Add(const AValue: Single): Boolean;
+ function Equals(const AIterator: IJclSingleIterator): Boolean;
function GetValue: Single;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -696,6 +700,7 @@
IJclDoubleIterator = interface(IJclAbstractIterator)
['{004C154A-281C-4DA7-BF64-F3EE80ACF640}']
function Add(const AValue: Double): Boolean;
+ function Equals(const AIterator: IJclDoubleIterator): Boolean;
function GetValue: Double;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -715,6 +720,7 @@
IJclExtendedIterator = interface(IJclAbstractIterator)
['{B89877A5-DED4-4CD9-AB90-C7D062111DE0}']
function Add(const AValue: Extended): Boolean;
+ function Equals(const AIterator: IJclExtendedIterator): Boolean;
function GetValue: Extended;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -744,6 +750,7 @@
IJclIntegerIterator = interface(IJclAbstractIterator)
['{1406A991-4574-48A1-83FE-2EDCA03908BE}']
function Add(AValue: Integer): Boolean;
+ function Equals(const AIterator: IJclIntegerIterator): Boolean;
function GetValue: Integer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -763,6 +770,7 @@
IJclCardinalIterator = interface(IJclAbstractIterator)
['{72847A34-C8C4-4592-9447-CEB8161E33AD}']
function Add(AValue: Cardinal): Boolean;
+ function Equals(const AIterator: IJclCardinalIterator): Boolean;
function GetValue: Cardinal;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -782,6 +790,7 @@
IJclInt64Iterator = interface(IJclAbstractIterator)
['{573E5A51-BF76-43D7-9F93-46305BED20A8}']
function Add(const AValue: Int64): Boolean;
+ function Equals(const AIterator: IJclInt64Iterator): Boolean;
function GetValue: Int64;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -802,6 +811,7 @@
IJclPtrIterator = interface(IJclAbstractIterator)
['{62B5501C-07AA-4D00-A85B-713B39912CDF}']
function Add(APtr: Pointer): Boolean;
+ function Equals(const AIterator: IJclPtrIterator): Boolean;
function GetPtr: Pointer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -822,6 +832,7 @@
IJclIterator = interface(IJclAbstractIterator)
['{997DF9B7-9AA2-4239-8B94-14DFFD26D790}']
function Add(AObject: TObject): Boolean;
+ function Equals(const AIterator: IJclIterator): Boolean;
function GetObject: TObject;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -842,6 +853,7 @@
IJclIterator<T> = interface(IJclAbstractIterator)
['{6E8547A4-5B5D-4831-8AE3-9C6D04071B11}']
function Add(const AItem: T): Boolean;
+ function Equals(const AIterator: IJclIterator<T>): Boolean;
function GetItem: T;
function HasNext: Boolean;
function HasPrevious: Boolean;
Modified: trunk/jcl/source/common/JclLinkedLists.pas
===================================================================
--- trunk/jcl/source/common/JclLinkedLists.pas 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/common/JclLinkedLists.pas 2007-11-27 18:37:09 UTC (rev 2235)
@@ -747,6 +747,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclIntfIterator }
function Add(const AInterface: IInterface): Boolean;
+ function Equals(const AIterator: IJclIntfIterator): Boolean;
function GetObject: IInterface;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -799,6 +800,22 @@
Result := TIntfItr.Create(FOwnList, FCursor, Valid);
end;
+function TIntfItr.Equals(const AIterator: IJclIntfIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntfItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntfItr then
+ begin
+ ItrObj := TIntfItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntfItr.GetObject: IInterface;
begin
CheckValid;
@@ -1024,6 +1041,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclAnsiStrIterator }
function Add(const AString: AnsiString): Boolean;
+ function Equals(const AIterator: IJclAnsiStrIterator): Boolean;
function GetString: AnsiString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1076,6 +1094,22 @@
Result := TAnsiStrItr.Create(FOwnList, FCursor, Valid);
end;
+function TAnsiStrItr.Equals(const AIterator: IJclAnsiStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TAnsiStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TAnsiStrItr then
+ begin
+ ItrObj := TAnsiStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TAnsiStrItr.GetString: AnsiString;
begin
CheckValid;
@@ -1301,6 +1335,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclWideStrIterator }
function Add(const AString: WideString): Boolean;
+ function Equals(const AIterator: IJclWideStrIterator): Boolean;
function GetString: WideString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1353,6 +1388,22 @@
Result := TWideStrItr.Create(FOwnList, FCursor, Valid);
end;
+function TWideStrItr.Equals(const AIterator: IJclWideStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TWideStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TWideStrItr then
+ begin
+ ItrObj := TWideStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TWideStrItr.GetString: WideString;
begin
CheckValid;
@@ -1578,6 +1629,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclSingleIterator }
function Add(const AValue: Single): Boolean;
+ function Equals(const AIterator: IJclSingleIterator): Boolean;
function GetValue: Single;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1630,6 +1682,22 @@
Result := TSingleItr.Create(FOwnList, FCursor, Valid);
end;
+function TSingleItr.Equals(const AIterator: IJclSingleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TSingleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TSingleItr then
+ begin
+ ItrObj := TSingleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TSingleItr.GetValue: Single;
begin
CheckValid;
@@ -1855,6 +1923,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclDoubleIterator }
function Add(const AValue: Double): Boolean;
+ function Equals(const AIterator: IJclDoubleIterator): Boolean;
function GetValue: Double;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1907,6 +1976,22 @@
Result := TDoubleItr.Create(FOwnList, FCursor, Valid);
end;
+function TDoubleItr.Equals(const AIterator: IJclDoubleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TDoubleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TDoubleItr then
+ begin
+ ItrObj := TDoubleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TDoubleItr.GetValue: Double;
begin
CheckValid;
@@ -2132,6 +2217,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclExtendedIterator }
function Add(const AValue: Extended): Boolean;
+ function Equals(const AIterator: IJclExtendedIterator): Boolean;
function GetValue: Extended;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2184,6 +2270,22 @@
Result := TExtendedItr.Create(FOwnList, FCursor, Valid);
end;
+function TExtendedItr.Equals(const AIterator: IJclExtendedIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TExtendedItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TExtendedItr then
+ begin
+ ItrObj := TExtendedItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TExtendedItr.GetValue: Extended;
begin
CheckValid;
@@ -2409,6 +2511,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclIntegerIterator }
function Add(AValue: Integer): Boolean;
+ function Equals(const AIterator: IJclIntegerIterator): Boolean;
function GetValue: Integer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2461,6 +2564,22 @@
Result := TIntegerItr.Create(FOwnList, FCursor, Valid);
end;
+function TIntegerItr.Equals(const AIterator: IJclIntegerIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntegerItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntegerItr then
+ begin
+ ItrObj := TIntegerItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntegerItr.GetValue: Integer;
begin
CheckValid;
@@ -2686,6 +2805,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclCardinalIterator }
function Add(AValue: Cardinal): Boolean;
+ function Equals(const AIterator: IJclCardinalIterator): Boolean;
function GetValue: Cardinal;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2738,6 +2858,22 @@
Result := TCardinalItr.Create(FOwnList, FCursor, Valid);
end;
+function TCardinalItr.Equals(const AIterator: IJclCardinalIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TCardinalItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TCardinalItr then
+ begin
+ ItrObj := TCardinalItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TCardinalItr.GetValue: Cardinal;
begin
CheckValid;
@@ -2963,6 +3099,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclInt64Iterator }
function Add(const AValue: Int64): Boolean;
+ function Equals(const AIterator: IJclInt64Iterator): Boolean;
function GetValue: Int64;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -3015,6 +3152,22 @@
Result := TInt64Itr.Create(FOwnList, FCursor, Valid);
end;
+function TInt64Itr.Equals(const AIterator: IJclInt64Iterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TInt64Itr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TInt64Itr then
+ begin
+ ItrObj := TInt64Itr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TInt64Itr.GetValue: Int64;
begin
CheckValid;
@@ -3241,6 +3394,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclPtrIterator }
function Add(AValue: Pointer): Boolean;
+ function Equals(const AIterator: IJclPtrIterator): Boolean;
function GetPtr: Pointer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -3293,6 +3447,22 @@
Result := TPtrItr.Create(FOwnList, FCursor, Valid);
end;
+function TPtrItr.Equals(const AIterator: IJclPtrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TPtrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TPtrItr then
+ begin
+ ItrObj := TPtrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TPtrItr.GetPtr: Pointer;
begin
CheckValid;
@@ -3519,6 +3689,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclIterator }
function Add(AObject: TObject): Boolean;
+ function Equals(const AIterator: IJclIterator): Boolean;
function GetObject: TObject;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -3571,6 +3742,22 @@
Result := TItr.Create(FOwnList, FCursor, Valid);
end;
+function TItr.Equals(const AIterator: IJclIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr then
+ begin
+ ItrObj := TItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr.GetObject: TObject;
begin
CheckValid;
@@ -3798,6 +3985,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ IJclIterator<T> }
function Add(const AItem: T): Boolean;
+ function Equals(const AIterator: IJclIterator<T>): Boolean;
function GetItem: T;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -3850,6 +4038,22 @@
Result := TItr<T>.Create(FOwnList, FCursor, Valid);
end;
+function TItr<T>.Equals(const AIterator: IJclIterator<T>): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr<T>;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr<T> then
+ begin
+ ItrObj := TItr<T>(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr<T>.GetItem: T;
begin
CheckValid;
Modified: trunk/jcl/source/common/JclVectors.pas
===================================================================
--- trunk/jcl/source/common/JclVectors.pas 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/common/JclVectors.pas 2007-11-27 18:37:09 UTC (rev 2235)
@@ -689,6 +689,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIntfIterator }
function Add(const AInterface: IInterface): Boolean;
+ function Equals(const AIterator: IJclIntfIterator): Boolean;
function GetObject: IInterface;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -737,6 +738,22 @@
Result := TIntfItr.Create(FOwnList, FCursor, Valid);
end;
+function TIntfItr.Equals(const AIterator: IJclIntfIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntfItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntfItr then
+ begin
+ ItrObj := TIntfItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntfItr.GetObject: IInterface;
begin
CheckValid;
@@ -839,6 +856,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclAnsiStrIterator }
function Add(const AString: AnsiString): Boolean;
+ function Equals(const AIterator: IJclAnsiStrIterator): Boolean;
function GetString: AnsiString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -887,6 +905,22 @@
Result := TAnsiStrItr.Create(FOwnList, FCursor, Valid);
end;
+function TAnsiStrItr.Equals(const AIterator: IJclAnsiStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TAnsiStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TAnsiStrItr then
+ begin
+ ItrObj := TAnsiStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TAnsiStrItr.GetString: AnsiString;
begin
CheckValid;
@@ -989,6 +1023,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclWideStrIterator }
function Add(const AString: WideString): Boolean;
+ function Equals(const AIterator: IJclWideStrIterator): Boolean;
function GetString: WideString;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1037,6 +1072,22 @@
Result := TWideStrItr.Create(FOwnList, FCursor, Valid);
end;
+function TWideStrItr.Equals(const AIterator: IJclWideStrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TWideStrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TWideStrItr then
+ begin
+ ItrObj := TWideStrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TWideStrItr.GetString: WideString;
begin
CheckValid;
@@ -1139,6 +1190,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclSingleIterator }
function Add(const AValue: Single): Boolean;
+ function Equals(const AIterator: IJclSingleIterator): Boolean;
function GetValue: Single;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1187,6 +1239,22 @@
Result := TSingleItr.Create(FOwnList, FCursor, Valid);
end;
+function TSingleItr.Equals(const AIterator: IJclSingleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TSingleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TSingleItr then
+ begin
+ ItrObj := TSingleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TSingleItr.GetValue: Single;
begin
CheckValid;
@@ -1289,6 +1357,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclDoubleIterator }
function Add(const AValue: Double): Boolean;
+ function Equals(const AIterator: IJclDoubleIterator): Boolean;
function GetValue: Double;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1337,6 +1406,22 @@
Result := TDoubleItr.Create(FOwnList, FCursor, Valid);
end;
+function TDoubleItr.Equals(const AIterator: IJclDoubleIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TDoubleItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TDoubleItr then
+ begin
+ ItrObj := TDoubleItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TDoubleItr.GetValue: Double;
begin
CheckValid;
@@ -1439,6 +1524,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclExtendedIterator }
function Add(const AValue: Extended): Boolean;
+ function Equals(const AIterator: IJclExtendedIterator): Boolean;
function GetValue: Extended;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1487,6 +1573,22 @@
Result := TExtendedItr.Create(FOwnList, FCursor, Valid);
end;
+function TExtendedItr.Equals(const AIterator: IJclExtendedIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TExtendedItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TExtendedItr then
+ begin
+ ItrObj := TExtendedItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TExtendedItr.GetValue: Extended;
begin
CheckValid;
@@ -1589,6 +1691,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIntegerIterator }
function Add(AValue: Integer): Boolean;
+ function Equals(const AIterator: IJclIntegerIterator): Boolean;
function GetValue: Integer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1637,6 +1740,22 @@
Result := TIntegerItr.Create(FOwnList, FCursor, Valid);
end;
+function TIntegerItr.Equals(const AIterator: IJclIntegerIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TIntegerItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TIntegerItr then
+ begin
+ ItrObj := TIntegerItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TIntegerItr.GetValue: Integer;
begin
CheckValid;
@@ -1739,6 +1858,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclCardinalIterator }
function Add(AValue: Cardinal): Boolean;
+ function Equals(const AIterator: IJclCardinalIterator): Boolean;
function GetValue: Cardinal;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1787,6 +1907,22 @@
Result := TCardinalItr.Create(FOwnList, FCursor, Valid);
end;
+function TCardinalItr.Equals(const AIterator: IJclCardinalIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TCardinalItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TCardinalItr then
+ begin
+ ItrObj := TCardinalItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TCardinalItr.GetValue: Cardinal;
begin
CheckValid;
@@ -1889,6 +2025,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclInt64Iterator }
function Add(const AValue: Int64): Boolean;
+ function Equals(const AIterator: IJclInt64Iterator): Boolean;
function GetValue: Int64;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -1937,6 +2074,22 @@
Result := TInt64Itr.Create(FOwnList, FCursor, Valid);
end;
+function TInt64Itr.Equals(const AIterator: IJclInt64Iterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TInt64Itr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TInt64Itr then
+ begin
+ ItrObj := TInt64Itr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TInt64Itr.GetValue: Int64;
begin
CheckValid;
@@ -2040,6 +2193,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclPtrIterator }
function Add(APtr: Pointer): Boolean;
+ function Equals(const AIterator: IJclPtrIterator): Boolean;
function GetPtr: Pointer;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2088,6 +2242,22 @@
Result := TPtrItr.Create(FOwnList, FCursor, Valid);
end;
+function TPtrItr.Equals(const AIterator: IJclPtrIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TPtrItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TPtrItr then
+ begin
+ ItrObj := TPtrItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TPtrItr.GetPtr: Pointer;
begin
CheckValid;
@@ -2191,6 +2361,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIterator }
function Add(AObject: TObject): Boolean;
+ function Equals(const AIterator: IJclIterator): Boolean;
function GetObject: TObject;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2239,6 +2410,22 @@
Result := TItr.Create(FOwnList, FCursor, Valid);
end;
+function TItr.Equals(const AIterator: IJclIterator): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr then
+ begin
+ ItrObj := TItr(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr.GetObject: TObject;
begin
CheckValid;
@@ -2343,6 +2530,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIterator<T> }
function Add(const AItem: T): Boolean;
+ function Equals(const AIterator: IJclIterator<T>): Boolean;
function GetItem: T;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -2391,6 +2579,22 @@
Result := TItr<T>.Create(FOwnList, FCursor, Valid);
end;
+function TItr<T>.Equals(const AIterator: IJclIterator<T>): Boolean;
+var
+ Obj: TObject;
+ ItrObj: TItr<T>;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is TItr<T> then
+ begin
+ ItrObj := TItr<T>(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function TItr<T>.GetItem: T;
begin
CheckValid;
Modified: trunk/jcl/source/prototypes/containers/JclArrayLists.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-27 18:37:09 UTC (rev 2235)
@@ -60,6 +60,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ ITRINTERFACENAME }
function Add(PARAMETERDECLARATION): Boolean;
+ function Equals(const AIterator: ITRINTERFACENAME): Boolean;
function GETTERNAME: TYPENAME;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -108,6 +109,22 @@
Result := SELFCLASSNAME.Create(FOwnList, FCursor, Valid);
end;
+function SELFCLASSNAME.Equals(const AIterator: ITRINTERFACENAME): Boolean;
+var
+ Obj: TObject;
+ ItrObj: SELFCLASSNAME;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is SELFCLASSNAME then
+ begin
+ ItrObj := SELFCLASSNAME(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function SELFCLASSNAME.GETTERNAME: TYPENAME;
begin
CheckValid;
Modified: trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-27 18:37:09 UTC (rev 2235)
@@ -68,6 +68,7 @@
function GetPreviousCursor: NODETYPENAME; virtual; abstract;
{ STDITRINTERFACENAME }
function Add(PARAMETERDECLARATION): Boolean;
+ function Equals(const AIterator: STDITRINTERFACENAME): Boolean;
function GETTERNAME: PARAMETERTYPE;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -166,6 +167,22 @@
raise EJclOperationNotSupportedError.Create;
end;
+function BASEITRCLASSNAME.Equals(const AIterator: STDITRINTERFACENAME): Boolean;
+var
+ Obj: TObject;
+ ItrObj: BASEITRCLASSNAME;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is BASEITRCLASSNAME then
+ begin
+ ItrObj := BASEITRCLASSNAME(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function BASEITRCLASSNAME.GetChild(Index: Integer): PARAMETERTYPE;
begin
{$IFDEF THREADSAFE}
Modified: trunk/jcl/source/prototypes/containers/JclLinkedLists.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2007-11-27 18:37:09 UTC (rev 2235)
@@ -63,6 +63,7 @@
function CreateEmptyIterator: TJclAbstractIterator; override;
{ ITRINTERFACENAME }
function Add(PARAMETERDECLARATION): Boolean;
+ function Equals(const AIterator: ITRINTERFACENAME): Boolean;
function GETTERNAME: DATATYPENAME;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -115,6 +116,22 @@
Result := SELFCLASSNAME.Create(FOwnList, FCursor, Valid);
end;
+function SELFCLASSNAME.Equals(const AIterator: ITRINTERFACENAME): Boolean;
+var
+ Obj: TObject;
+ ItrObj: SELFCLASSNAME;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is SELFCLASSNAME then
+ begin
+ ItrObj := SELFCLASSNAME(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function SELFCLASSNAME.GETTERNAME: DATATYPENAME;
begin
CheckValid;
Modified: trunk/jcl/source/prototypes/containers/JclVectors.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-26 22:05:06 UTC (rev 2234)
+++ trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-27 18:37:09 UTC (rev 2235)
@@ -60,6 +60,7 @@
function IJclIntfCloneable.Clone = IntfClone;
{ ITRINTERFACENAME }
function Add(PARAMETERDECLARATION): Boolean;
+ function Equals(const AIterator: ITRINTERFACENAME): Boolean;
function GETTERNAME: DATATYPENAME;
function HasNext: Boolean;
function HasPrevious: Boolean;
@@ -108,6 +109,22 @@
Result := SELFCLASSNAME.Create(FOwnList, FCursor, Valid);
end;
+function SELFCLASSNAME.Equals(const AIterator: ITRINTERFACENAME): Boolean;
+var
+ Obj: TObject;
+ ItrObj: SELFCLASSNAME;
+begin
+ Result := False;
+ if AIterator = nil then
+ Exit;
+ Obj := AIterator.GetIteratorReference;
+ if Obj is SELFCLASSNAME then
+ begin
+ ItrObj := SELFCLASSNAME(Obj);
+ Result := (FOwnList = ItrObj.FOwnList) and (FCursor = ItrObj.FCursor) and (Valid = ItrObj.Valid);
+ end;
+end;
+
function SELFCLASSNAME.GETTERNAME: DATATYPENAME;
begin
CheckValid;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-11-26 22:05:11
|
Revision: 2234
http://jcl.svn.sourceforge.net/jcl/?rev=2234&view=rev
Author: morrac
Date: 2007-11-26 14:05:06 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
- Improve FPC support.
- Fix an error in TJclFileStream.Create (FPC and Kylix only).
Modified Paths:
--------------
trunk/jcl/source/common/JclBase.pas
trunk/jcl/source/common/JclStreams.pas
trunk/jcl/source/common/JclStringLists.pas
trunk/jcl/source/common/JclSysInfo.pas
trunk/jcl/source/common/JclSysUtils.pas
trunk/jcl/source/common/JclUnitVersioning.pas
Modified: trunk/jcl/source/common/JclBase.pas
===================================================================
--- trunk/jcl/source/common/JclBase.pas 2007-11-26 21:30:16 UTC (rev 2233)
+++ trunk/jcl/source/common/JclBase.pas 2007-11-26 22:05:06 UTC (rev 2234)
@@ -347,12 +347,16 @@
procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: Integer); overload;
procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: Integer); overload;
{$ENDIF ~CLR}
+{$IFNDEF FPC}
procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: Integer); overload;
+{$ENDIF}
procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: Integer); overload;
procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: Integer); overload;
procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: Integer); overload;
procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: Integer); overload;
+{$IFNDEF FPC}
procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: Integer); overload;
+{$ENDIF}
procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: Integer); overload;
procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: Integer); overload;
procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: Integer); overload;
@@ -579,6 +583,7 @@
end;
{$ENDIF ~CLR}
+{$IFNDEF FPC}
procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: Integer); overload;
{$IFDEF CLR}
var
@@ -636,6 +641,7 @@
end;
end;
{$ENDIF CLR}
+{$ENDIF FPC}
procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: Integer); overload;
{$IFDEF CLR}
@@ -869,6 +875,7 @@
end;
{$ENDIF CLR}
+{$IFNDEF FPC}
procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: Integer); overload;
{$IFDEF CLR}
var
@@ -926,6 +933,7 @@
end;
end;
{$ENDIF CLR}
+{$ENDIF FPC}
procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: Integer); overload;
{$IFDEF CLR}
Modified: trunk/jcl/source/common/JclStreams.pas
===================================================================
--- trunk/jcl/source/common/JclStreams.pas 2007-11-26 21:30:16 UTC (rev 2233)
+++ trunk/jcl/source/common/JclStreams.pas 2007-11-26 22:05:06 UTC (rev 2234)
@@ -660,7 +660,11 @@
const
SeekOrigins: array [TSeekOrigin] of Cardinal = ( SEEK_SET {soBeginning}, SEEK_CUR {soCurrent}, SEEK_END {soEnd} );
begin
+{$IFDEF KYLIX}
Result := __lseek(Handle, Offset, SeekOrigins[Origin]);
+{$ELSE}
+ Result := lseek(Handle, Offset, SeekOrigins[Origin]);
+{$ENDIF}
end;
{$ENDIF LINUX}
@@ -682,21 +686,24 @@
constructor TJclFileStream.Create(const FileName: string; Mode: Word; Rights: Cardinal);
var
H: THandle;
-{$IFDEF KYLIX}
+{$IFDEF LINUX}
const
- INVALID_HANDLE_VALUE = 0;
-{$ENDIF KYLIX}
+ INVALID_HANDLE_VALUE = -1;
+{$ENDIF LINUX}
begin
if Mode = fmCreate then
begin
+ {$IFDEF LINUX}
{$IFDEF KYLIX}
H := __open(PChar(FileName), O_CREAT or O_RDWR, FileAccessRights);
- inherited Create(H);
{$ELSE ~KYLIX}
+ H := open(PChar(FileName), O_CREAT or O_RDWR, $666);
+ {$ENDIF}
+ {$ELSE ~LINUX}
H := CreateFile(PChar(FileName), GENERIC_READ or GENERIC_WRITE,
0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
+ {$ENDIF ~LINUX}
inherited Create(H);
- {$ENDIF ~KYLIX}
if Handle = INVALID_HANDLE_VALUE then
{$IFDEF CLR}
raise EJclStreamError.CreateFmt(RsStreamsCreateError, [FileName]);
Modified: trunk/jcl/source/common/JclStringLists.pas
===================================================================
--- trunk/jcl/source/common/JclStringLists.pas 2007-11-26 21:30:16 UTC (rev 2233)
+++ trunk/jcl/source/common/JclStringLists.pas 2007-11-26 22:05:06 UTC (rev 2234)
@@ -355,9 +355,9 @@
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
{$ENDIF CLR}
- {$IFDEF COMPILER5}
+ {$IF defined(COMPILER5) OR defined(FPC)}
function CompareStrings(const S1, S2: string): Integer; virtual;
- {$ENDIF COMPILER5}
+ {$IFEND}
public
constructor Create;
destructor Destroy; override;
@@ -1126,12 +1126,12 @@
Result := FSelfAsInterface;
end;
-{$IFDEF COMPILER5}
+{$IF defined(COMPILER5) OR defined(FPC)}
function TJclStringListImpl.CompareStrings(const S1, S2: string): Integer;
begin
Result := AnsiCompareText(S1, S2);
end;
-{$ENDIF COMPILER5}
+{$IFEND}
function TJclStringListImpl.SortByName: IJclStringList;
Modified: trunk/jcl/source/common/JclSysInfo.pas
===================================================================
--- trunk/jcl/source/common/JclSysInfo.pas 2007-11-26 21:30:16 UTC (rev 2233)
+++ trunk/jcl/source/common/JclSysInfo.pas 2007-11-26 22:05:06 UTC (rev 2234)
@@ -1434,7 +1434,7 @@
{$ENDIF MSWINDOWS}
-{$IFDEF KYLIX}
+{$IFDEF LINUX}
function GetEnvironmentVars(const Vars: TStrings): Boolean;
var
P: PPChar;
@@ -1458,7 +1458,7 @@
begin
Result := GetEnvironmentVars(Vars); // Expand is there just for x-platform compatibility
end;
-{$ENDIF KYLIX}
+{$ENDIF LINUX}
{$IFDEF MSWINDOWS}
function GetEnvironmentVars(const Vars: TStrings): Boolean;
Modified: trunk/jcl/source/common/JclSysUtils.pas
===================================================================
--- trunk/jcl/source/common/JclSysUtils.pas 2007-11-26 21:30:16 UTC (rev 2233)
+++ trunk/jcl/source/common/JclSysUtils.pas 2007-11-26 22:05:06 UTC (rev 2234)
@@ -132,7 +132,7 @@
{ SharedFreeMem releases the shared memory if it was the last reference. }
function SharedFreeMem(var p{: Pointer}): Boolean;
-// Functions for the shared memory user
+// Functions for the shared memory user
{ SharedOpenMem returns True if the shared memory was already allocated by
SharedGetMem or SharedAllocMem. Otherwise it returns False.
@@ -951,7 +951,7 @@
{$IFDEF THREADSAFE}
HandleListAccess := GetAccessToHandleList;
{$ENDIF THREADSAFE}
-
+
// search for same name
Iterate := MMFHandleList;
while Iterate <> nil do
@@ -972,7 +972,7 @@
begin
if Size = 0 then
raise ESharedMemError.CreateResFmt(@RsInvalidMMFEmpty, [Name]);
-
+
Protect := PAGE_READWRITE;
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) and
(DesiredAccess = FILE_MAP_COPY) then
@@ -1626,7 +1626,8 @@
begin
PatchAddress := Pointer(Integer(AClass) + Offset);
if not WriteProtectedMemory(PatchAddress, @Value, SizeOf(Value), WrittenBytes) then
- raise EJclVMTError.CreateResFmt(@RsVMTMemoryWriteError, [SysErrorMessage(GetLastError)]);
+ raise EJclVMTError.CreateResFmt(@RsVMTMemoryWriteError,
+ [SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF})]);
if WrittenBytes <> SizeOf(Pointer) then
raise EJclVMTError.CreateResFmt(@RsVMTMemoryWriteError, [IntToStr(WrittenBytes)]);
@@ -1782,7 +1783,8 @@
begin
PatchAddress := PPointer(Integer(AClass) + vmtParent)^;
if not WriteProtectedMemory(PatchAddress, @NewClassParent, SizeOf(Pointer), WrittenBytes) then
- raise EJclVMTError.CreateResFmt(@RsVMTMemoryWriteError, [SysErrorMessage(GetLastError)]);
+ raise EJclVMTError.CreateResFmt(@RsVMTMemoryWriteError,
+ [SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF})]);
if WrittenBytes <> SizeOf(Pointer) then
raise EJclVMTError.CreateResFmt(@RsVMTMemoryWriteError, [IntToStr(WrittenBytes)]);
// make sure that everything keeps working in a dual processor setting
@@ -2244,7 +2246,7 @@
end;
FirstDigitPos := I + 1;
-
+
if HasSign then
Result[I] := SignChar(Value)
else
Modified: trunk/jcl/source/common/JclUnitVersioning.pas
===================================================================
--- trunk/jcl/source/common/JclUnitVersioning.pas 2007-11-26 21:30:16 UTC (rev 2233)
+++ trunk/jcl/source/common/JclUnitVersioning.pas 2007-11-26 22:05:06 UTC (rev 2234)
@@ -480,7 +480,11 @@
for I := FModules.Count - 1 downto 0 do
begin
SetLength(Buffer, 1024);
+ {$IFDEF FPC}
+ if dlsym(Pointer(Modules[I].Instance), '_init') = nil then
+ {$ELSE}
if GetModuleFileName(Modules[I].Instance, PChar(Buffer), 1024) = 0 then
+ {$ENDIF}
// This module is no more in memory but has not unregistered itself so
// unregister it here.
UnregisterModule(Modules[I]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-26 21:30:18
|
Revision: 2233
http://jcl.svn.sourceforge.net/jcl/?rev=2233&view=rev
Author: outchy
Date: 2007-11-26 13:30:16 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
Fix for the implementation of binary trees node addition when duplicates are allowed.
Modified Paths:
--------------
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
Modified: trunk/jcl/source/common/JclBinaryTrees.pas
===================================================================
--- trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-24 19:26:46 UTC (rev 2232)
+++ trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-26 21:30:16 UTC (rev 2233)
@@ -8897,6 +8897,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -8907,7 +8910,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -9587,6 +9590,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -9597,7 +9603,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -10277,6 +10283,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -10287,7 +10296,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -10967,6 +10976,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -10977,7 +10989,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -11657,6 +11669,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -11667,7 +11682,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -12347,6 +12362,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -12357,7 +12375,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -13037,6 +13055,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -13047,7 +13068,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -13727,6 +13748,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -13737,7 +13761,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -14417,6 +14441,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -14427,7 +14454,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -15108,6 +15135,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -15118,7 +15148,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -15799,6 +15829,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -15809,7 +15842,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
@@ -16490,6 +16523,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -16500,7 +16536,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
Modified: trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-24 19:26:46 UTC (rev 2232)
+++ trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-26 21:30:16 UTC (rev 2233)
@@ -772,6 +772,9 @@
if Comp > 0 then
Current := Current.Right
else
+ if CheckDuplicate then
+ Current := Current.Left // arbitrary decision
+ else
Break;
end;
if (Comp <> 0) or CheckDuplicate then
@@ -782,7 +785,7 @@
if Save = nil then
FRoot := NewNode
else
- if ItemsCompare(NewNode.Value, Save.Value) < 0 then
+ if ItemsCompare(NewNode.Value, Save.Value) <= 0 then
Save.Left := NewNode
else
Save.Right := NewNode;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cyc...@us...> - 2007-11-24 19:26:51
|
Revision: 2232
http://jcl.svn.sourceforge.net/jcl/?rev=2232&view=rev
Author: cycocrew
Date: 2007-11-24 11:26:46 -0800 (Sat, 24 Nov 2007)
Log Message:
-----------
Updated contributors files.
Modified Paths:
--------------
trunk/jcl/docs/Contacting authors.html
trunk/jcl/docs/Contributors.html
trunk/jcl/docs/Contributors.txt
Modified: trunk/jcl/docs/Contacting authors.html
===================================================================
--- trunk/jcl/docs/Contacting authors.html 2007-11-23 17:30:56 UTC (rev 2231)
+++ trunk/jcl/docs/Contacting authors.html 2007-11-24 19:26:46 UTC (rev 2232)
@@ -1,17 +1,16 @@
-<HTML>
-<HEAD>
-<LINK REL="stylesheet" HREF="..\DclStyle.css">
-<TITLE>Contacting authors</TITLE>
-</HEAD>
-<BODY>
-<H1>Contacting authors</H1>
-<P>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<link rel="stylesheet" href="..%5CDclStyle.css">
+<title>Contacting authors</title></head>
+<body>
+<h1>Contacting authors</h1>
+<p>
The JEDI Code Library is built upon donations by various individuals. In the
documentation for each subroutine or class you will find who the author of that
particular code is by looking in the "Quick Info" section. The author's e-mail
is not listed there. It is listed in the contributors page elsewhere in this
document. Therefore if you really need to contact an author it is possible. However,
-generically speaking, you should <B>never contact an author</B> regarding code included
+generically speaking, you should <b>never contact an author</b> regarding code included
in this library. There are various reasons for this with the two most prominent
being that some authors explicitly requested this and because "author" means
different things in different context. Usually "author" means that the described
@@ -21,15 +20,14 @@
individual. Consequently there exist several routines which in no way resemble
the original code as it was donated by the "author". Nevertheless, the individual
that orginally donated the code is still documented as the author.
-<P>
+</p><p>
In general, if you like some routine very much and it has proven to work correctly:
be grateful to the author (in thought, not by sending him or her an e-mail). On
the other hand, if some routine turns out to be buggy, incorrect or for whatever
reason is not to your liking: complain to me. It was most likely we who screwed
it up and introduced those bugs into code that was working perfectly until we got
our hands on it! To report bugs, use Project JEDI's
-<A HREF="http://homepages.borland.com/jedi/issuetracker/">Issue Tracker</A>.
+<a href="http://homepages.borland.com/jedi/issuetracker/">Issue Tracker</a>.
-<DIV CLASS="footer">Built on Friday, May 14, 2004</DIV>
-</BODY>
-</HTML>
\ No newline at end of file
+</p><div class="footer">Built on Saturday, November 24, 2007</div>
+</body></html>
\ No newline at end of file
Modified: trunk/jcl/docs/Contributors.html
===================================================================
--- trunk/jcl/docs/Contributors.html 2007-11-23 17:30:56 UTC (rev 2231)
+++ trunk/jcl/docs/Contributors.html 2007-11-24 19:26:46 UTC (rev 2232)
@@ -1,13 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
+<html><head>
<link rel="stylesheet" href="..%5CDclStyle.css">
- <title>JCL Contributors (code donators)</title>
-</head>
+ <title>JCL Contributors (code donators)</title></head>
<body>
@@ -58,7 +56,7 @@
<tr valign="top">
- <td width="25%"><a href="mailto:asn...@us...">André Snepvangers</a></td>
+ <td width="25%"><a href="mailto:asn...@us...">Andr\xE9 Snepvangers</a></td>
<td width="25%"><a href="mailto:ah...@us...">Andreas Hausladen</a></td>
@@ -181,7 +179,7 @@
<td width="25%">Jean Debord</td>
- <td width="25%"><a href="mailto:cyc...@wa...">Jean-Fabien Connault</a></td>
+ <td width="25%"><a href="mailto:cyc...@or...">Jean-Fabien Connault</a></td>
<td width="25%"><a href="mailto:rd...@us...">Jean-Philippe BEMPEL</a></td>
@@ -392,10 +390,9 @@
<p>
</p>
-<div class="footer">Built on 2005-03-14</div>
+<div class="footer">Built on 2007-11-24</div>
<p></p>
-</body>
-</html>
+</body></html>
\ No newline at end of file
Modified: trunk/jcl/docs/Contributors.txt
===================================================================
--- trunk/jcl/docs/Contributors.txt 2007-11-23 17:30:56 UTC (rev 2231)
+++ trunk/jcl/docs/Contributors.txt 2007-11-24 19:26:46 UTC (rev 2232)
@@ -48,7 +48,7 @@
Jack N.A. Bak...@eu...
James Aza...@ja...
Jean Debord=
-Jean-Fabien Con...@wa...
+Jean-Fabien Con...@or...
Jean-Philippe BEM...@us...
Jeroen Speldekamp=
Johannes Ber...@gm...
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-23 17:31:02
|
Revision: 2231
http://jcl.svn.sourceforge.net/jcl/?rev=2231&view=rev
Author: outchy
Date: 2007-11-23 09:30:56 -0800 (Fri, 23 Nov 2007)
Log Message:
-----------
Refactoring capacity computations while packing and growing: introducing CalcGrowCapacity and CalcPackCapacity to compute new capacity.
Modified Paths:
--------------
trunk/jcl/source/common/JclAbstractContainers.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/common/JclHashMaps.pas
trunk/jcl/source/prototypes/containers/JclHashMaps.imp
Modified: trunk/jcl/source/common/JclAbstractContainers.pas
===================================================================
--- trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-22 18:02:00 UTC (rev 2230)
+++ trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-23 17:30:56 UTC (rev 2231)
@@ -122,6 +122,7 @@
function IJclIntfCloneable.Clone = IntfClone;
// IJclGrowable is not in interface list because some descendants won't use this code
{ IJclGrowable }
+ function CalcGrowCapacity(ACapacity, ASize: Integer): Integer; virtual;
function GetAutoGrowParameter: Integer; virtual;
function GetAutoGrowStrategy: TJclAutoGrowStrategy; virtual;
procedure Grow; virtual;
@@ -129,6 +130,7 @@
procedure SetAutoGrowStrategy(Value: TJclAutoGrowStrategy); virtual;
// IJclPackable is not in interface list because some descendants won't use this code
{ IJclPackable }
+ function CalcPackCapacity(ACapacity, ASize: Integer): Integer; virtual;
function GetAutoPackParameter: Integer; virtual;
function GetAutoPackStrategy: TJclAutoPackStrategy; virtual;
function GetCapacity: Integer; virtual;
@@ -796,35 +798,60 @@
procedure TJclAbstractContainerBase.AutoGrow;
begin
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- SetCapacity(FCapacity + 1);
- agsProportional:
- SetCapacity(FCapacity + FCapacity div FAutoGrowParameter);
- agsIncremental:
- SetCapacity(FCapacity + FAutoGrowParameter);
- end;
+ SetCapacity(CalcGrowCapacity(FCapacity, FSize));
end;
procedure TJclAbstractContainerBase.AutoPack;
+begin
+ SetCapacity(CalcPackCapacity(FCapacity, FSize));
+end;
+
+function TJclAbstractContainerBase.CalcGrowCapacity(ACapacity, ASize: Integer): Integer;
var
+ Increment: Integer;
+begin
+ Result := ACapacity;
+ if ASize = ACapacity then
+ begin
+ case FAutoGrowStrategy of
+ agsDisabled: ;
+ agsAgressive:
+ Result := ACapacity + 1;
+ agsProportional:
+ begin
+ Increment := ACapacity div FAutoGrowParameter;
+ if Increment = 0 then
+ Increment := 1;
+ Result := ACapacity + Increment;
+ end;
+ agsIncremental:
+ Result := ACapacity + FAutoGrowParameter;
+ end;
+ end;
+end;
+
+function TJclAbstractContainerBase.CalcPackCapacity(ACapacity, ASize: Integer): Integer;
+var
Decrement: Integer;
begin
- case FAutoPackStrategy of
- apsDisabled:
+ Result := ACapacity;
+ if ASize < ACapacity then
+ begin
+ case FAutoPackStrategy of
+ apsDisabled:
+ Decrement := 0;
+ apsAgressive:
+ Decrement := 1;
+ apsProportional:
+ Decrement := ACapacity div FAutoPackParameter;
+ apsIncremental:
+ Decrement := FAutoPackParameter;
+ else
Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := FCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
+ end;
+ if (Decrement > 0) and ((ASize + Decrement) <= ACapacity) then
+ Result := ASize;
end;
- if (Decrement > 0) and ((FSize + Decrement) <= FCapacity) then
- SetCapacity(FSize);
end;
function TJclAbstractContainerBase.CheckDuplicate: Boolean;
@@ -911,7 +938,7 @@
procedure TJclAbstractContainerBase.Grow;
begin
// override to customize
- AutoGrow;
+ SetCapacity(CalcGrowCapacity(FCapacity, FSize));
end;
function TJclAbstractContainerBase.IntfClone: IInterface;
@@ -935,7 +962,7 @@
procedure TJclAbstractContainerBase.Pack;
begin
// override to customize
- SetCapacity(FSize);
+ SetCapacity(CalcPackCapacity(FCapacity, FSize));
end;
procedure TJclAbstractContainerBase.SetAllowDefaultElements(Value: Boolean);
Modified: trunk/jcl/source/common/JclContainerIntf.pas
===================================================================
--- trunk/jcl/source/common/JclContainerIntf.pas 2007-11-22 18:02:00 UTC (rev 2230)
+++ trunk/jcl/source/common/JclContainerIntf.pas 2007-11-23 17:30:56 UTC (rev 2231)
@@ -536,6 +536,7 @@
IJclPackable = interface
['{03802D2B-E0AB-4300-A777-0B8A2BD993DF}']
+ function CalcGrowCapacity(ACapacity, ASize: Integer): Integer;
function GetAutoPackParameter: Integer;
function GetAutoPackStrategy: TJclAutoPackStrategy;
function GetCapacity: Integer;
@@ -559,6 +560,7 @@
IJclGrowable = interface(IJclPackable)
['{C71E8586-5688-444C-9BDD-9969D988123B}']
+ function CalcPackCapacity(ACapacity, ASize: Integer): Integer;
function GetAutoGrowParameter: Integer;
function GetAutoGrowStrategy: TJclAutoGrowStrategy;
procedure Grow;
Modified: trunk/jcl/source/common/JclHashMaps.pas
===================================================================
--- trunk/jcl/source/common/JclHashMaps.pas 2007-11-22 18:02:00 UTC (rev 2230)
+++ trunk/jcl/source/common/JclHashMaps.pas 2007-11-23 17:30:56 UTC (rev 2231)
@@ -85,8 +85,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -143,8 +141,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclAnsiStrIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclAnsiStrIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclAnsiStrIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -201,8 +197,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfAnsiStrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfAnsiStrBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfAnsiStrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -260,8 +254,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclAnsiStrAnsiStrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclAnsiStrAnsiStrBucket); virtual;
- procedure PackEntries(Bucket: TJclAnsiStrAnsiStrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -318,8 +310,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclWideStrIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclWideStrIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclWideStrIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -376,8 +366,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfWideStrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfWideStrBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfWideStrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -435,8 +423,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclWideStrWideStrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclWideStrWideStrBucket); virtual;
- procedure PackEntries(Bucket: TJclWideStrWideStrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -504,8 +490,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclSingleIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclSingleIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclSingleIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -562,8 +546,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfSingleEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfSingleBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfSingleBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -621,8 +603,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclSingleSingleEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclSingleSingleBucket); virtual;
- procedure PackEntries(Bucket: TJclSingleSingleBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -679,8 +659,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclDoubleIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclDoubleIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclDoubleIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -737,8 +715,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfDoubleEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfDoubleBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfDoubleBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -796,8 +772,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclDoubleDoubleEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclDoubleDoubleBucket); virtual;
- procedure PackEntries(Bucket: TJclDoubleDoubleBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -854,8 +828,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclExtendedIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclExtendedIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclExtendedIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -912,8 +884,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfExtendedEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfExtendedBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfExtendedBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -971,8 +941,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclExtendedExtendedEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclExtendedExtendedBucket); virtual;
- procedure PackEntries(Bucket: TJclExtendedExtendedBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1045,8 +1013,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntegerIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntegerIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclIntegerIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1103,8 +1069,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfIntegerEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfIntegerBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfIntegerBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1162,8 +1126,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntegerIntegerEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntegerIntegerBucket); virtual;
- procedure PackEntries(Bucket: TJclIntegerIntegerBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1220,8 +1182,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclCardinalIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclCardinalIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclCardinalIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1278,8 +1238,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfCardinalEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfCardinalBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfCardinalBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1337,8 +1295,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclCardinalCardinalEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclCardinalCardinalBucket); virtual;
- procedure PackEntries(Bucket: TJclCardinalCardinalBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1395,8 +1351,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclInt64IntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclInt64IntfBucket); virtual;
- procedure PackEntries(Bucket: TJclInt64IntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1453,8 +1407,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfInt64EntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfInt64Bucket); virtual;
- procedure PackEntries(Bucket: TJclIntfInt64Bucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1512,8 +1464,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclInt64Int64EntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclInt64Int64Bucket); virtual;
- procedure PackEntries(Bucket: TJclInt64Int64Bucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1571,8 +1521,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclPtrIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclPtrIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclPtrIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1629,8 +1577,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfPtrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfPtrBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfPtrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1688,8 +1634,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclPtrPtrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclPtrPtrBucket); virtual;
- procedure PackEntries(Bucket: TJclPtrPtrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1748,8 +1692,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntfEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntfBucket); virtual;
- procedure PackEntries(Bucket: TJclIntfBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1811,8 +1753,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclAnsiStrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclAnsiStrBucket); virtual;
- procedure PackEntries(Bucket: TJclAnsiStrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1873,8 +1813,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclWideStrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclWideStrBucket); virtual;
- procedure PackEntries(Bucket: TJclWideStrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -1942,8 +1880,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclSingleEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclSingleBucket); virtual;
- procedure PackEntries(Bucket: TJclSingleBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2004,8 +1940,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclDoubleEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclDoubleBucket); virtual;
- procedure PackEntries(Bucket: TJclDoubleBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2066,8 +2000,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclExtendedEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclExtendedBucket); virtual;
- procedure PackEntries(Bucket: TJclExtendedBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2138,8 +2070,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclIntegerEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclIntegerBucket); virtual;
- procedure PackEntries(Bucket: TJclIntegerBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2200,8 +2130,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclCardinalEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclCardinalBucket); virtual;
- procedure PackEntries(Bucket: TJclCardinalBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2262,8 +2190,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclInt64EntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclInt64Bucket); virtual;
- procedure PackEntries(Bucket: TJclInt64Bucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2325,8 +2251,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclPtrEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclPtrBucket); virtual;
- procedure PackEntries(Bucket: TJclPtrBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2389,8 +2313,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclEntryArray; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclBucket); virtual;
- procedure PackEntries(Bucket: TJclBucket); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2457,8 +2379,6 @@
procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
procedure MoveArray(var List: TJclEntryArray<TKey,TValue>; FromIndex, ToIndex, Count: Integer);
- procedure GrowEntries(Bucket: TJclBucket<TKey,TValue>); virtual;
- procedure PackEntries(Bucket: TJclBucket<TKey,TValue>); virtual;
{ IJclPackable }
procedure Pack; override;
procedure SetCapacity(Value: Integer); override;
@@ -2834,24 +2754,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfIntfHashMap.GrowEntries(Bucket: TJclIntfIntfBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclIntfIntfHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -3016,27 +2919,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfIntfHashMap.PackEntries(Bucket: TJclIntfIntfBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclIntfIntfHashMap.PutAll(const AMap: IJclIntfIntfMap);
var
It: IJclIntfIterator;
@@ -3093,7 +2975,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -3112,7 +2995,7 @@
function TJclIntfIntfHashMap.Remove(const Key: IInterface): IInterface;
var
Bucket: TJclIntfIntfBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -3133,7 +3016,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -3434,24 +3320,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclAnsiStrIntfHashMap.GrowEntries(Bucket: TJclAnsiStrIntfBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclAnsiStrIntfHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -3616,27 +3485,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclAnsiStrIntfHashMap.PackEntries(Bucket: TJclAnsiStrIntfBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclAnsiStrIntfHashMap.PutAll(const AMap: IJclAnsiStrIntfMap);
var
It: IJclAnsiStrIterator;
@@ -3693,7 +3541,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -3712,7 +3561,7 @@
function TJclAnsiStrIntfHashMap.Remove(const Key: AnsiString): IInterface;
var
Bucket: TJclAnsiStrIntfBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -3733,7 +3582,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -4002,8 +3854,6 @@
Value := '';
end;
-
-
function TJclIntfAnsiStrHashMap.GetValue(const Key: IInterface): AnsiString;
var
I: Integer;
@@ -4034,23 +3884,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfAnsiStrHashMap.GrowEntries(Bucket: TJclIntfAnsiStrBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclIntfAnsiStrHashMap.Hash(const AInterface: IInterface): Integer;
begin
Result := Integer(AInterface);
@@ -4220,27 +4053,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfAnsiStrHashMap.PackEntries(Bucket: TJclIntfAnsiStrBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclIntfAnsiStrHashMap.PutAll(const AMap: IJclIntfAnsiStrMap);
var
It: IJclIntfIterator;
@@ -4297,7 +4109,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -4316,7 +4129,7 @@
function TJclIntfAnsiStrHashMap.Remove(const Key: IInterface): AnsiString;
var
Bucket: TJclIntfAnsiStrBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -4337,7 +4150,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -4606,8 +4422,6 @@
Value := '';
end;
-
-
function TJclAnsiStrAnsiStrHashMap.GetValue(const Key: AnsiString): AnsiString;
var
I: Integer;
@@ -4638,24 +4452,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclAnsiStrAnsiStrHashMap.GrowEntries(Bucket: TJclAnsiStrAnsiStrBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
-
function TJclAnsiStrAnsiStrHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -4820,27 +4616,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclAnsiStrAnsiStrHashMap.PackEntries(Bucket: TJclAnsiStrAnsiStrBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclAnsiStrAnsiStrHashMap.PutAll(const AMap: IJclAnsiStrAnsiStrMap);
var
It: IJclAnsiStrIterator;
@@ -4897,7 +4672,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -4916,7 +4692,7 @@
function TJclAnsiStrAnsiStrHashMap.Remove(const Key: AnsiString): AnsiString;
var
Bucket: TJclAnsiStrAnsiStrBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -4937,7 +4713,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -5238,24 +5017,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclWideStrIntfHashMap.GrowEntries(Bucket: TJclWideStrIntfBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclWideStrIntfHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -5420,27 +5182,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclWideStrIntfHashMap.PackEntries(Bucket: TJclWideStrIntfBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclWideStrIntfHashMap.PutAll(const AMap: IJclWideStrIntfMap);
var
It: IJclWideStrIterator;
@@ -5497,7 +5238,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -5516,7 +5258,7 @@
function TJclWideStrIntfHashMap.Remove(const Key: WideString): IInterface;
var
Bucket: TJclWideStrIntfBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -5537,7 +5279,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -5838,23 +5583,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfWideStrHashMap.GrowEntries(Bucket: TJclIntfWideStrBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclIntfWideStrHashMap.Hash(const AInterface: IInterface): Integer;
begin
Result := Integer(AInterface);
@@ -6024,27 +5752,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfWideStrHashMap.PackEntries(Bucket: TJclIntfWideStrBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclIntfWideStrHashMap.PutAll(const AMap: IJclIntfWideStrMap);
var
It: IJclIntfIterator;
@@ -6101,7 +5808,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -6120,7 +5828,7 @@
function TJclIntfWideStrHashMap.Remove(const Key: IInterface): WideString;
var
Bucket: TJclIntfWideStrBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -6141,7 +5849,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -6442,24 +6153,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclWideStrWideStrHashMap.GrowEntries(Bucket: TJclWideStrWideStrBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclWideStrWideStrHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -6624,27 +6318,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclWideStrWideStrHashMap.PackEntries(Bucket: TJclWideStrWideStrBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclWideStrWideStrHashMap.PutAll(const AMap: IJclWideStrWideStrMap);
var
It: IJclWideStrIterator;
@@ -6701,7 +6374,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -6720,7 +6394,7 @@
function TJclWideStrWideStrHashMap.Remove(const Key: WideString): WideString;
var
Bucket: TJclWideStrWideStrBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -6741,7 +6415,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -7042,24 +6719,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclSingleIntfHashMap.GrowEntries(Bucket: TJclSingleIntfBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclSingleIntfHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -7224,27 +6884,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclSingleIntfHashMap.PackEntries(Bucket: TJclSingleIntfBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclSingleIntfHashMap.PutAll(const AMap: IJclSingleIntfMap);
var
It: IJclSingleIterator;
@@ -7301,7 +6940,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -7320,7 +6960,7 @@
function TJclSingleIntfHashMap.Remove(const Key: Single): IInterface;
var
Bucket: TJclSingleIntfBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -7341,7 +6981,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -7642,23 +7285,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfSingleHashMap.GrowEntries(Bucket: TJclIntfSingleBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclIntfSingleHashMap.Hash(const AInterface: IInterface): Integer;
begin
Result := Integer(AInterface);
@@ -7828,27 +7454,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfSingleHashMap.PackEntries(Bucket: TJclIntfSingleBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclIntfSingleHashMap.PutAll(const AMap: IJclIntfSingleMap);
var
It: IJclIntfIterator;
@@ -7905,7 +7510,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -7924,7 +7530,7 @@
function TJclIntfSingleHashMap.Remove(const Key: IInterface): Single;
var
Bucket: TJclIntfSingleBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -7945,7 +7551,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -8246,24 +7855,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclSingleSingleHashMap.GrowEntries(Bucket: TJclSingleSingleBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclSingleSingleHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -8428,27 +8020,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclSingleSingleHashMap.PackEntries(Bucket: TJclSingleSingleBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclSingleSingleHashMap.PutAll(const AMap: IJclSingleSingleMap);
var
It: IJclSingleIterator;
@@ -8505,7 +8076,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -8524,7 +8096,7 @@
function TJclSingleSingleHashMap.Remove(const Key: Single): Single;
var
Bucket: TJclSingleSingleBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -8545,7 +8117,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -8846,24 +8421,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclDoubleIntfHashMap.GrowEntries(Bucket: TJclDoubleIntfBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclDoubleIntfHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -9028,27 +8586,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclDoubleIntfHashMap.PackEntries(Bucket: TJclDoubleIntfBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclDoubleIntfHashMap.PutAll(const AMap: IJclDoubleIntfMap);
var
It: IJclDoubleIterator;
@@ -9105,7 +8642,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -9124,7 +8662,7 @@
function TJclDoubleIntfHashMap.Remove(const Key: Double): IInterface;
var
Bucket: TJclDoubleIntfBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -9145,7 +8683,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -9446,23 +8987,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfDoubleHashMap.GrowEntries(Bucket: TJclIntfDoubleBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclIntfDoubleHashMap.Hash(const AInterface: IInterface): Integer;
begin
Result := Integer(AInterface);
@@ -9632,27 +9156,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfDoubleHashMap.PackEntries(Bucket: TJclIntfDoubleBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclIntfDoubleHashMap.PutAll(const AMap: IJclIntfDoubleMap);
var
It: IJclIntfIterator;
@@ -9709,7 +9212,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -9728,7 +9232,7 @@
function TJclIntfDoubleHashMap.Remove(const Key: IInterface): Double;
var
Bucket: TJclIntfDoubleBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -9749,7 +9253,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -10050,24 +9557,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclDoubleDoubleHashMap.GrowEntries(Bucket: TJclDoubleDoubleBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclDoubleDoubleHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -10232,27 +9722,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclDoubleDoubleHashMap.PackEntries(Bucket: TJclDoubleDoubleBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclDoubleDoubleHashMap.PutAll(const AMap: IJclDoubleDoubleMap);
var
It: IJclDoubleIterator;
@@ -10309,7 +9778,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -10328,7 +9798,7 @@
function TJclDoubleDoubleHashMap.Remove(const Key: Double): Double;
var
Bucket: TJclDoubleDoubleBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -10349,7 +9819,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -10650,24 +10123,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclExtendedIntfHashMap.GrowEntries(Bucket: TJclExtendedIntfBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclExtendedIntfHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -10832,27 +10288,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclExtendedIntfHashMap.PackEntries(Bucket: TJclExtendedIntfBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclExtendedIntfHashMap.PutAll(const AMap: IJclExtendedIntfMap);
var
It: IJclExtendedIterator;
@@ -10909,7 +10344,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -10928,7 +10364,7 @@
function TJclExtendedIntfHashMap.Remove(const Key: Extended): IInterface;
var
Bucket: TJclExtendedIntfBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -10949,7 +10385,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -11250,23 +10689,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfExtendedHashMap.GrowEntries(Bucket: TJclIntfExtendedBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclIntfExtendedHashMap.Hash(const AInterface: IInterface): Integer;
begin
Result := Integer(AInterface);
@@ -11436,27 +10858,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclIntfExtendedHashMap.PackEntries(Bucket: TJclIntfExtendedBucket);
-var
- Decrement, BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoPackStrategy of
- apsDisabled:
- Decrement := 0;
- apsAgressive:
- Decrement := 1;
- apsProportional:
- Decrement := BucketCapacity div FAutoPackParameter;
- apsIncremental:
- Decrement := FAutoPackParameter;
- else
- Decrement := 0;
- end;
- if (Decrement > 0) and ((Bucket.Size + Decrement) <= BucketCapacity) then
- SetLength(Bucket.Entries, Bucket.Size);
-end;
-
procedure TJclIntfExtendedHashMap.PutAll(const AMap: IJclIntfExtendedMap);
var
It: IJclIntfIterator;
@@ -11513,7 +10914,8 @@
end;
if Bucket.Size = Length(Bucket.Entries) then
- GrowEntries(Bucket);
+ SetLength(Bucket.Entries, CalcGrowCapacity(Bucket.Size, Bucket.Size));
+
if Bucket.Size < Length(Bucket.Entries) then
begin
Bucket.Entries[Bucket.Size].Key := Key;
@@ -11532,7 +10934,7 @@
function TJclIntfExtendedHashMap.Remove(const Key: IInterface): Extended;
var
Bucket: TJclIntfExtendedBucket;
- I: Integer;
+ I, NewCapacity: Integer;
begin
{$IFDEF THREADSAFE}
WriteLock;
@@ -11553,7 +10955,10 @@
Dec(FSize);
Break;
end;
- PackEntries(Bucket);
+
+ NewCapacity := CalcPackCapacity(Length(Bucket.Entries), Bucket.Size);
+ if NewCapacity < Length(Bucket.Entries) then
+ SetLength(Bucket.Entries, NewCapacity);
end;
{$IFDEF THREADSAFE}
finally
@@ -11854,24 +11259,7 @@
{$ENDIF THREADSAFE}
end;
-procedure TJclExtendedExtendedHashMap.GrowEntries(Bucket: TJclExtendedExtendedBucket);
-var
- BucketCapacity: Integer;
-begin
- BucketCapacity := Length(Bucket.Entries);
- case FAutoGrowStrategy of
- agsDisabled: ;
- agsAgressive:
- Inc(BucketCapacity, 1);
- agsProportional:
- Inc(BucketCapacity, BucketCapacity div FAutoGrowParameter);
- agsIncremental:
- Inc(BucketCapacity, FAutoGrowParameter);
- end;
- SetLength(Bucket.Entries, BucketCapacity);
-end;
-
function TJclExtendedExtendedHashMap.IsEmpty: Boolean;
begin
Result := FSize = 0;
@@ -12036,27 +11424,6 @@
{$ENDIF THREADSAFE}
end;
-procedure TJcl...
[truncated message content] |
|
From: <ou...@us...> - 2007-11-22 18:02:04
|
Revision: 2230
http://jcl.svn.sourceforge.net/jcl/?rev=2230&view=rev
Author: outchy
Date: 2007-11-22 10:02:00 -0800 (Thu, 22 Nov 2007)
Log Message:
-----------
introducing binary tree iterators
Modified Paths:
--------------
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/prototypes/JclBinaryTrees.pas
trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
Modified: trunk/jcl/source/common/JclBinaryTrees.pas
===================================================================
--- trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-22 08:50:37 UTC (rev 2229)
+++ trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-22 18:02:00 UTC (rev 2230)
@@ -787,7 +787,7 @@
//=== { TIntfItr } ===========================================================
type
- TIntfItr = class(TJclAbstractIterator, IJclIntfIterator, IJclIntfTreeIterator)
+ TIntfItr = class(TJclAbstractIterator, IJclIntfIterator, IJclIntfTreeIterator, IJclIntfBinaryTreeIterator)
protected
FCursor: TJclIntfBinaryNode;
FOwnList: IJclIntfCollection;
@@ -812,12 +812,22 @@
property Current: IInterface read GetObject;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfTreeIterator }
+ function AddChild(const AInterface: IInterface): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): IInterface;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AInterface: IInterface): Integer;
+ function InsertChild(Index: Integer; const AInterface: IInterface): Boolean;
function Parent: IInterface;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): IInterface;
- function IndexOfChild(const AInterface: IInterface): Integer;
+ procedure SetChild(Index: Integer; const AInterface: IInterface);
+ { IJclIntfBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: IInterface;
+ function Right: IInterface;
public
constructor Create(const OwnList: IJclIntfCollection; Start: TJclIntfBinaryNode; AValid: Boolean);
end;
@@ -835,6 +845,11 @@
Result := FOwnList.Add(AInterface);
end;
+function TIntfItr.AddChild(const AInterface: IInterface): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TIntfItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TIntfItr;
@@ -849,7 +864,7 @@
end;
end;
-function TIntfItr.ChildCount: Integer;
+function TIntfItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -870,6 +885,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TIntfItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TIntfItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TIntfItr.GetChild(Index: Integer): IInterface;
begin
{$IFDEF THREADSAFE}
@@ -939,6 +964,20 @@
{$ENDIF THREADSAFE}
end;
+function TIntfItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntfItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -987,6 +1026,20 @@
{$ENDIF THREADSAFE}
end;
+function TIntfItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntfItr.IndexOfChild(const AInterface: IInterface): Integer;
begin
{$IFDEF THREADSAFE}
@@ -1020,6 +1073,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TIntfItr.InsertChild(Index: Integer; const AInterface: IInterface): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TIntfItr.Left: IInterface;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TIntfItr.MoveNext: Boolean;
begin
@@ -1145,6 +1224,32 @@
{$ENDIF THREADSAFE}
end;
+function TIntfItr.Right: IInterface;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TIntfItr.SetChild(Index: Integer; const AInterface: IInterface);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TIntfItr.SetObject(const AInterface: IInterface);
begin
raise EJclOperationNotSupportedError.Create;
@@ -1354,7 +1459,7 @@
//=== { TAnsiStrItr } ===========================================================
type
- TAnsiStrItr = class(TJclAbstractIterator, IJclAnsiStrIterator, IJclAnsiStrTreeIterator)
+ TAnsiStrItr = class(TJclAbstractIterator, IJclAnsiStrIterator, IJclAnsiStrTreeIterator, IJclAnsiStrBinaryTreeIterator)
protected
FCursor: TJclAnsiStrBinaryNode;
FOwnList: IJclAnsiStrCollection;
@@ -1379,12 +1484,22 @@
property Current: AnsiString read GetString;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrTreeIterator }
+ function AddChild(const AString: AnsiString): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): AnsiString;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AString: AnsiString): Integer;
+ function InsertChild(Index: Integer; const AString: AnsiString): Boolean;
function Parent: AnsiString;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): AnsiString;
- function IndexOfChild(const AString: AnsiString): Integer;
+ procedure SetChild(Index: Integer; const AString: AnsiString);
+ { IJclAnsiStrBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: AnsiString;
+ function Right: AnsiString;
public
constructor Create(const OwnList: IJclAnsiStrCollection; Start: TJclAnsiStrBinaryNode; AValid: Boolean);
end;
@@ -1402,6 +1517,11 @@
Result := FOwnList.Add(AString);
end;
+function TAnsiStrItr.AddChild(const AString: AnsiString): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TAnsiStrItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TAnsiStrItr;
@@ -1416,7 +1536,7 @@
end;
end;
-function TAnsiStrItr.ChildCount: Integer;
+function TAnsiStrItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -1437,6 +1557,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TAnsiStrItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TAnsiStrItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TAnsiStrItr.GetChild(Index: Integer): AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -1506,6 +1636,20 @@
{$ENDIF THREADSAFE}
end;
+function TAnsiStrItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TAnsiStrItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -1554,6 +1698,20 @@
{$ENDIF THREADSAFE}
end;
+function TAnsiStrItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TAnsiStrItr.IndexOfChild(const AString: AnsiString): Integer;
begin
{$IFDEF THREADSAFE}
@@ -1587,6 +1745,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TAnsiStrItr.InsertChild(Index: Integer; const AString: AnsiString): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TAnsiStrItr.Left: AnsiString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TAnsiStrItr.MoveNext: Boolean;
begin
@@ -1712,6 +1896,32 @@
{$ENDIF THREADSAFE}
end;
+function TAnsiStrItr.Right: AnsiString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TAnsiStrItr.SetChild(Index: Integer; const AString: AnsiString);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TAnsiStrItr.SetString(const AString: AnsiString);
begin
raise EJclOperationNotSupportedError.Create;
@@ -1921,7 +2131,7 @@
//=== { TWideStrItr } ===========================================================
type
- TWideStrItr = class(TJclAbstractIterator, IJclWideStrIterator, IJclWideStrTreeIterator)
+ TWideStrItr = class(TJclAbstractIterator, IJclWideStrIterator, IJclWideStrTreeIterator, IJclWideStrBinaryTreeIterator)
protected
FCursor: TJclWideStrBinaryNode;
FOwnList: IJclWideStrCollection;
@@ -1946,12 +2156,22 @@
property Current: WideString read GetString;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrTreeIterator }
+ function AddChild(const AString: WideString): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): WideString;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AString: WideString): Integer;
+ function InsertChild(Index: Integer; const AString: WideString): Boolean;
function Parent: WideString;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): WideString;
- function IndexOfChild(const AString: WideString): Integer;
+ procedure SetChild(Index: Integer; const AString: WideString);
+ { IJclWideStrBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: WideString;
+ function Right: WideString;
public
constructor Create(const OwnList: IJclWideStrCollection; Start: TJclWideStrBinaryNode; AValid: Boolean);
end;
@@ -1969,6 +2189,11 @@
Result := FOwnList.Add(AString);
end;
+function TWideStrItr.AddChild(const AString: WideString): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TWideStrItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TWideStrItr;
@@ -1983,7 +2208,7 @@
end;
end;
-function TWideStrItr.ChildCount: Integer;
+function TWideStrItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -2004,6 +2229,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TWideStrItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TWideStrItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TWideStrItr.GetChild(Index: Integer): WideString;
begin
{$IFDEF THREADSAFE}
@@ -2073,6 +2308,20 @@
{$ENDIF THREADSAFE}
end;
+function TWideStrItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TWideStrItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2121,6 +2370,20 @@
{$ENDIF THREADSAFE}
end;
+function TWideStrItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TWideStrItr.IndexOfChild(const AString: WideString): Integer;
begin
{$IFDEF THREADSAFE}
@@ -2154,6 +2417,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TWideStrItr.InsertChild(Index: Integer; const AString: WideString): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TWideStrItr.Left: WideString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TWideStrItr.MoveNext: Boolean;
begin
@@ -2279,6 +2568,32 @@
{$ENDIF THREADSAFE}
end;
+function TWideStrItr.Right: WideString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TWideStrItr.SetChild(Index: Integer; const AString: WideString);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TWideStrItr.SetString(const AString: WideString);
begin
raise EJclOperationNotSupportedError.Create;
@@ -2488,7 +2803,7 @@
//=== { TSingleItr } ===========================================================
type
- TSingleItr = class(TJclAbstractIterator, IJclSingleIterator, IJclSingleTreeIterator)
+ TSingleItr = class(TJclAbstractIterator, IJclSingleIterator, IJclSingleTreeIterator, IJclSingleBinaryTreeIterator)
protected
FCursor: TJclSingleBinaryNode;
FOwnList: IJclSingleCollection;
@@ -2513,12 +2828,22 @@
property Current: Single read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclSingleTreeIterator }
+ function AddChild(const AValue: Single): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Single;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AValue: Single): Integer;
+ function InsertChild(Index: Integer; const AValue: Single): Boolean;
function Parent: Single;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Single;
- function IndexOfChild(const AValue: Single): Integer;
+ procedure SetChild(Index: Integer; const AValue: Single);
+ { IJclSingleBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: Single;
+ function Right: Single;
public
constructor Create(const OwnList: IJclSingleCollection; Start: TJclSingleBinaryNode; AValid: Boolean);
end;
@@ -2536,6 +2861,11 @@
Result := FOwnList.Add(AValue);
end;
+function TSingleItr.AddChild(const AValue: Single): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TSingleItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TSingleItr;
@@ -2550,7 +2880,7 @@
end;
end;
-function TSingleItr.ChildCount: Integer;
+function TSingleItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -2571,6 +2901,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TSingleItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TSingleItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TSingleItr.GetChild(Index: Integer): Single;
begin
{$IFDEF THREADSAFE}
@@ -2640,6 +2980,20 @@
{$ENDIF THREADSAFE}
end;
+function TSingleItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TSingleItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2688,6 +3042,20 @@
{$ENDIF THREADSAFE}
end;
+function TSingleItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TSingleItr.IndexOfChild(const AValue: Single): Integer;
begin
{$IFDEF THREADSAFE}
@@ -2721,6 +3089,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TSingleItr.InsertChild(Index: Integer; const AValue: Single): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TSingleItr.Left: Single;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TSingleItr.MoveNext: Boolean;
begin
@@ -2846,6 +3240,32 @@
{$ENDIF THREADSAFE}
end;
+function TSingleItr.Right: Single;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TSingleItr.SetChild(Index: Integer; const AValue: Single);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TSingleItr.SetValue(const AValue: Single);
begin
raise EJclOperationNotSupportedError.Create;
@@ -3055,7 +3475,7 @@
//=== { TDoubleItr } ===========================================================
type
- TDoubleItr = class(TJclAbstractIterator, IJclDoubleIterator, IJclDoubleTreeIterator)
+ TDoubleItr = class(TJclAbstractIterator, IJclDoubleIterator, IJclDoubleTreeIterator, IJclDoubleBinaryTreeIterator)
protected
FCursor: TJclDoubleBinaryNode;
FOwnList: IJclDoubleCollection;
@@ -3080,12 +3500,22 @@
property Current: Double read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclDoubleTreeIterator }
+ function AddChild(const AValue: Double): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Double;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AValue: Double): Integer;
+ function InsertChild(Index: Integer; const AValue: Double): Boolean;
function Parent: Double;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Double;
- function IndexOfChild(const AValue: Double): Integer;
+ procedure SetChild(Index: Integer; const AValue: Double);
+ { IJclDoubleBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: Double;
+ function Right: Double;
public
constructor Create(const OwnList: IJclDoubleCollection; Start: TJclDoubleBinaryNode; AValid: Boolean);
end;
@@ -3103,6 +3533,11 @@
Result := FOwnList.Add(AValue);
end;
+function TDoubleItr.AddChild(const AValue: Double): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TDoubleItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TDoubleItr;
@@ -3117,7 +3552,7 @@
end;
end;
-function TDoubleItr.ChildCount: Integer;
+function TDoubleItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -3138,6 +3573,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TDoubleItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TDoubleItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TDoubleItr.GetChild(Index: Integer): Double;
begin
{$IFDEF THREADSAFE}
@@ -3207,6 +3652,20 @@
{$ENDIF THREADSAFE}
end;
+function TDoubleItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TDoubleItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -3255,6 +3714,20 @@
{$ENDIF THREADSAFE}
end;
+function TDoubleItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TDoubleItr.IndexOfChild(const AValue: Double): Integer;
begin
{$IFDEF THREADSAFE}
@@ -3288,6 +3761,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TDoubleItr.InsertChild(Index: Integer; const AValue: Double): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TDoubleItr.Left: Double;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TDoubleItr.MoveNext: Boolean;
begin
@@ -3413,6 +3912,32 @@
{$ENDIF THREADSAFE}
end;
+function TDoubleItr.Right: Double;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TDoubleItr.SetChild(Index: Integer; const AValue: Double);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TDoubleItr.SetValue(const AValue: Double);
begin
raise EJclOperationNotSupportedError.Create;
@@ -3622,7 +4147,7 @@
//=== { TExtendedItr } ===========================================================
type
- TExtendedItr = class(TJclAbstractIterator, IJclExtendedIterator, IJclExtendedTreeIterator)
+ TExtendedItr = class(TJclAbstractIterator, IJclExtendedIterator, IJclExtendedTreeIterator, IJclExtendedBinaryTreeIterator)
protected
FCursor: TJclExtendedBinaryNode;
FOwnList: IJclExtendedCollection;
@@ -3647,12 +4172,22 @@
property Current: Extended read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclExtendedTreeIterator }
+ function AddChild(const AValue: Extended): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Extended;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AValue: Extended): Integer;
+ function InsertChild(Index: Integer; const AValue: Extended): Boolean;
function Parent: Extended;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Extended;
- function IndexOfChild(const AValue: Extended): Integer;
+ procedure SetChild(Index: Integer; const AValue: Extended);
+ { IJclExtendedBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: Extended;
+ function Right: Extended;
public
constructor Create(const OwnList: IJclExtendedCollection; Start: TJclExtendedBinaryNode; AValid: Boolean);
end;
@@ -3670,6 +4205,11 @@
Result := FOwnList.Add(AValue);
end;
+function TExtendedItr.AddChild(const AValue: Extended): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TExtendedItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TExtendedItr;
@@ -3684,7 +4224,7 @@
end;
end;
-function TExtendedItr.ChildCount: Integer;
+function TExtendedItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -3705,6 +4245,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TExtendedItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TExtendedItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TExtendedItr.GetChild(Index: Integer): Extended;
begin
{$IFDEF THREADSAFE}
@@ -3774,6 +4324,20 @@
{$ENDIF THREADSAFE}
end;
+function TExtendedItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TExtendedItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -3822,6 +4386,20 @@
{$ENDIF THREADSAFE}
end;
+function TExtendedItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TExtendedItr.IndexOfChild(const AValue: Extended): Integer;
begin
{$IFDEF THREADSAFE}
@@ -3855,6 +4433,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TExtendedItr.InsertChild(Index: Integer; const AValue: Extended): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TExtendedItr.Left: Extended;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TExtendedItr.MoveNext: Boolean;
begin
@@ -3980,6 +4584,32 @@
{$ENDIF THREADSAFE}
end;
+function TExtendedItr.Right: Extended;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TExtendedItr.SetChild(Index: Integer; const AValue: Extended);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TExtendedItr.SetValue(const AValue: Extended);
begin
raise EJclOperationNotSupportedError.Create;
@@ -4189,7 +4819,7 @@
//=== { TIntegerItr } ===========================================================
type
- TIntegerItr = class(TJclAbstractIterator, IJclIntegerIterator, IJclIntegerTreeIterator)
+ TIntegerItr = class(TJclAbstractIterator, IJclIntegerIterator, IJclIntegerTreeIterator, IJclIntegerBinaryTreeIterator)
protected
FCursor: TJclIntegerBinaryNode;
FOwnList: IJclIntegerCollection;
@@ -4214,12 +4844,22 @@
property Current: Integer read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclIntegerTreeIterator }
+ function AddChild(AValue: Integer): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Integer;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(AValue: Integer): Integer;
+ function InsertChild(Index: Integer; AValue: Integer): Boolean;
function Parent: Integer;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Integer;
- function IndexOfChild(AValue: Integer): Integer;
+ procedure SetChild(Index: Integer; AValue: Integer);
+ { IJclIntegerBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: Integer;
+ function Right: Integer;
public
constructor Create(const OwnList: IJclIntegerCollection; Start: TJclIntegerBinaryNode; AValid: Boolean);
end;
@@ -4237,6 +4877,11 @@
Result := FOwnList.Add(AValue);
end;
+function TIntegerItr.AddChild(AValue: Integer): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TIntegerItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TIntegerItr;
@@ -4251,7 +4896,7 @@
end;
end;
-function TIntegerItr.ChildCount: Integer;
+function TIntegerItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -4272,6 +4917,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TIntegerItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TIntegerItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TIntegerItr.GetChild(Index: Integer): Integer;
begin
{$IFDEF THREADSAFE}
@@ -4341,6 +4996,20 @@
{$ENDIF THREADSAFE}
end;
+function TIntegerItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntegerItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -4389,6 +5058,20 @@
{$ENDIF THREADSAFE}
end;
+function TIntegerItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntegerItr.IndexOfChild(AValue: Integer): Integer;
begin
{$IFDEF THREADSAFE}
@@ -4422,6 +5105,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TIntegerItr.InsertChild(Index: Integer; AValue: Integer): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TIntegerItr.Left: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TIntegerItr.MoveNext: Boolean;
begin
@@ -4547,6 +5256,32 @@
{$ENDIF THREADSAFE}
end;
+function TIntegerItr.Right: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TIntegerItr.SetChild(Index: Integer; AValue: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TIntegerItr.SetValue(AValue: Integer);
begin
raise EJclOperationNotSupportedError.Create;
@@ -4756,7 +5491,7 @@
//=== { TCardinalItr } ===========================================================
type
- TCardinalItr = class(TJclAbstractIterator, IJclCardinalIterator, IJclCardinalTreeIterator)
+ TCardinalItr = class(TJclAbstractIterator, IJclCardinalIterator, IJclCardinalTreeIterator, IJclCardinalBinaryTreeIterator)
protected
FCursor: TJclCardinalBinaryNode;
FOwnList: IJclCardinalCollection;
@@ -4781,12 +5516,22 @@
property Current: Cardinal read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclCardinalTreeIterator }
+ function AddChild(AValue: Cardinal): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Cardinal;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(AValue: Cardinal): Integer;
+ function InsertChild(Index: Integer; AValue: Cardinal): Boolean;
function Parent: Cardinal;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Cardinal;
- function IndexOfChild(AValue: Cardinal): Integer;
+ procedure SetChild(Index: Integer; AValue: Cardinal);
+ { IJclCardinalBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: Cardinal;
+ function Right: Cardinal;
public
constructor Create(const OwnList: IJclCardinalCollection; Start: TJclCardinalBinaryNode; AValid: Boolean);
end;
@@ -4804,6 +5549,11 @@
Result := FOwnList.Add(AValue);
end;
+function TCardinalItr.AddChild(AValue: Cardinal): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TCardinalItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TCardinalItr;
@@ -4818,7 +5568,7 @@
end;
end;
-function TCardinalItr.ChildCount: Integer;
+function TCardinalItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -4839,6 +5589,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TCardinalItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TCardinalItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TCardinalItr.GetChild(Index: Integer): Cardinal;
begin
{$IFDEF THREADSAFE}
@@ -4908,6 +5668,20 @@
{$ENDIF THREADSAFE}
end;
+function TCardinalItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TCardinalItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -4956,6 +5730,20 @@
{$ENDIF THREADSAFE}
end;
+function TCardinalItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TCardinalItr.IndexOfChild(AValue: Cardinal): Integer;
begin
{$IFDEF THREADSAFE}
@@ -4989,6 +5777,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TCardinalItr.InsertChild(Index: Integer; AValue: Cardinal): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TCardinalItr.Left: Cardinal;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TCardinalItr.MoveNext: Boolean;
begin
@@ -5114,6 +5928,32 @@
{$ENDIF THREADSAFE}
end;
+function TCardinalItr.Right: Cardinal;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TCardinalItr.SetChild(Index: Integer; AValue: Cardinal);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TCardinalItr.SetValue(AValue: Cardinal);
begin
raise EJclOperationNotSupportedError.Create;
@@ -5323,7 +6163,7 @@
//=== { TInt64Itr } ===========================================================
type
- TInt64Itr = class(TJclAbstractIterator, IJclInt64Iterator, IJclInt64TreeIterator)
+ TInt64Itr = class(TJclAbstractIterator, IJclInt64Iterator, IJclInt64TreeIterator, IJclInt64BinaryTreeIterator)
protected
FCursor: TJclInt64BinaryNode;
FOwnList: IJclInt64Collection;
@@ -5348,12 +6188,22 @@
property Current: Int64 read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclInt64TreeIterator }
+ function AddChild(const AValue: Int64): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Int64;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AValue: Int64): Integer;
+ function InsertChild(Index: Integer; const AValue: Int64): Boolean;
function Parent: Int64;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Int64;
- function IndexOfChild(const AValue: Int64): Integer;
+ procedure SetChild(Index: Integer; const AValue: Int64);
+ { IJclInt64BinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: Int64;
+ function Right: Int64;
public
constructor Create(const OwnList: IJclInt64Collection; Start: TJclInt64BinaryNode; AValid: Boolean);
end;
@@ -5371,6 +6221,11 @@
Result := FOwnList.Add(AValue);
end;
+function TInt64Itr.AddChild(const AValue: Int64): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TInt64Itr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TInt64Itr;
@@ -5385,7 +6240,7 @@
end;
end;
-function TInt64Itr.ChildCount: Integer;
+function TInt64Itr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -5406,6 +6261,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TInt64Itr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TInt64Itr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TInt64Itr.GetChild(Index: Integer): Int64;
begin
{$IFDEF THREADSAFE}
@@ -5475,6 +6340,20 @@
{$ENDIF THREADSAFE}
end;
+function TInt64Itr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TInt64Itr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -5523,6 +6402,20 @@
{$ENDIF THREADSAFE}
end;
+function TInt64Itr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TInt64Itr.IndexOfChild(const AValue: Int64): Integer;
begin
{$IFDEF THREADSAFE}
@@ -5556,6 +6449,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TInt64Itr.InsertChild(Index: Integer; const AValue: Int64): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TInt64Itr.Left: Int64;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TInt64Itr.MoveNext: Boolean;
begin
@@ -5681,6 +6600,32 @@
{$ENDIF THREADSAFE}
end;
+function TInt64Itr.Right: Int64;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TInt64Itr.SetChild(Index: Integer; const AValue: Int64);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TInt64Itr.SetValue(const AValue: Int64);
begin
raise EJclOperationNotSupportedError.Create;
@@ -5891,7 +6836,7 @@
//=== { TPtrItr } ===========================================================
type
- TPtrItr = class(TJclAbstractIterator, IJclPtrIterator, IJclPtrTreeIterator)
+ TPtrItr = class(TJclAbstractIterator, IJclPtrIterator, IJclPtrTreeIterator, IJclPtrBinaryTreeIterator)
protected
FCursor: TJclPtrBinaryNode;
FOwnList: IJclPtrCollection;
@@ -5916,12 +6861,22 @@
property Current: Pointer read GetPtr;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclPtrTreeIterator }
+ function AddChild(APtr: Pointer): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Pointer;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(APtr: Pointer): Integer;
+ function InsertChild(Index: Integer; APtr: Pointer): Boolean;
function Parent: Pointer;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Pointer;
- function IndexOfChild(APtr: Pointer): Integer;
+ procedure SetChild(Index: Integer; APtr: Pointer);
+ { IJclPtrBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: Pointer;
+ function Right: Pointer;
public
constructor Create(const OwnList: IJclPtrCollection; Start: TJclPtrBinaryNode; AValid: Boolean);
end;
@@ -5939,6 +6894,11 @@
Result := FOwnList.Add(APtr);
end;
+function TPtrItr.AddChild(APtr: Pointer): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TPtrItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TPtrItr;
@@ -5953,7 +6913,7 @@
end;
end;
-function TPtrItr.ChildCount: Integer;
+function TPtrItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -5974,6 +6934,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TPtrItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TPtrItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TPtrItr.GetChild(Index: Integer): Pointer;
begin
{$IFDEF THREADSAFE}
@@ -6043,6 +7013,20 @@
{$ENDIF THREADSAFE}
end;
+function TPtrItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TPtrItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -6091,6 +7075,20 @@
{$ENDIF THREADSAFE}
end;
+function TPtrItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TPtrItr.IndexOfChild(APtr: Pointer): Integer;
begin
{$IFDEF THREADSAFE}
@@ -6124,6 +7122,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TPtrItr.InsertChild(Index: Integer; APtr: Pointer): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TPtrItr.Left: Pointer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TPtrItr.MoveNext: Boolean;
begin
@@ -6249,6 +7273,32 @@
{$ENDIF THREADSAFE}
end;
+function TPtrItr.Right: Pointer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TPtrItr.SetChild(Index: Integer; APtr: Pointer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TPtrItr.SetPtr(APtr: Pointer);
begin
raise EJclOperationNotSupportedError.Create;
@@ -6459,7 +7509,7 @@
//=== { TItr } ===========================================================
type
- TItr = class(TJclAbstractIterator, IJclIterator, IJclTreeIterator)
+ TItr = class(TJclAbstractIterator, IJclIterator, IJclTreeIterator, IJclBinaryTreeIterator)
protected
FCursor: TJclBinaryNode;
FOwnList: IJclCollection;
@@ -6484,12 +7534,22 @@
property Current: TObject read GetObject;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclTreeIterator }
+ function AddChild(AObject: TObject): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): TObject;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(AObject: TObject): Integer;
+ function InsertChild(Index: Integer; AObject: TObject): Boolean;
function Parent: TObject;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): TObject;
- function IndexOfChild(AObject: TObject): Integer;
+ procedure SetChild(Index: Integer; AObject: TObject);
+ { IJclBinaryTreeIterator }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: TObject;
+ function Right: TObject;
public
constructor Create(const OwnList: IJclCollection; Start: TJclBinaryNode; AValid: Boolean);
end;
@@ -6507,6 +7567,11 @@
Result := FOwnList.Add(AObject);
end;
+function TItr.AddChild(AObject: TObject): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TItr.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TItr;
@@ -6521,7 +7586,7 @@
end;
end;
-function TItr.ChildCount: Integer;
+function TItr.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -6542,6 +7607,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TItr.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TItr.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TItr.GetChild(Index: Integer): TObject;
begin
{$IFDEF THREADSAFE}
@@ -6611,6 +7686,20 @@
{$ENDIF THREADSAFE}
end;
+function TItr.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -6659,6 +7748,20 @@
{$ENDIF THREADSAFE}
end;
+function TItr.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TItr.IndexOfChild(AObject: TObject): Integer;
begin
{$IFDEF THREADSAFE}
@@ -6692,6 +7795,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TItr.InsertChild(Index: Integer; AObject: TObject): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TItr.Left: TObject;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TItr.MoveNext: Boolean;
begin
@@ -6817,6 +7946,32 @@
{$ENDIF THREADSAFE}
end;
+function TItr.Right: TObject;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TItr.SetChild(Index: Integer; AObject: TObject);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TItr.SetObject(AObject: TObject);
begin
raise EJclOperationNotSupportedError.Create;
@@ -7027,7 +8182,7 @@
//=== { TItr<T> } ===========================================================
type
- TItr<T> = class(TJclAbstractIterator, IJclIterator<T>, IJclTreeIterator<T>)
+ TItr<T> = class(TJclAbstractIterator, IJclIterator<T>, IJclTreeIterator<T>, IJclBinaryTreeIterator<T>)
protected
FCursor: TJclBinaryNode<T>;
FOwnList: IJclCollection<T>;
@@ -7052,12 +8207,22 @@
property Current: T read GetItem;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclTreeIterator<T> }
+ function AddChild(const AItem: T): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): T;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AItem: T): Integer;
+ function InsertChild(Index: Integer; const AItem: T): Boolean;
function Parent: T;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): T;
- function IndexOfChild(const AItem: T): Integer;
+ procedure SetChild(Index: Integer; const AItem: T);
+ { IJclBinaryTreeIterator<T> }
+ function HasLeft: Boolean;
+ function HasRight: Boolean;
+ function Left: T;
+ function Right: T;
public
constructor Create(const OwnList: IJclCollection<T>; Start: TJclBinaryNode<T>; AValid: Boolean);
end;
@@ -7075,6 +8240,11 @@
Result := FOwnList.Add(AItem);
end;
+function TItr<T>.AddChild(const AItem: T): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TItr<T>.AssignPropertiesTo(Dest: TJclAbstractIterator);
var
ADest: TItr<T>;
@@ -7089,7 +8259,7 @@
end;
end;
-function TItr<T>.ChildCount: Integer;
+function TItr<T>.ChildrenCount: Integer;
begin
{$IFDEF THREADSAFE}
ReadLock;
@@ -7110,6 +8280,16 @@
{$ENDIF THREADSAFE}
end;
+procedure TItr<T>.ClearChildren;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+procedure TItr<T>.DeleteChild(Index: Integer);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TItr<T>.GetChild(Index: Integer): T;
begin
{$IFDEF THREADSAFE}
@@ -7179,6 +8359,20 @@
{$ENDIF THREADSAFE}
end;
+function TItr<T>.HasLeft: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Left <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TItr<T>.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -7227,6 +8421,20 @@
{$ENDIF THREADSAFE}
end;
+function TItr<T>.HasRight: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Right <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TItr<T>.IndexOfChild(const AItem: T): Integer;
begin
{$IFDEF THREADSAFE}
@@ -7260,6 +8468,32 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TItr<T>.InsertChild(Index: Integer; const AItem: T): Boolean;
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
+function TItr<T>.Left: T;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := Default(T);
+ if FCursor <> nil then
+ FCursor := FCursor.Left;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
{$IFDEF SUPPORTS_FOR_IN}
function TItr<T>.MoveNext: Boolean;
begin
@@ -7385,6 +8619,32 @@
{$ENDIF THREADSAFE}
end;
+function TItr<T>.Right: T;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := Default(T);
+ if FCursor <> nil then
+ FCursor := FCursor.Right;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+procedure TItr<T>.SetChild(Index: Integer; const AItem: T);
+begin
+ raise EJclOperationNotSupportedError.Create;
+end;
+
procedure TItr<T>.SetItem(const AItem: T);
begin
raise EJclOperationNotSupportedError.Create;
Modified: trunk/jcl/source/common/JclContainerIntf.pas
===================================================================
--- trunk/jcl/source/common/JclContainerIntf.pas 2007-11-22 08:50:37 UTC (rev 2229)
+++ trunk/jcl/source/common/JclContainerIntf.pas 2007-11-22 18:02:00 UTC (rev 2230)
@@ -859,32 +859,50 @@
IJclIntfTreeIterator = interface(IJclIntfIterator)
['{C97379BF-C6A9-4A90-9D7A-152E9BAD314F}']
+ function AddChild(const AInterface: IInterface): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): IInterface;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AInterface: IInterface): Integer;
+ function InsertChild(Index: Integer; const AInterface: IInterface): Boolean;
function Parent: IInterface;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): IInterface;
- function IndexOfChild(const AInterface: IInterface): Integer;
+ procedure SetChild(Index: Integer; const AInterface: IInterface);
+ property Children[Index: Integer]: IInterface read GetChild write SetChild;
end;
IJclAnsiStrTreeIterator = interface(IJclAnsiStrIterator)
['{66BC5C76-758C-4E72-ABF1-EB02CF851C6D}']
+ function AddChild(const AString: AnsiString): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): AnsiString;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AString: AnsiString): Integer;
+ function InsertChild(Index: Integer; const AString: AnsiString): Boolean;
function Parent: AnsiString;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): AnsiString;
- function IndexOfChild(const AString: AnsiString): Integer;
+ procedure SetChild(Index: Integer; const AString: AnsiString);
+ property Children[Index: Integer]: AnsiString read GetChild write SetChild;
end;
IJclWideStrTreeIterator = interface(IJclWideStrIterator)
['{B3168A3B-5A90-4ABF-855F-3D2B3AB6EE7F}']
+ function AddChild(const AString: WideString): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): WideString;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AString: WideString): Integer;
+ function InsertChild(Index: Integer; const AString: WideString): Boolean;
function Parent: WideString;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): WideString;
- function IndexOfChild(const AString: WideString): Integer;
+ procedure SetChild(Index: Integer; const AString: WideString);
+ property Children[Index: Integer]: WideString read GetChild write SetChild;
end;
{$IFDEF CONTAINER_ANSISTR}
@@ -896,32 +914,50 @@
IJclSingleTreeIterator = interface(IJclSingleIterator)
['{17BFDE9D-DBF7-4DC8-AC74-919C717B4726}']
+ function AddChild(const AValue: Single): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Single;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AValue: Single): Integer;
+ function InsertChild(Index: Integer; const AValue: Single): Boolean;
function Parent: Single;
- function ChildCount: Integer;
- function HasChild(Index: Integer): Boolean;
- function GetChild(Index: Integer): Single;
- function IndexOfChild(const AValue: Single): Integer;
+ procedure SetChild(Index: Integer; const AValue: Single);
+ property Children[Index: Integer]: Single read GetChild write SetChild;
end;
IJclDoubleTreeIterator = interface(IJclDoubleIterator)
['{EB39B84E-D3C5-496E-A521-B8BF24579252}']
+ function AddChild(const AValue: Double): Boolean;
+ function ChildrenCount: Integer;
+ procedure ClearChildren;
+ procedure DeleteChild(Index: Integer);
+ function GetChild(Index: Integer): Double;
+ function HasChild(Index: Integer): Boolean;
function HasParent: Boolean;
+ function IndexOfChild(const AValue: Double): Integer;
+ function InsertChild(Index: Integer; const AValue: Double): Boolean;
function Parent: Double;
- function ChildCount: Int...
[truncated message content] |
|
From: <ou...@us...> - 2007-11-22 08:50:40
|
Revision: 2229
http://jcl.svn.sourceforge.net/jcl/?rev=2229&view=rev
Author: outchy
Date: 2007-11-22 00:50:37 -0800 (Thu, 22 Nov 2007)
Log Message:
-----------
Introducing tree iterators that can browse to Parent and indexed children.
Adding Root property to trees
Modified Paths:
--------------
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/prototypes/JclBinaryTrees.pas
trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
Modified: trunk/jcl/source/common/JclBinaryTrees.pas
===================================================================
--- trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-21 22:54:41 UTC (rev 2228)
+++ trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-22 08:50:37 UTC (rev 2229)
@@ -96,12 +96,15 @@
function GetEnumerator: IJclIntfIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfTree }
+ function GetRoot: IJclIntfTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TIntfCompare);
destructor Destroy; override;
+ property Root: IJclIntfTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
@@ -147,12 +150,15 @@
function GetEnumerator: IJclAnsiStrIterator; override;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrTree }
+ function GetRoot: IJclAnsiStrTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TAnsiStrCompare);
destructor Destroy; override;
+ property Root: IJclAnsiStrTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
@@ -198,12 +204,15 @@
function GetEnumerator: IJclWideStrIterator; override;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrTree }
+ function GetRoot: IJclWideStrTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TWideStrCompare);
destructor Destroy; override;
+ property Root: IJclWideStrTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
{$IFDEF CONTAINER_ANSISTR}
@@ -256,12 +265,15 @@
function GetEnumerator: IJclSingleIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclSingleTree }
+ function GetRoot: IJclSingleTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TSingleCompare);
destructor Destroy; override;
+ property Root: IJclSingleTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
@@ -307,12 +319,15 @@
function GetEnumerator: IJclDoubleIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclDoubleTree }
+ function GetRoot: IJclDoubleTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TDoubleCompare);
destructor Destroy; override;
+ property Root: IJclDoubleTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
@@ -358,12 +373,15 @@
function GetEnumerator: IJclExtendedIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclExtendedTree }
+ function GetRoot: IJclExtendedTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TExtendedCompare);
destructor Destroy; override;
+ property Root: IJclExtendedTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
{$IFDEF MATH_EXTENDED_PRECISION}
@@ -419,12 +437,15 @@
function GetEnumerator: IJclIntegerIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclIntegerTree }
+ function GetRoot: IJclIntegerTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TIntegerCompare);
destructor Destroy; override;
+ property Root: IJclIntegerTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
@@ -470,12 +491,15 @@
function GetEnumerator: IJclCardinalIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclCardinalTree }
+ function GetRoot: IJclCardinalTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TCardinalCompare);
destructor Destroy; override;
+ property Root: IJclCardinalTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
@@ -521,12 +545,15 @@
function GetEnumerator: IJclInt64Iterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclInt64Tree }
+ function GetRoot: IJclInt64TreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TInt64Compare);
destructor Destroy; override;
+ property Root: IJclInt64TreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
{$IFNDEF CLR}
@@ -573,12 +600,15 @@
function GetEnumerator: IJclPtrIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclPtrTree }
+ function GetRoot: IJclPtrTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TPtrCompare);
destructor Destroy; override;
+ property Root: IJclPtrTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
{$ENDIF ~CLR}
@@ -625,12 +655,15 @@
function GetEnumerator: IJclIterator;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclTree }
+ function GetRoot: IJclTreeIterator;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
function CreateEmptyContainer: TJclAbstractContainerBase; override;
public
constructor Create(ACompare: TCompare; AOwnsObjects: Boolean);
destructor Destroy; override;
+ property Root: IJclTreeIterator read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
{$IFDEF SUPPORTS_GENERICS}
@@ -677,11 +710,14 @@
function GetEnumerator: IJclIterator<T>;
{$ENDIF SUPPORTS_FOR_IN}
{ IJclTree<T> }
+ function GetRoot: IJclTreeIterator<T>;
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
public
constructor Create(AOwnsItems: Boolean);
destructor Destroy; override;
+ property Root: IJclTreeIterator<T> read GetRoot;
+ property TraverseOrder: TJclTraverseOrder read GetTraverseOrder write SetTraverseOrder;
end;
// E = External helper to compare items
@@ -751,7 +787,7 @@
//=== { TIntfItr } ===========================================================
type
- TIntfItr = class(TJclAbstractIterator, IJclIntfIterator)
+ TIntfItr = class(TJclAbstractIterator, IJclIntfIterator, IJclIntfTreeIterator)
protected
FCursor: TJclIntfBinaryNode;
FOwnList: IJclIntfCollection;
@@ -775,6 +811,13 @@
function MoveNext: Boolean;
property Current: IInterface read GetObject;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclIntfTreeIterator }
+ function HasParent: Boolean;
+ function Parent: IInterface;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): IInterface;
+ function IndexOfChild(const AInterface: IInterface): Integer;
public
constructor Create(const OwnList: IJclIntfCollection; Start: TJclIntfBinaryNode; AValid: Boolean);
end;
@@ -806,6 +849,56 @@
end;
end;
+function TIntfItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TIntfItr.GetChild(Index: Integer): IInterface;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntfItr.GetObject: IInterface;
begin
{$IFDEF THREADSAFE}
@@ -826,6 +919,26 @@
{$ENDIF THREADSAFE}
end;
+function TIntfItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntfItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -843,6 +956,20 @@
{$ENDIF THREADSAFE}
end;
+function TIntfItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntfItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -860,6 +987,34 @@
{$ENDIF THREADSAFE}
end;
+function TIntfItr.IndexOfChild(const AInterface: IInterface): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AInterface) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AInterface) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AInterface) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntfItr.Insert(const AInterface: IInterface): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -914,6 +1069,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TIntfItr.Parent: IInterface;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntfItr.Previous: IInterface;
begin
{$IFDEF THREADSAFE}
@@ -977,7 +1153,7 @@
//=== { TPreOrderIntfItr } ===================================================
type
- TPreOrderIntfItr = class(TIntfItr, IJclIntfIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderIntfItr = class(TIntfItr, IJclIntfIterator, IJclIntfTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1044,7 +1220,7 @@
//=== { TInOrderIntfItr } ====================================================
type
- TInOrderIntfItr = class(TIntfItr, IJclIntfIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderIntfItr = class(TIntfItr, IJclIntfIterator, IJclIntfTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1112,7 +1288,7 @@
//=== { TPostOrderIntfItr } ==================================================
type
- TPostOrderIntfItr = class(TIntfItr, IJclIntfIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderIntfItr = class(TIntfItr, IJclIntfIterator, IJclIntfTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1178,7 +1354,7 @@
//=== { TAnsiStrItr } ===========================================================
type
- TAnsiStrItr = class(TJclAbstractIterator, IJclAnsiStrIterator)
+ TAnsiStrItr = class(TJclAbstractIterator, IJclAnsiStrIterator, IJclAnsiStrTreeIterator)
protected
FCursor: TJclAnsiStrBinaryNode;
FOwnList: IJclAnsiStrCollection;
@@ -1202,6 +1378,13 @@
function MoveNext: Boolean;
property Current: AnsiString read GetString;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclAnsiStrTreeIterator }
+ function HasParent: Boolean;
+ function Parent: AnsiString;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): AnsiString;
+ function IndexOfChild(const AString: AnsiString): Integer;
public
constructor Create(const OwnList: IJclAnsiStrCollection; Start: TJclAnsiStrBinaryNode; AValid: Boolean);
end;
@@ -1233,6 +1416,56 @@
end;
end;
+function TAnsiStrItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TAnsiStrItr.GetChild(Index: Integer): AnsiString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TAnsiStrItr.GetString: AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -1253,6 +1486,26 @@
{$ENDIF THREADSAFE}
end;
+function TAnsiStrItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TAnsiStrItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -1270,6 +1523,20 @@
{$ENDIF THREADSAFE}
end;
+function TAnsiStrItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TAnsiStrItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -1287,6 +1554,34 @@
{$ENDIF THREADSAFE}
end;
+function TAnsiStrItr.IndexOfChild(const AString: AnsiString): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AString) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AString) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AString) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TAnsiStrItr.Insert(const AString: AnsiString): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -1341,6 +1636,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TAnsiStrItr.Parent: AnsiString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TAnsiStrItr.Previous: AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -1404,7 +1720,7 @@
//=== { TPreOrderAnsiStrItr } ===================================================
type
- TPreOrderAnsiStrItr = class(TAnsiStrItr, IJclAnsiStrIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderAnsiStrItr = class(TAnsiStrItr, IJclAnsiStrIterator, IJclAnsiStrTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1471,7 +1787,7 @@
//=== { TInOrderAnsiStrItr } ====================================================
type
- TInOrderAnsiStrItr = class(TAnsiStrItr, IJclAnsiStrIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderAnsiStrItr = class(TAnsiStrItr, IJclAnsiStrIterator, IJclAnsiStrTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1539,7 +1855,7 @@
//=== { TPostOrderAnsiStrItr } ==================================================
type
- TPostOrderAnsiStrItr = class(TAnsiStrItr, IJclAnsiStrIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderAnsiStrItr = class(TAnsiStrItr, IJclAnsiStrIterator, IJclAnsiStrTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1605,7 +1921,7 @@
//=== { TWideStrItr } ===========================================================
type
- TWideStrItr = class(TJclAbstractIterator, IJclWideStrIterator)
+ TWideStrItr = class(TJclAbstractIterator, IJclWideStrIterator, IJclWideStrTreeIterator)
protected
FCursor: TJclWideStrBinaryNode;
FOwnList: IJclWideStrCollection;
@@ -1629,6 +1945,13 @@
function MoveNext: Boolean;
property Current: WideString read GetString;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclWideStrTreeIterator }
+ function HasParent: Boolean;
+ function Parent: WideString;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): WideString;
+ function IndexOfChild(const AString: WideString): Integer;
public
constructor Create(const OwnList: IJclWideStrCollection; Start: TJclWideStrBinaryNode; AValid: Boolean);
end;
@@ -1660,6 +1983,56 @@
end;
end;
+function TWideStrItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TWideStrItr.GetChild(Index: Integer): WideString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TWideStrItr.GetString: WideString;
begin
{$IFDEF THREADSAFE}
@@ -1680,6 +2053,26 @@
{$ENDIF THREADSAFE}
end;
+function TWideStrItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TWideStrItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -1697,6 +2090,20 @@
{$ENDIF THREADSAFE}
end;
+function TWideStrItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TWideStrItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -1714,6 +2121,34 @@
{$ENDIF THREADSAFE}
end;
+function TWideStrItr.IndexOfChild(const AString: WideString): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AString) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AString) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AString) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TWideStrItr.Insert(const AString: WideString): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -1768,6 +2203,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TWideStrItr.Parent: WideString;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TWideStrItr.Previous: WideString;
begin
{$IFDEF THREADSAFE}
@@ -1831,7 +2287,7 @@
//=== { TPreOrderWideStrItr } ===================================================
type
- TPreOrderWideStrItr = class(TWideStrItr, IJclWideStrIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderWideStrItr = class(TWideStrItr, IJclWideStrIterator, IJclWideStrTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1898,7 +2354,7 @@
//=== { TInOrderWideStrItr } ====================================================
type
- TInOrderWideStrItr = class(TWideStrItr, IJclWideStrIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderWideStrItr = class(TWideStrItr, IJclWideStrIterator, IJclWideStrTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -1966,7 +2422,7 @@
//=== { TPostOrderWideStrItr } ==================================================
type
- TPostOrderWideStrItr = class(TWideStrItr, IJclWideStrIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderWideStrItr = class(TWideStrItr, IJclWideStrIterator, IJclWideStrTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -2032,7 +2488,7 @@
//=== { TSingleItr } ===========================================================
type
- TSingleItr = class(TJclAbstractIterator, IJclSingleIterator)
+ TSingleItr = class(TJclAbstractIterator, IJclSingleIterator, IJclSingleTreeIterator)
protected
FCursor: TJclSingleBinaryNode;
FOwnList: IJclSingleCollection;
@@ -2056,6 +2512,13 @@
function MoveNext: Boolean;
property Current: Single read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclSingleTreeIterator }
+ function HasParent: Boolean;
+ function Parent: Single;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): Single;
+ function IndexOfChild(const AValue: Single): Integer;
public
constructor Create(const OwnList: IJclSingleCollection; Start: TJclSingleBinaryNode; AValid: Boolean);
end;
@@ -2087,6 +2550,56 @@
end;
end;
+function TSingleItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TSingleItr.GetChild(Index: Integer): Single;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TSingleItr.GetValue: Single;
begin
{$IFDEF THREADSAFE}
@@ -2107,6 +2620,26 @@
{$ENDIF THREADSAFE}
end;
+function TSingleItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TSingleItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2124,6 +2657,20 @@
{$ENDIF THREADSAFE}
end;
+function TSingleItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TSingleItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2141,6 +2688,34 @@
{$ENDIF THREADSAFE}
end;
+function TSingleItr.IndexOfChild(const AValue: Single): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AValue) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TSingleItr.Insert(const AValue: Single): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -2195,6 +2770,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TSingleItr.Parent: Single;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TSingleItr.Previous: Single;
begin
{$IFDEF THREADSAFE}
@@ -2258,7 +2854,7 @@
//=== { TPreOrderSingleItr } ===================================================
type
- TPreOrderSingleItr = class(TSingleItr, IJclSingleIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderSingleItr = class(TSingleItr, IJclSingleIterator, IJclSingleTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -2325,7 +2921,7 @@
//=== { TInOrderSingleItr } ====================================================
type
- TInOrderSingleItr = class(TSingleItr, IJclSingleIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderSingleItr = class(TSingleItr, IJclSingleIterator, IJclSingleTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -2393,7 +2989,7 @@
//=== { TPostOrderSingleItr } ==================================================
type
- TPostOrderSingleItr = class(TSingleItr, IJclSingleIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderSingleItr = class(TSingleItr, IJclSingleIterator, IJclSingleTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -2459,7 +3055,7 @@
//=== { TDoubleItr } ===========================================================
type
- TDoubleItr = class(TJclAbstractIterator, IJclDoubleIterator)
+ TDoubleItr = class(TJclAbstractIterator, IJclDoubleIterator, IJclDoubleTreeIterator)
protected
FCursor: TJclDoubleBinaryNode;
FOwnList: IJclDoubleCollection;
@@ -2483,6 +3079,13 @@
function MoveNext: Boolean;
property Current: Double read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclDoubleTreeIterator }
+ function HasParent: Boolean;
+ function Parent: Double;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): Double;
+ function IndexOfChild(const AValue: Double): Integer;
public
constructor Create(const OwnList: IJclDoubleCollection; Start: TJclDoubleBinaryNode; AValid: Boolean);
end;
@@ -2514,6 +3117,56 @@
end;
end;
+function TDoubleItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TDoubleItr.GetChild(Index: Integer): Double;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TDoubleItr.GetValue: Double;
begin
{$IFDEF THREADSAFE}
@@ -2534,6 +3187,26 @@
{$ENDIF THREADSAFE}
end;
+function TDoubleItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TDoubleItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2551,6 +3224,20 @@
{$ENDIF THREADSAFE}
end;
+function TDoubleItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TDoubleItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2568,6 +3255,34 @@
{$ENDIF THREADSAFE}
end;
+function TDoubleItr.IndexOfChild(const AValue: Double): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AValue) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TDoubleItr.Insert(const AValue: Double): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -2622,6 +3337,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TDoubleItr.Parent: Double;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TDoubleItr.Previous: Double;
begin
{$IFDEF THREADSAFE}
@@ -2685,7 +3421,7 @@
//=== { TPreOrderDoubleItr } ===================================================
type
- TPreOrderDoubleItr = class(TDoubleItr, IJclDoubleIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderDoubleItr = class(TDoubleItr, IJclDoubleIterator, IJclDoubleTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -2752,7 +3488,7 @@
//=== { TInOrderDoubleItr } ====================================================
type
- TInOrderDoubleItr = class(TDoubleItr, IJclDoubleIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderDoubleItr = class(TDoubleItr, IJclDoubleIterator, IJclDoubleTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -2820,7 +3556,7 @@
//=== { TPostOrderDoubleItr } ==================================================
type
- TPostOrderDoubleItr = class(TDoubleItr, IJclDoubleIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderDoubleItr = class(TDoubleItr, IJclDoubleIterator, IJclDoubleTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -2886,7 +3622,7 @@
//=== { TExtendedItr } ===========================================================
type
- TExtendedItr = class(TJclAbstractIterator, IJclExtendedIterator)
+ TExtendedItr = class(TJclAbstractIterator, IJclExtendedIterator, IJclExtendedTreeIterator)
protected
FCursor: TJclExtendedBinaryNode;
FOwnList: IJclExtendedCollection;
@@ -2910,6 +3646,13 @@
function MoveNext: Boolean;
property Current: Extended read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclExtendedTreeIterator }
+ function HasParent: Boolean;
+ function Parent: Extended;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): Extended;
+ function IndexOfChild(const AValue: Extended): Integer;
public
constructor Create(const OwnList: IJclExtendedCollection; Start: TJclExtendedBinaryNode; AValid: Boolean);
end;
@@ -2941,6 +3684,56 @@
end;
end;
+function TExtendedItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TExtendedItr.GetChild(Index: Integer): Extended;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TExtendedItr.GetValue: Extended;
begin
{$IFDEF THREADSAFE}
@@ -2961,6 +3754,26 @@
{$ENDIF THREADSAFE}
end;
+function TExtendedItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TExtendedItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2978,6 +3791,20 @@
{$ENDIF THREADSAFE}
end;
+function TExtendedItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TExtendedItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -2995,6 +3822,34 @@
{$ENDIF THREADSAFE}
end;
+function TExtendedItr.IndexOfChild(const AValue: Extended): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AValue) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TExtendedItr.Insert(const AValue: Extended): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -3049,6 +3904,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TExtendedItr.Parent: Extended;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0.0;
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TExtendedItr.Previous: Extended;
begin
{$IFDEF THREADSAFE}
@@ -3112,7 +3988,7 @@
//=== { TPreOrderExtendedItr } ===================================================
type
- TPreOrderExtendedItr = class(TExtendedItr, IJclExtendedIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderExtendedItr = class(TExtendedItr, IJclExtendedIterator, IJclExtendedTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -3179,7 +4055,7 @@
//=== { TInOrderExtendedItr } ====================================================
type
- TInOrderExtendedItr = class(TExtendedItr, IJclExtendedIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderExtendedItr = class(TExtendedItr, IJclExtendedIterator, IJclExtendedTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -3247,7 +4123,7 @@
//=== { TPostOrderExtendedItr } ==================================================
type
- TPostOrderExtendedItr = class(TExtendedItr, IJclExtendedIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderExtendedItr = class(TExtendedItr, IJclExtendedIterator, IJclExtendedTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -3313,7 +4189,7 @@
//=== { TIntegerItr } ===========================================================
type
- TIntegerItr = class(TJclAbstractIterator, IJclIntegerIterator)
+ TIntegerItr = class(TJclAbstractIterator, IJclIntegerIterator, IJclIntegerTreeIterator)
protected
FCursor: TJclIntegerBinaryNode;
FOwnList: IJclIntegerCollection;
@@ -3337,6 +4213,13 @@
function MoveNext: Boolean;
property Current: Integer read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclIntegerTreeIterator }
+ function HasParent: Boolean;
+ function Parent: Integer;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): Integer;
+ function IndexOfChild(AValue: Integer): Integer;
public
constructor Create(const OwnList: IJclIntegerCollection; Start: TJclIntegerBinaryNode; AValid: Boolean);
end;
@@ -3368,6 +4251,56 @@
end;
end;
+function TIntegerItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TIntegerItr.GetChild(Index: Integer): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntegerItr.GetValue: Integer;
begin
{$IFDEF THREADSAFE}
@@ -3388,6 +4321,26 @@
{$ENDIF THREADSAFE}
end;
+function TIntegerItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntegerItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -3405,6 +4358,20 @@
{$ENDIF THREADSAFE}
end;
+function TIntegerItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntegerItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -3422,6 +4389,34 @@
{$ENDIF THREADSAFE}
end;
+function TIntegerItr.IndexOfChild(AValue: Integer): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AValue) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntegerItr.Insert(AValue: Integer): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -3476,6 +4471,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TIntegerItr.Parent: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TIntegerItr.Previous: Integer;
begin
{$IFDEF THREADSAFE}
@@ -3539,7 +4555,7 @@
//=== { TPreOrderIntegerItr } ===================================================
type
- TPreOrderIntegerItr = class(TIntegerItr, IJclIntegerIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderIntegerItr = class(TIntegerItr, IJclIntegerIterator, IJclIntegerTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -3606,7 +4622,7 @@
//=== { TInOrderIntegerItr } ====================================================
type
- TInOrderIntegerItr = class(TIntegerItr, IJclIntegerIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderIntegerItr = class(TIntegerItr, IJclIntegerIterator, IJclIntegerTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -3674,7 +4690,7 @@
//=== { TPostOrderIntegerItr } ==================================================
type
- TPostOrderIntegerItr = class(TIntegerItr, IJclIntegerIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderIntegerItr = class(TIntegerItr, IJclIntegerIterator, IJclIntegerTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -3740,7 +4756,7 @@
//=== { TCardinalItr } ===========================================================
type
- TCardinalItr = class(TJclAbstractIterator, IJclCardinalIterator)
+ TCardinalItr = class(TJclAbstractIterator, IJclCardinalIterator, IJclCardinalTreeIterator)
protected
FCursor: TJclCardinalBinaryNode;
FOwnList: IJclCardinalCollection;
@@ -3764,6 +4780,13 @@
function MoveNext: Boolean;
property Current: Cardinal read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclCardinalTreeIterator }
+ function HasParent: Boolean;
+ function Parent: Cardinal;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): Cardinal;
+ function IndexOfChild(AValue: Cardinal): Integer;
public
constructor Create(const OwnList: IJclCardinalCollection; Start: TJclCardinalBinaryNode; AValid: Boolean);
end;
@@ -3795,6 +4818,56 @@
end;
end;
+function TCardinalItr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TCardinalItr.GetChild(Index: Integer): Cardinal;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TCardinalItr.GetValue: Cardinal;
begin
{$IFDEF THREADSAFE}
@@ -3815,6 +4888,26 @@
{$ENDIF THREADSAFE}
end;
+function TCardinalItr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TCardinalItr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -3832,6 +4925,20 @@
{$ENDIF THREADSAFE}
end;
+function TCardinalItr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TCardinalItr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -3849,6 +4956,34 @@
{$ENDIF THREADSAFE}
end;
+function TCardinalItr.IndexOfChild(AValue: Cardinal): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AValue) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 1;
+ end
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 0;
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TCardinalItr.Insert(AValue: Cardinal): Boolean;
begin
raise EJclOperationNotSupportedError.Create;
@@ -3903,6 +5038,27 @@
raise EJclOperationNotSupportedError.Create;
end;
+function TCardinalItr.Parent: Cardinal;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ FCursor := FCursor.Parent;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TCardinalItr.Previous: Cardinal;
begin
{$IFDEF THREADSAFE}
@@ -3966,7 +5122,7 @@
//=== { TPreOrderCardinalItr } ===================================================
type
- TPreOrderCardinalItr = class(TCardinalItr, IJclCardinalIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPreOrderCardinalItr = class(TCardinalItr, IJclCardinalIterator, IJclCardinalTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -4033,7 +5189,7 @@
//=== { TInOrderCardinalItr } ====================================================
type
- TInOrderCardinalItr = class(TCardinalItr, IJclCardinalIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TInOrderCardinalItr = class(TCardinalItr, IJclCardinalIterator, IJclCardinalTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -4101,7 +5257,7 @@
//=== { TPostOrderCardinalItr } ==================================================
type
- TPostOrderCardinalItr = class(TCardinalItr, IJclCardinalIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ TPostOrderCardinalItr = class(TCardinalItr, IJclCardinalIterator, IJclCardinalTreeIterator, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclIntfCloneable, IJclCloneable)
protected
function CreateEmptyIterator: TJclAbstractIterator; override;
@@ -4167,7 +5323,7 @@
//=== { TInt64Itr } ===========================================================
type
- TInt64Itr = class(TJclAbstractIterator, IJclInt64Iterator)
+ TInt64Itr = class(TJclAbstractIterator, IJclInt64Iterator, IJclInt64TreeIterator)
protected
FCursor: TJclInt64BinaryNode;
FOwnList: IJclInt64Collection;
@@ -4191,6 +5347,13 @@
function MoveNext: Boolean;
property Current: Int64 read GetValue;
{$ENDIF SUPPORTS_FOR_IN}
+ { IJclInt64TreeIterator }
+ function HasParent: Boolean;
+ function Parent: Int64;
+ function ChildCount: Integer;
+ function HasChild(Index: Integer): Boolean;
+ function GetChild(Index: Integer): Int64;
+ function IndexOfChild(const AValue: Int64): Integer;
public
constructor Create(const OwnList: IJclInt64Collection; Start: TJclInt64BinaryNode; AValid: Boolean);
end;
@@ -4222,6 +5385,56 @@
end;
end;
+function TInt64Itr.ChildCount: Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ Inc(Result);
+ if FCursor.Right <> nil then
+ Inc(Result);
+ end;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
+function TInt64Itr.GetChild(Index: Integer): Int64;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := 0;
+ if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then
+ FCursor := FCursor.Left
+ else
+ if (FCursor <> nil) and (Index = 0) then
+ FCursor := FCursor.Right
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ FCursor := FCursor.Right
+ else
+ FCursor := nil;
+ if FCursor <> nil then
+ Result := FCursor.Value
+ else
+ if not FOwnList.ReturnDefaultElements then
+ raise EJclNoSuchElementError.Create('');
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TInt64Itr.GetValue: Int64;
begin
{$IFDEF THREADSAFE}
@@ -4242,6 +5455,26 @@
{$ENDIF THREADSAFE}
end;
+function TInt64Itr.HasChild(Index: Integer): Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (FCursor <> nil) and (Index = 0) then
+ Result := (FCursor.Left <> nil) or (FCursor.Right <> nil)
+ else
+ if (FCursor <> nil) and (Index = 1) then
+ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil)
+ else
+ Result := False;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TInt64Itr.HasNext: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -4259,6 +5492,20 @@
{$ENDIF THREADSAFE}
end;
+function TInt64Itr.HasParent: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := (FCursor <> nil) and (FCursor.Parent <> nil);
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TInt64Itr.HasPrevious: Boolean;
begin
{$IFDEF THREADSAFE}
@@ -4276,6 +5523,34 @@
{$ENDIF THREADSAFE}
end;
+function TInt64Itr.IndexOfChild(const AValue: Int64): Integer;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := -1;
+ if FCursor <> nil then
+ begin
+ if FCursor.Left <> nil then
+ begin
+ if FEqualityComparer.ItemsEqual(FCursor.Left.Value, AValue) then
+ Result := 0
+ else
+ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, AValue) then
+ Result := 1;
+ end
+ e...
[truncated message content] |
|
From: <ou...@us...> - 2007-11-21 22:54:43
|
Revision: 2228
http://jcl.svn.sourceforge.net/jcl/?rev=2228&view=rev
Author: outchy
Date: 2007-11-21 14:54:41 -0800 (Wed, 21 Nov 2007)
Log Message:
-----------
Some refactoring: functions from binary trees to customize item comparisons moved to abstract containers.
Modified Paths:
--------------
trunk/jcl/source/common/JclAbstractContainers.pas
trunk/jcl/source/common/JclAlgorithms.pas
trunk/jcl/source/common/JclArrayLists.pas
trunk/jcl/source/common/JclArraySets.pas
trunk/jcl/source/common/JclBase.pas
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/common/JclHashMaps.pas
trunk/jcl/source/common/JclHashSets.pas
trunk/jcl/source/common/JclLinkedLists.pas
trunk/jcl/source/common/JclQueues.pas
trunk/jcl/source/common/JclSortedMaps.pas
trunk/jcl/source/common/JclStacks.pas
trunk/jcl/source/common/JclVectors.pas
trunk/jcl/source/prototypes/JclArrayLists.pas
trunk/jcl/source/prototypes/JclArraySets.pas
trunk/jcl/source/prototypes/JclBinaryTrees.pas
trunk/jcl/source/prototypes/JclHashMaps.pas
trunk/jcl/source/prototypes/JclHashSets.pas
trunk/jcl/source/prototypes/JclLinkedLists.pas
trunk/jcl/source/prototypes/JclQueues.pas
trunk/jcl/source/prototypes/JclSortedMaps.pas
trunk/jcl/source/prototypes/JclStacks.pas
trunk/jcl/source/prototypes/JclVectors.pas
trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
Modified: trunk/jcl/source/common/JclAbstractContainers.pas
===================================================================
--- trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-20 18:35:10 UTC (rev 2227)
+++ trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-21 22:54:41 UTC (rev 2228)
@@ -138,6 +138,14 @@
procedure SetCapacity(Value: Integer); virtual;
public
constructor Create(const ALockDelegate: IInterface);
+ property AllowDefaultElements: Boolean read GetAllowDefaultElements write SetAllowDefaultElements;
+ property Duplicates: TDuplicates read GetDuplicates write SetDuplicates;
+ property RemoveSingleElement: Boolean read GetRemoveSingleElement write SetRemoveSingleElement;
+ property ReturnDefaultElements: Boolean read GetReturnDefaultElements write SetReturnDefaultElements;
+ property AutoGrowParameter: Integer read GetAutoGrowParameter write SetAutoGrowParameter;
+ property AutoGrowStrategy: TJclAutoGrowStrategy read GetAutoGrowStrategy write SetAutoGrowStrategy;
+ property AutoPackParameter: Integer read GetAutoPackParameter write SetAutoPackParameter;
+ property AutoPackStrategy: TJclAutoPackStrategy read GetAutoPackStrategy write SetAutoPackStrategy;
end;
TJclAbstractIterator = class(TJclAbstractLockable, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
@@ -163,15 +171,31 @@
end;
TJclIntfAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclCloneable, IJclIntfCloneable, IJclContainer, IJclIntfEqualityComparer, IJclIntfComparer)
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclIntfEqualityComparer, IJclIntfComparer, IJclIntfHashConverter)
protected
+ FEqualityCompare: TIntfEqualityCompare;
+ FCompare: TIntfCompare;
+ FHashConvert: TIntfHashConvert;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeObject(var AInterface: IInterface): IInterface;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIntfEqualityComparer }
- function ItemsEqual(const A, B: IInterface): Boolean;
+ function GetEqualityCompare: TIntfEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TIntfEqualityCompare); virtual;
+ function ItemsEqual(const A, B: IInterface): Boolean; virtual;
{ IJclIntfComparer }
- function ItemsCompare(const A, B: IInterface): Integer;
+ function GetCompare: TIntfCompare; virtual;
+ procedure SetCompare(Value: TIntfCompare); virtual;
+ function ItemsCompare(const A, B: IInterface): Integer; virtual;
+ { IJclIntfHashConverter }
+ function GetHashConvert: TIntfHashConvert; virtual;
+ procedure SetHashConvert(Value: TIntfHashConvert); virtual;
+ function Hash(const AInterface: IInterface): Integer; virtual;
+ public
+ property EqualityCompare: TIntfEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TIntfCompare read GetCompare write SetCompare;
+ property HashConvert: TIntfHashConvert read GetHashConvert write SetHashConvert;
end;
TJclStrAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
@@ -184,6 +208,8 @@
{ IJclStrContainer }
function GetCaseSensitive: Boolean; virtual;
procedure SetCaseSensitive(Value: Boolean); virtual;
+ public
+ property CaseSensitive: Boolean read GetCaseSensitive write SetCaseSensitive;
end;
TJclAnsiStrAbstractContainer = class(TJclStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
@@ -191,6 +217,9 @@
IJclAnsiStrEqualityComparer, IJclAnsiStrComparer, IJclAnsiStrHashConverter)
protected
FEncoding: TJclAnsiStrEncoding;
+ FEqualityCompare: TAnsiStrEqualityCompare;
+ FCompare: TAnsiStrCompare;
+ FHashConvert: TAnsiStrHashConvert;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeString(var AString: AnsiString): AnsiString;
{ IJclIntfCloneable }
@@ -199,11 +228,22 @@
function GetEncoding: TJclAnsiStrEncoding; virtual;
procedure SetEncoding(Value: TJclAnsiStrEncoding); virtual;
{ IJclAnsiStrEqualityComparer }
- function ItemsEqual(const A, B: AnsiString): Boolean;
+ function GetEqualityCompare: TAnsiStrEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TAnsiStrEqualityCompare); virtual;
+ function ItemsEqual(const A, B: AnsiString): Boolean; virtual;
{ IJclAnsiStrComparer }
- function ItemsCompare(const A, B: AnsiString): Integer;
+ function GetCompare: TAnsiStrCompare; virtual;
+ procedure SetCompare(Value: TAnsiStrCompare); virtual;
+ function ItemsCompare(const A, B: AnsiString): Integer; virtual;
{ IJclAnsiStrHashConverter }
- function Hash(const AString: AnsiString): Integer;
+ function GetHashConvert: TAnsiStrHashConvert; virtual;
+ procedure SetHashConvert(Value: TAnsiStrHashConvert); virtual;
+ function Hash(const AString: AnsiString): Integer; virtual;
+ public
+ property Encoding: TJclAnsiStrEncoding read GetEncoding write SetEncoding;
+ property EqualityCompare: TAnsiStrEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TAnsiStrCompare read GetCompare write SetCompare;
+ property HashConvert: TAnsiStrHashConvert read GetHashConvert write SetHashConvert;
end;
TJclWideStrAbstractContainer = class(TJclStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
@@ -211,6 +251,9 @@
IJclWideStrEqualityComparer, IJclWideStrComparer, IJclWideStrHashConverter)
protected
FEncoding: TJclWideStrEncoding;
+ FEqualityCompare: TWideStrEqualityCompare;
+ FCompare: TWideStrCompare;
+ FHashConvert: TWideStrHashConvert;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeString(var AString: WideString): WideString;
{ IJclIntfCloneable }
@@ -219,11 +262,22 @@
function GetEncoding: TJclWideStrEncoding; virtual;
procedure SetEncoding(Value: TJclWideStrEncoding); virtual;
{ IJclWideStrEqualityComparer }
- function ItemsEqual(const A, B: WideString): Boolean;
+ function GetEqualityCompare: TWideStrEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TWideStrEqualityCompare); virtual;
+ function ItemsEqual(const A, B: WideString): Boolean; virtual;
{ IJclWideStrComparer }
- function ItemsCompare(const A, B: WideString): Integer;
+ function GetCompare: TWideStrCompare; virtual;
+ procedure SetCompare(Value: TWideStrCompare); virtual;
+ function ItemsCompare(const A, B: WideString): Integer; virtual;
{ IJclWideStrHashConverter }
- function Hash(const AString: WideString): Integer;
+ function GetHashConvert: TWideStrHashConvert; virtual;
+ procedure SetHashConvert(Value: TWideStrHashConvert); virtual;
+ function Hash(const AString: WideString): Integer; virtual;
+ public
+ property Encoding: TJclWideStrEncoding read GetEncoding write SetEncoding;
+ property EqualityCompare: TWideStrEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TWideStrCompare read GetCompare write SetCompare;
+ property HashConvert: TWideStrHashConvert read GetHashConvert write SetHashConvert;
end;
TJclSingleAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
@@ -231,21 +285,33 @@
IJclSingleComparer, IJclSingleHashConverter)
protected
FPrecision: Single;
+ FEqualityCompare: TSingleEqualityCompare;
+ FCompare: TSingleCompare;
+ FHashConvert: TSingleHashConvert;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeSingle(var AValue: Single): Single;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclSingleEqualityComparer }
- function ItemsEqual(const A, B: Single): Boolean;
+ function GetEqualityCompare: TSingleEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TSingleEqualityCompare); virtual;
+ function ItemsEqual(const A, B: Single): Boolean; virtual;
{ IJclSingleComparer }
- function ItemsCompare(const A, B: Single): Integer;
+ function GetCompare: TSingleCompare; virtual;
+ procedure SetCompare(Value: TSingleCompare); virtual;
+ function ItemsCompare(const A, B: Single): Integer; virtual;
{ IJclSingleContainer }
function GetPrecision: Single; virtual;
procedure SetPrecision(const Value: Single); virtual;
{ IJclSingleHashConverter }
- function Hash(const AValue: Single): Integer;
+ function GetHashConvert: TSingleHashConvert; virtual;
+ procedure SetHashConvert(Value: TSingleHashConvert); virtual;
+ function Hash(const AValue: Single): Integer; virtual;
public
property Precision: Single read GetPrecision write SetPrecision;
+ property EqualityCompare: TSingleEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TSingleCompare read GetCompare write SetCompare;
+ property HashConvert: TSingleHashConvert read GetHashConvert write SetHashConvert;
end;
TJclDoubleAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
@@ -253,21 +319,33 @@
IJclDoubleComparer, IJclDoubleHashConverter)
protected
FPrecision: Double;
+ FEqualityCompare: TDoubleEqualityCompare;
+ FCompare: TDoubleCompare;
+ FHashConvert: TDoubleHashConvert;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeDouble(var AValue: Double): Double;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclDoubleEqualityComparer }
- function ItemsEqual(const A, B: Double): Boolean;
+ function GetEqualityCompare: TDoubleEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TDoubleEqualityCompare); virtual;
+ function ItemsEqual(const A, B: Double): Boolean; virtual;
{ IJclDoubleComparer }
- function ItemsCompare(const A, B: Double): Integer;
+ function GetCompare: TDoubleCompare; virtual;
+ procedure SetCompare(Value: TDoubleCompare); virtual;
+ function ItemsCompare(const A, B: Double): Integer; virtual;
{ IJclDoubleContainer }
function GetPrecision: Double; virtual;
procedure SetPrecision(const Value: Double); virtual;
{ IJclDoubleHashConverter }
- function Hash(const AValue: Double): Integer;
+ function GetHashConvert: TDoubleHashConvert; virtual;
+ procedure SetHashConvert(Value: TDoubleHashConvert); virtual;
+ function Hash(const AValue: Double): Integer; virtual;
public
property Precision: Double read GetPrecision write SetPrecision;
+ property EqualityCompare: TDoubleEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TDoubleCompare read GetCompare write SetCompare;
+ property HashConvert: TDoubleHashConvert read GetHashConvert write SetHashConvert;
end;
TJclExtendedAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
@@ -275,121 +353,219 @@
IJclExtendedComparer, IJclExtendedHashConverter)
protected
FPrecision: Extended;
+ FEqualityCompare: TExtendedEqualityCompare;
+ FCompare: TExtendedCompare;
+ FHashConvert: TExtendedHashConvert;
procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeExtended(var AValue: Extended): Extended;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclExtendedEqualityComparer }
- function ItemsEqual(const A, B: Extended): Boolean;
+ function GetEqualityCompare: TExtendedEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TExtendedEqualityCompare); virtual;
+ function ItemsEqual(const A, B: Extended): Boolean; virtual;
{ IJclExtendedComparer }
- function ItemsCompare(const A, B: Extended): Integer;
+ function GetCompare: TExtendedCompare; virtual;
+ procedure SetCompare(Value: TExtendedCompare); virtual;
+ function ItemsCompare(const A, B: Extended): Integer; virtual;
{ IJclExtendedContainer }
function GetPrecision: Extended; virtual;
procedure SetPrecision(const Value: Extended); virtual;
{ IJclExtendedHashConverter }
- function Hash(const AValue: Extended): Integer;
+ function GetHashConvert: TExtendedHashConvert; virtual;
+ procedure SetHashConvert(Value: TExtendedHashConvert); virtual;
+ function Hash(const AValue: Extended): Integer; virtual;
public
property Precision: Extended read GetPrecision write SetPrecision;
+ property EqualityCompare: TExtendedEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TExtendedCompare read GetCompare write SetCompare;
+ property HashConvert: TExtendedHashConvert read GetHashConvert write SetHashConvert;
end;
TJclIntegerAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclCloneable, IJclIntfCloneable, IJclContainer, IJclIntegerEqualityComparer, IJclIntegerComparer,
IJclIntegerHashConverter)
protected
+ FEqualityCompare: TIntegerEqualityCompare;
+ FCompare: TIntegerCompare;
+ FHashConvert: TIntegerHashConvert;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeInteger(var AValue: Integer): Integer;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIntegerEqualityComparer }
- function ItemsEqual(A, B: Integer): Boolean;
+ function GetEqualityCompare: TIntegerEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TIntegerEqualityCompare); virtual;
+ function ItemsEqual(A, B: Integer): Boolean; virtual;
{ IJclIntegerComparer }
- function ItemsCompare(A, B: Integer): Integer;
+ function GetCompare: TIntegerCompare; virtual;
+ procedure SetCompare(Value: TIntegerCompare); virtual;
+ function ItemsCompare(A, B: Integer): Integer; virtual;
{ IJclIntegerHashConverter }
- function Hash(AValue: Integer): Integer;
+ function GetHashConvert: TIntegerHashConvert; virtual;
+ procedure SetHashConvert(Value: TIntegerHashConvert); virtual;
+ function Hash(AValue: Integer): Integer; virtual;
+ public
+ property EqualityCompare: TIntegerEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TIntegerCompare read GetCompare write SetCompare;
+ property HashConvert: TIntegerHashConvert read GetHashConvert write SetHashConvert;
end;
TJclCardinalAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclCloneable, IJclIntfCloneable, IJclContainer, IJclCardinalEqualityComparer, IJclCardinalComparer,
IJclCardinalHashConverter)
protected
+ FEqualityCompare: TCardinalEqualityCompare;
+ FCompare: TCardinalCompare;
+ FHashConvert: TCardinalHashConvert;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeCardinal(var AValue: Cardinal): Cardinal;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclIntegerEqualityComparer }
- function ItemsEqual(A, B: Cardinal): Boolean;
+ function GetEqualityCompare: TCardinalEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TCardinalEqualityCompare); virtual;
+ function ItemsEqual(A, B: Cardinal): Boolean; virtual;
{ IJclIntegerComparer }
- function ItemsCompare(A, B: Cardinal): Integer;
+ function GetCompare: TCardinalCompare; virtual;
+ procedure SetCompare(Value: TCardinalCompare); virtual;
+ function ItemsCompare(A, B: Cardinal): Integer; virtual;
{ IJclIntegerHashConverter }
- function Hash(AValue: Cardinal): Integer;
+ function GetHashConvert: TCardinalHashConvert; virtual;
+ procedure SetHashConvert(Value: TCardinalHashConvert); virtual;
+ function Hash(AValue: Cardinal): Integer; virtual;
+ public
+ property EqualityCompare: TCardinalEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TCardinalCompare read GetCompare write SetCompare;
+ property HashConvert: TCardinalHashConvert read GetHashConvert write SetHashConvert;
end;
TJclInt64AbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclCloneable, IJclIntfCloneable, IJclContainer, IJclInt64EqualityComparer, IJclInt64Comparer,
IJclInt64HashConverter)
protected
+ FEqualityCompare: TInt64EqualityCompare;
+ FCompare: TInt64Compare;
+ FHashConvert: TInt64HashConvert;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreeInt64(var AValue: Int64): Int64;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclInt64EqualityComparer }
- function ItemsEqual(const A, B: Int64): Boolean;
+ function GetEqualityCompare: TInt64EqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TInt64EqualityCompare); virtual;
+ function ItemsEqual(const A, B: Int64): Boolean; virtual;
{ IJclInt64Comparer }
- function ItemsCompare(const A, B: Int64): Integer;
+ function GetCompare: TInt64Compare; virtual;
+ procedure SetCompare(Value: TInt64Compare); virtual;
+ function ItemsCompare(const A, B: Int64): Integer; virtual;
{ IJclInt64HashConverter }
- function Hash(const AValue: Int64): Integer;
+ function GetHashConvert: TInt64HashConvert; virtual;
+ procedure SetHashConvert(Value: TInt64HashConvert); virtual;
+ function Hash(const AValue: Int64): Integer; virtual;
+ public
+ property EqualityCompare: TInt64EqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TInt64Compare read GetCompare write SetCompare;
+ property HashConvert: TInt64HashConvert read GetHashConvert write SetHashConvert;
end;
{$IFNDEF CLR}
TJclPtrAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclCloneable, IJclIntfCloneable, IJclContainer, IJclPtrEqualityComparer, IJclPtrComparer, IJclPtrHashConverter)
protected
+ FEqualityCompare: TPtrEqualityCompare;
+ FCompare: TPtrCompare;
+ FHashConvert: TPtrHashConvert;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
function FreePointer(var APtr: Pointer): Pointer;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclPtrEqualityComparer }
- function ItemsEqual(A, B: Pointer): Boolean;
+ function GetEqualityCompare: TPtrEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TPtrEqualityCompare); virtual;
+ function ItemsEqual(A, B: Pointer): Boolean; virtual;
{ IJclPtrComparer }
- function ItemsCompare(A, B: Pointer): Integer;
+ function GetCompare: TPtrCompare; virtual;
+ procedure SetCompare(Value: TPtrCompare); virtual;
+ function ItemsCompare(A, B: Pointer): Integer; virtual;
{ IJclPtrHashConverter }
- function Hash(AValue: Pointer): Integer;
+ function GetHashConvert: TPtrHashConvert; virtual;
+ procedure SetHashConvert(Value: TPtrHashConvert); virtual;
+ function Hash(APtr: Pointer): Integer; virtual;
+ public
+ property EqualityCompare: TPtrEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TPtrCompare read GetCompare write SetCompare;
+ property HashConvert: TPtrHashConvert read GetHashConvert write SetHashConvert;
end;
{$ENDIF ~CLR}
TJclAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclCloneable, IJclIntfCloneable, IJclContainer, IJclObjectOwner, IJclEqualityComparer, IJclComparer)
- private
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclObjectOwner, IJclEqualityComparer, IJclComparer,
+ IJclHashConverter)
+ protected
FOwnsObjects: Boolean;
- protected
+ FEqualityCompare: TEqualityCompare;
+ FCompare: TCompare;
+ FHashConvert: THashConvert;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclEqualityComparer }
- function ItemsEqual(A, B: TObject): Boolean;
+ function GetEqualityCompare: TEqualityCompare; virtual;
+ procedure SetEqualityCompare(Value: TEqualityCompare); virtual;
+ function ItemsEqual(A, B: TObject): Boolean; virtual;
{ IJclComparer }
- function ItemsCompare(A, B: TObject): Integer;
+ function GetCompare: TCompare; virtual;
+ procedure SetCompare(Value: TCompare); virtual;
+ function ItemsCompare(A, B: TObject): Integer; virtual;
{ IJclObjectOwner }
function FreeObject(var AObject: TObject): TObject; virtual;
function GetOwnsObjects: Boolean; virtual;
+ { IJclHashConverter }
+ function GetHashConvert: THashConvert; virtual;
+ procedure SetHashConvert(Value: THashConvert); virtual;
+ function Hash(AObject: TObject): Integer; virtual;
public
constructor Create(const ALockDelegate: IInterface; AOwnsObjects: Boolean);
property OwnsObjects: Boolean read FOwnsObjects;
+ property EqualityCompare: TEqualityCompare read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TCompare read GetCompare write SetCompare;
+ property HashConvert: THashConvert read GetHashConvert write SetHashConvert;
end;
{$IFDEF SUPPORTS_GENERICS}
TJclAbstractContainer<T> = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclCloneable, IJclIntfCloneable, IJclContainer, IJclItemOwner<T>, IJclEqualityComparer<T>, IJclComparer<T>)
- private
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclItemOwner<T>, IJclEqualityComparer<T>, IJclComparer<T>,
+ IJclHashConverter<T>)
+ protected
FOwnsItems: Boolean;
- protected
+ FEqualityCompare: TEqualityCompare<T>;
+ FCompare: TCompare<T>;
+ FHashConvert: THashConvert<T>;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
{ IJclEqualityComparer<T> }
+ function GetEqualityCompare: TEqualityCompare<T>; virtual;
+ procedure SetEqualityCompare(Value: TEqualityCompare<T>); virtual;
function ItemsEqual(const A, B: T): Boolean; virtual;
{ IJclComparer<T> }
+ function GetCompare: TCompare<T>; virtual;
+ procedure SetCompare(Value: TCompare<T>); virtual;
function ItemsCompare(const A, B: T): Integer; virtual;
{ IJclItemOwner<T> }
function FreeItem(var AItem: T): T; virtual;
function GetOwnsItems: Boolean; virtual;
+ { IJclHashConverter<T> }
+ function GetHashConvert: THashConvert<T>; virtual;
+ procedure SetHashConvert(Value: THashConvert<T>); virtual;
+ function Hash(const AItem: T): Integer; virtual;
public
constructor Create(const ALockDelegate: IInterface; AOwnsItems: Boolean);
property OwnsItems: Boolean read FOwnsItems;
+ property EqualityCompare: TEqualityCompare<T> read GetEqualityCompare write SetEqualityCompare;
+ property Compare: TCompare<T> read GetCompare write SetCompare;
+ property HashConvert: THashConvert<T> read GetHashConvert write SetHashConvert;
end;
{$ENDIF SUPPORTS_GENERICS}
@@ -594,14 +770,14 @@
procedure TJclAbstractContainerBase.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
begin
// override to customize
- Dest.SetAllowDefaultElements(GetAllowDefaultElements);
- Dest.SetDuplicates(GetDuplicates);
- Dest.SetRemoveSingleElement(GetRemoveSingleElement);
- Dest.SetReturnDefaultElements(GetReturnDefaultElements);
- Dest.SetAutoGrowParameter(GetAutoGrowParameter);
- Dest.SetAutoGrowStrategy(GetAutoGrowStrategy);
- Dest.SetAutoPackParameter(GetAutoPackParameter);
- Dest.SetAutoPackStrategy(GetAutoPackStrategy);
+ Dest.AllowDefaultElements := AllowDefaultElements;
+ Dest.Duplicates := Duplicates;
+ Dest.RemoveSingleElement := RemoveSingleElement;
+ Dest.ReturnDefaultElements := ReturnDefaultElements;
+ Dest.AutoGrowParameter := AutoGrowParameter;
+ Dest.AutoGrowStrategy := AutoGrowStrategy;
+ Dest.AutoPackParameter := AutoPackParameter;
+ Dest.AutoPackStrategy := AutoPackStrategy;
end;
procedure TJclAbstractContainerBase.AssignTo(const Dest: IJclContainer);
@@ -877,14 +1053,54 @@
//=== { TJclIntfAbstractContainer } ==========================================
+procedure TJclIntfAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclIntfAbstractContainer;
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclIntfAbstractContainer then
+ begin
+ ADest := TJclIntfAbstractContainer(Dest);
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
+end;
+
function TJclIntfAbstractContainer.FreeObject(var AInterface: IInterface): IInterface;
begin
Result := AInterface;
AInterface := nil;
end;
+function TJclIntfAbstractContainer.GetCompare: TIntfCompare;
+begin
+ Result := FCompare;
+end;
+
+function TJclIntfAbstractContainer.GetEqualityCompare: TIntfEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclIntfAbstractContainer.GetHashConvert: TIntfHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
+function TJclIntfAbstractContainer.Hash(const AInterface: IInterface): Integer;
+begin
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AInterface)
+ else
+ Result := Integer(AInterface);
+end;
+
function TJclIntfAbstractContainer.ItemsCompare(const A, B: IInterface): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if Integer(A) > Integer(B) then
Result := 1
else
@@ -896,9 +1112,30 @@
function TJclIntfAbstractContainer.ItemsEqual(const A, B: IInterface): Boolean;
begin
- Result := Integer(A) = Integer(B);
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := Integer(A) = Integer(B);
end;
+procedure TJclIntfAbstractContainer.SetCompare(Value: TIntfCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclIntfAbstractContainer.SetEqualityCompare(Value: TIntfEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclIntfAbstractContainer.SetHashConvert(Value: TIntfHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
//=== { TJclStrAbstractContainer } ===========================================
procedure TJclStrAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
@@ -921,10 +1158,18 @@
//=== { TJclAnsiStrAbstractContainer } =======================================
procedure TJclAnsiStrAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclAnsiStrAbstractContainer;
begin
inherited AssignPropertiesTo(Dest);
if Dest is TJclAnsiStrAbstractContainer then
- TJclAnsiStrAbstractContainer(Dest).SetEncoding(GetEncoding);
+ begin
+ ADest := TJclAnsiStrAbstractContainer(Dest);
+ ADest.Encoding := Encoding;
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
end;
function TJclAnsiStrAbstractContainer.FreeString(var AString: AnsiString): AnsiString;
@@ -933,70 +1178,126 @@
AString := '';
end;
+function TJclAnsiStrAbstractContainer.GetCompare: TAnsiStrCompare;
+begin
+ Result := FCompare;
+end;
+
function TJclAnsiStrAbstractContainer.GetEncoding: TJclAnsiStrEncoding;
begin
Result := FEncoding;
end;
+function TJclAnsiStrAbstractContainer.GetEqualityCompare: TAnsiStrEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclAnsiStrAbstractContainer.GetHashConvert: TAnsiStrHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclAnsiStrAbstractContainer.Hash(const AString: AnsiString): Integer;
var
I: Integer;
begin
- Result := 0;
- case FEncoding of
- seISO:
- if FCaseSensitive then
- for I := 1 to Length(AString) do
- Inc(Result, Ord(AString[I]) * (I - 1) * 256)
- else
- for I := 1 to Length(AString) do
- Inc(Result, Ord(UpCase(AString[I])) * (I - 1) * 256);
- //seUTF8:
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AString)
else
- raise EJclOperationNotSupportedError.Create;
+ begin
+ Result := 0;
+ case FEncoding of
+ seISO:
+ if FCaseSensitive then
+ for I := 1 to Length(AString) do
+ Inc(Result, Ord(AString[I]) * (I - 1) * 256)
+ else
+ for I := 1 to Length(AString) do
+ Inc(Result, Ord(UpCase(AString[I])) * (I - 1) * 256);
+ //seUTF8:
+ else
+ raise EJclOperationNotSupportedError.Create;
+ end;
end;
end;
function TJclAnsiStrAbstractContainer.ItemsCompare(const A, B: AnsiString): Integer;
begin
- case FEncoding of
- seISO:
- if FCaseSensitive then
- Result := CompareStr(A, B)
- else
- Result := CompareText(A, B);
- //seUTF8:
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
else
- raise EJclOperationNotSupportedError.Create;
+ begin
+ case FEncoding of
+ seISO:
+ if FCaseSensitive then
+ Result := CompareStr(A, B)
+ else
+ Result := CompareText(A, B);
+ //seUTF8:
+ else
+ raise EJclOperationNotSupportedError.Create;
+ end;
end;
end;
function TJclAnsiStrAbstractContainer.ItemsEqual(const A, B: AnsiString): Boolean;
begin
- case FEncoding of
- seISO:
- if FCaseSensitive then
- Result := CompareStr(A, B) = 0
- else
- Result := CompareText(A, B) = 0;
- //seUTF8:
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
else
- raise EJclOperationNotSupportedError.Create;
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ begin
+ case FEncoding of
+ seISO:
+ if FCaseSensitive then
+ Result := CompareStr(A, B) = 0
+ else
+ Result := CompareText(A, B) = 0;
+ //seUTF8:
+ else
+ raise EJclOperationNotSupportedError.Create;
+ end;
end;
end;
+procedure TJclAnsiStrAbstractContainer.SetCompare(Value: TAnsiStrCompare);
+begin
+ FCompare := Value;
+end;
+
procedure TJclAnsiStrAbstractContainer.SetEncoding(Value: TJclAnsiStrEncoding);
begin
FEncoding := Value;
end;
+procedure TJclAnsiStrAbstractContainer.SetEqualityCompare(Value: TAnsiStrEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclAnsiStrAbstractContainer.SetHashConvert(Value: TAnsiStrHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
//=== { TJclWideStrContainer } ===============================================
procedure TJclWideStrAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclWideStrAbstractContainer;
begin
inherited AssignPropertiesTo(Dest);
if Dest is TJclWideStrAbstractContainer then
- TJclWideStrAbstractContainer(Dest).SetEncoding(GetEncoding);
+ begin
+ ADest := TJclWideStrAbstractContainer(Dest);
+ ADest.Encoding := Encoding;
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
end;
function TJclWideStrAbstractContainer.FreeString(var AString: WideString): WideString;
@@ -1005,70 +1306,126 @@
AString := '';
end;
+function TJclWideStrAbstractContainer.GetCompare: TWideStrCompare;
+begin
+ Result := FCompare;
+end;
+
function TJclWideStrAbstractContainer.GetEncoding: TJclWideStrEncoding;
begin
Result := FEncoding;
end;
+function TJclWideStrAbstractContainer.GetEqualityCompare: TWideStrEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclWideStrAbstractContainer.GetHashConvert: TWideStrHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclWideStrAbstractContainer.Hash(const AString: WideString): Integer;
var
I: Integer;
begin
- Result := 0;
- case FEncoding of
- weUCS2:
- //if FCaseSensitive then
- for I := 1 to Length(AString) do
- Inc(Result, Ord(AString[I]) * (I - 1) * 65536)
- //else
- // for I := 1 to Length(AString) do
- // Inc(Result, Ord(AString[I]) * (I - 1) * 65536); // TODO: case folding
- //weUTF16:
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AString)
else
- raise EJclOperationNotSupportedError.Create;
+ begin
+ Result := 0;
+ case FEncoding of
+ weUCS2:
+ //if FCaseSensitive then
+ for I := 1 to Length(AString) do
+ Inc(Result, Ord(AString[I]) * (I - 1) * 65536)
+ //else
+ // for I := 1 to Length(AString) do
+ // Inc(Result, Ord(AString[I]) * (I - 1) * 65536); // TODO: case folding
+ //weUTF16:
+ else
+ raise EJclOperationNotSupportedError.Create;
+ end;
end;
end;
function TJclWideStrAbstractContainer.ItemsCompare(const A, B: WideString): Integer;
begin
- case FEncoding of
- weUCS2:
- if FCaseSensitive then
- Result := WideCompareStr(A, B)
- else
- Result := WideCompareText(A, B);
- //weUTF16:
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
else
- raise EJclOperationNotSupportedError.Create;
+ begin
+ case FEncoding of
+ weUCS2:
+ if FCaseSensitive then
+ Result := WideCompareStr(A, B)
+ else
+ Result := WideCompareText(A, B);
+ //weUTF16:
+ else
+ raise EJclOperationNotSupportedError.Create;
+ end;
end;
end;
function TJclWideStrAbstractContainer.ItemsEqual(const A, B: WideString): Boolean;
begin
- case FEncoding of
- weUCS2:
- if FCaseSensitive then
- Result := WideCompareStr(A, B) = 0
- else
- Result := WideCompareText(A, B) = 0;
- //weUTF16:
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
else
- raise EJclOperationNotSupportedError.Create;
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ begin
+ case FEncoding of
+ weUCS2:
+ if FCaseSensitive then
+ Result := WideCompareStr(A, B) = 0
+ else
+ Result := WideCompareText(A, B) = 0;
+ //weUTF16:
+ else
+ raise EJclOperationNotSupportedError.Create;
+ end;
end;
end;
+procedure TJclWideStrAbstractContainer.SetCompare(Value: TWideStrCompare);
+begin
+ FCompare := Value;
+end;
+
procedure TJclWideStrAbstractContainer.SetEncoding(Value: TJclWideStrEncoding);
begin
FEncoding := Value;
end;
+procedure TJclWideStrAbstractContainer.SetEqualityCompare(Value: TWideStrEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclWideStrAbstractContainer.SetHashConvert(Value: TWideStrHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
//=== { TJclSingleAbstractContainer } ========================================
procedure TJclSingleAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclSingleAbstractContainer;
begin
inherited AssignPropertiesTo(Dest);
if Dest is TJclSingleAbstractContainer then
- TJclSingleAbstractContainer(Dest).Precision := Precision;
+ begin
+ ADest := TJclSingleAbstractContainer(Dest);
+ ADest.Precision := Precision;
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
end;
function TJclSingleAbstractContainer.FreeSingle(var AValue: Single): Single;
@@ -1077,6 +1434,21 @@
AValue := 0.0;
end;
+function TJclSingleAbstractContainer.GetCompare: TSingleCompare;
+begin
+ Result := FCompare;
+end;
+
+function TJclSingleAbstractContainer.GetEqualityCompare: TSingleEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclSingleAbstractContainer.GetHashConvert: TSingleHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclSingleAbstractContainer.GetPrecision: Single;
begin
Result := FPrecision;
@@ -1086,11 +1458,17 @@
const
A = 0.6180339887; // (sqrt(5) - 1) / 2
begin
- Result := Round(MaxInt * Frac(AValue * A));
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AValue)
+ else
+ Result := Round(MaxInt * Frac(AValue * A));
end;
function TJclSingleAbstractContainer.ItemsCompare(const A, B: Single): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if Abs(A - B) <= FPrecision then
Result := 0
else
@@ -1102,9 +1480,30 @@
function TJclSingleAbstractContainer.ItemsEqual(const A, B: Single): Boolean;
begin
- Result := Abs(A - B) <= FPrecision;
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := Abs(A - B) <= FPrecision;
end;
+procedure TJclSingleAbstractContainer.SetCompare(Value: TSingleCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclSingleAbstractContainer.SetEqualityCompare(Value: TSingleEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclSingleAbstractContainer.SetHashConvert(Value: TSingleHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
procedure TJclSingleAbstractContainer.SetPrecision(const Value: Single);
begin
FPrecision := Value;
@@ -1113,10 +1512,18 @@
//=== { TJclDoubleAbstractContainer } ========================================
procedure TJclDoubleAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclDoubleAbstractContainer;
begin
inherited AssignPropertiesTo(Dest);
if Dest is TJclDoubleAbstractContainer then
- TJclDoubleAbstractContainer(Dest).Precision := Precision;
+ begin
+ ADest := TJclDoubleAbstractContainer(Dest);
+ ADest.Precision := Precision;
+ ADest.Compare := Compare;
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.HashConvert := HashConvert;
+ end;
end;
function TJclDoubleAbstractContainer.FreeDouble(var AValue: Double): Double;
@@ -1125,6 +1532,21 @@
AValue := 0.0;
end;
+function TJclDoubleAbstractContainer.GetCompare: TDoubleCompare;
+begin
+ Result := FCompare;
+end;
+
+function TJclDoubleAbstractContainer.GetEqualityCompare: TDoubleEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclDoubleAbstractContainer.GetHashConvert: TDoubleHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclDoubleAbstractContainer.GetPrecision: Double;
begin
Result := FPrecision;
@@ -1134,11 +1556,17 @@
const
A = 0.6180339887; // (sqrt(5) - 1) / 2
begin
- Result := Round(MaxInt * Frac(AValue * A));
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AValue)
+ else
+ Result := Round(MaxInt * Frac(AValue * A));
end;
function TJclDoubleAbstractContainer.ItemsCompare(const A, B: Double): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if Abs(A - B) <= FPrecision then
Result := 0
else
@@ -1150,9 +1578,30 @@
function TJclDoubleAbstractContainer.ItemsEqual(const A, B: Double): Boolean;
begin
- Result := Abs(A - B) <= FPrecision;
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := Abs(A - B) <= FPrecision;
end;
+procedure TJclDoubleAbstractContainer.SetCompare(Value: TDoubleCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclDoubleAbstractContainer.SetEqualityCompare(Value: TDoubleEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclDoubleAbstractContainer.SetHashConvert(Value: TDoubleHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
procedure TJclDoubleAbstractContainer.SetPrecision(const Value: Double);
begin
FPrecision := Value;
@@ -1161,10 +1610,18 @@
//=== { TJclExtendedAbstractContainer } ======================================
procedure TJclExtendedAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclExtendedAbstractContainer;
begin
inherited AssignPropertiesTo(Dest);
if Dest is TJclExtendedAbstractContainer then
- TJclExtendedAbstractContainer(Dest).Precision := Precision;
+ begin
+ ADest := TJclExtendedAbstractContainer(Dest);
+ ADest.Precision := Precision;
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
end;
function TJclExtendedAbstractContainer.FreeExtended(var AValue: Extended): Extended;
@@ -1173,6 +1630,21 @@
AValue := 0.0;
end;
+function TJclExtendedAbstractContainer.GetCompare: TExtendedCompare;
+begin
+ Result := FCompare;
+end;
+
+function TJclExtendedAbstractContainer.GetEqualityCompare: TExtendedEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclExtendedAbstractContainer.GetHashConvert: TExtendedHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclExtendedAbstractContainer.GetPrecision: Extended;
begin
Result := FPrecision;
@@ -1182,11 +1654,17 @@
const
A = 0.6180339887; // (sqrt(5) - 1) / 2
begin
- Result := Round(MaxInt * Frac(AValue * A));
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AValue)
+ else
+ Result := Round(MaxInt * Frac(AValue * A));
end;
function TJclExtendedAbstractContainer.ItemsCompare(const A, B: Extended): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if Abs(A - B) <= FPrecision then
Result := 0
else
@@ -1198,9 +1676,30 @@
function TJclExtendedAbstractContainer.ItemsEqual(const A, B: Extended): Boolean;
begin
- Result := Abs(A - B) <= FPrecision;
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := Abs(A - B) <= FPrecision;
end;
+procedure TJclExtendedAbstractContainer.SetCompare(Value: TExtendedCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclExtendedAbstractContainer.SetEqualityCompare(Value: TExtendedEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclExtendedAbstractContainer.SetHashConvert(Value: TExtendedHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
procedure TJclExtendedAbstractContainer.SetPrecision(const Value: Extended);
begin
FPrecision := Value;
@@ -1208,19 +1707,54 @@
//=== { TJclIntegerAbstractContainer } =======================================
+procedure TJclIntegerAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclIntegerAbstractContainer;
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclIntegerAbstractContainer then
+ begin
+ ADest := TJclIntegerAbstractContainer(Dest);
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
+end;
+
function TJclIntegerAbstractContainer.FreeInteger(var AValue: Integer): Integer;
begin
Result := AValue;
AValue := 0;
end;
+function TJclIntegerAbstractContainer.GetCompare: TIntegerCompare;
+begin
+ Result := FCompare;
+end;
+
+function TJclIntegerAbstractContainer.GetEqualityCompare: TIntegerEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclIntegerAbstractContainer.GetHashConvert: TIntegerHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclIntegerAbstractContainer.Hash(AValue: Integer): Integer;
begin
- Result := AValue;
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AValue)
+ else
+ Result := AValue;
end;
function TJclIntegerAbstractContainer.ItemsCompare(A, B: Integer): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if A > B then
Result := 1
else
@@ -1232,24 +1766,80 @@
function TJclIntegerAbstractContainer.ItemsEqual(A, B: Integer): Boolean;
begin
- Result := A = B;
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := A = B;
end;
+procedure TJclIntegerAbstractContainer.SetCompare(Value: TIntegerCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclIntegerAbstractContainer.SetEqualityCompare(Value: TIntegerEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclIntegerAbstractContainer.SetHashConvert(Value: TIntegerHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
//=== { TJclCardinalAbstractContainer } ======================================
+procedure TJclCardinalAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclCardinalAbstractContainer;
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclCardinalAbstractContainer then
+ begin
+ ADest := TJclCardinalAbstractContainer(Dest);
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
+end;
+
function TJclCardinalAbstractContainer.FreeCardinal(var AValue: Cardinal): Cardinal;
begin
Result := AValue;
AValue := 0;
end;
+function TJclCardinalAbstractContainer.GetCompare: TCardinalCompare;
+begin
+ Result := FCompare;
+end;
+
+function TJclCardinalAbstractContainer.GetEqualityCompare: TCardinalEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclCardinalAbstractContainer.GetHashConvert: TCardinalHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclCardinalAbstractContainer.Hash(AValue: Cardinal): Integer;
begin
- Result := AValue and MaxInt;
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AValue)
+ else
+ Result := AValue and MaxInt;
end;
function TJclCardinalAbstractContainer.ItemsCompare(A, B: Cardinal): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if A > B then
Result := 1
else
@@ -1261,24 +1851,80 @@
function TJclCardinalAbstractContainer.ItemsEqual(A, B: Cardinal): Boolean;
begin
- Result := A = B;
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := A = B;
end;
+procedure TJclCardinalAbstractContainer.SetCompare(Value: TCardinalCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclCardinalAbstractContainer.SetEqualityCompare(Value: TCardinalEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclCardinalAbstractContainer.SetHashConvert(Value: TCardinalHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
//=== { TJclInt64AbstractContainer } =========================================
+procedure TJclInt64AbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclInt64AbstractContainer;
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclInt64AbstractContainer then
+ begin
+ ADest := TJclInt64AbstractContainer(Dest);
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
+end;
+
function TJclInt64AbstractContainer.FreeInt64(var AValue: Int64): Int64;
begin
Result := AValue;
AValue := 0;
end;
+function TJclInt64AbstractContainer.GetCompare: TInt64Compare;
+begin
+ Result := FCompare;
+end;
+
+function TJclInt64AbstractContainer.GetEqualityCompare: TInt64EqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclInt64AbstractContainer.GetHashConvert: TInt64HashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclInt64AbstractContainer.Hash(const AValue: Int64): Integer;
begin
- Result := AValue and MaxInt;
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AValue)
+ else
+ Result := AValue and MaxInt;
end;
function TJclInt64AbstractContainer.ItemsCompare(const A, B: Int64): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if A > B then
Result := 1
else
@@ -1290,26 +1936,82 @@
function TJclInt64AbstractContainer.ItemsEqual(const A, B: Int64): Boolean;
begin
- Result := A = B;
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := A = B;
end;
+procedure TJclInt64AbstractContainer.SetCompare(Value: TInt64Compare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclInt64AbstractContainer.SetEqualityCompare(Value: TInt64EqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclInt64AbstractContainer.SetHashConvert(Value: TInt64HashConvert);
+begin
+ FHashConvert := Value;
+end;
+
{$IFNDEF CLR}
//=== { TJclPtrAbstractContainer } ===========================================
+procedure TJclPtrAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclPtrAbstractContainer;
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclPtrAbstractContainer then
+ begin
+ ADest := TJclPtrAbstractContainer(Dest);
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
+end;
+
function TJclPtrAbstractContainer.FreePointer(var APtr: Pointer): Pointer;
begin
Result := APtr;
APtr := nil;
end;
-function TJclPtrAbstractContainer.Hash(AValue: Pointer): Integer;
+function TJclPtrAbstractContainer.GetCompare: TPtrCompare;
begin
- Result := Integer(AValue) and MaxInt;
+ Result := FCompare;
end;
+function TJclPtrAbstractContainer.GetEqualityCompare: TPtrEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclPtrAbstractContainer.GetHashConvert: TPtrHashConvert;
+begin
+ Result := FHashConvert;
+end;
+
+function TJclPtrAbstractContainer.Hash(APtr: Pointer): Integer;
+begin
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(APtr)
+ else
+ Result := Integer(APtr) and MaxInt;
+end;
+
function TJclPtrAbstractContainer.ItemsCompare(A, B: Pointer): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if Integer(A) > Integer(B) then
Result := 1
else
@@ -1321,8 +2023,29 @@
function TJclPtrAbstractContainer.ItemsEqual(A, B: Pointer): Boolean;
begin
- Result := Integer(A) = Integer(B);
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := Integer(A) = Integer(B);
end;
+procedure TJclPtrAbstractContainer.SetCompare(Value: TPtrCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclPtrAbstractContainer.SetEqualityCompare(Value: TPtrEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclPtrAbstractContainer.SetHashConvert(Value: TPtrHashConvert);
+begin
+ FHashConvert := Value;
+end;
+
{$ENDIF ~CLR}
//=== { TJclAbstractContainer } ==============================================
@@ -1333,6 +2056,20 @@
FOwnsObjects := AOwnsObjects;
end;
+procedure TJclAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclAbstractContainer;
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclAbstractContainer then
+ begin
+ ADest := TJclAbstractContainer(Dest);
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
+end;
+
function TJclAbstractContainer.FreeObject(var AObject: TObject): TObject;
begin
if FOwnsObjects then
@@ -1347,13 +2084,39 @@
end;
end;
+function TJclAbstractContainer.GetCompare: TCompare;
+begin
+ Result := FCompare;
+end;
+
+function TJclAbstractContainer.GetEqualityCompare: TEqualityCompare;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclAbstractContainer.GetHashConvert: THashConvert;
+begin
+ Result := FHashConvert;
+end;
+
function TJclAbstractContainer.GetOwnsObjects: Boolean;
begin
Result := FOwnsObjects;
end;
+function TJclAbstractContainer.Hash(AObject: TObject): Integer;
+begin
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AObject)
+ else
+ Result := Integer(AObject);
+end;
+
function TJclAbstractContainer.ItemsCompare(A, B: TObject): Integer;
begin
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
if Integer(A) > Integer(B) then
Result := 1
else
@@ -1365,9 +2128,30 @@
function TJclAbstractContainer.ItemsEqual(A, B: TObject): Boolean;
begin
- Result := Integer(A) = Integer(B);
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ Result := Integer(A) = Integer(B);
end;
+procedure TJclAbstractContainer.SetCompare(Value: TCompare);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclAbstractContainer.SetEqualityCompare(Value: TEqualityCompare);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclAbstractContainer.SetHashConvert(Value: THashConvert);
+begin
+ FHashConvert := Value;
+end;
+
{$IFDEF SUPPORTS_GENERICS}
//=== { TJclAbstractContainer<T> } ===========================================
@@ -1377,6 +2161,20 @@
FOwnsItems := AOwnsItems;
end;
+procedure TJclAbstractContainer<T>.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+var
+ ADest: TJclAbstractContainer<T>;
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclAbstractContainer<T> then
+ begin
+ ADest := TJclAbstractContainer<T>(Dest);
+ ADest.EqualityCompare := EqualityCompare;
+ ADest.Compare := Compare;
+ ADest.HashConvert := HashConvert;
+ end;
+end;
+
function TJclAbstractContainer<T>.FreeItem(var AItem: T): T;
begin
if FOwnsItems then
@@ -1391,21 +2189,68 @@
end;
end;
+function TJclAbstractContainer<T>.GetCompare: TCompare<T>;
+begin
+ Result := FCompare;
+end;
+
+function TJclAbstractContainer<T>.GetEqualityCompare: TEqualityCompare<T>;
+begin
+ Result := FEqualityCompare;
+end;
+
+function TJclAbstractContainer<T>.GetHashConvert: THashConvert<T>;
+begin
+ Result := FHashConvert;
+end;
+
function TJclAbstractContainer<T>.GetOwnsItems: Boolean;
begin
Result := FOwnsItems;
end;
+function TJclAbstractContainer<T>.Hash(const AItem: T): Integer;
+begin
+ if Assigned(FHashConvert) then
+ Result := FHashConvert(AItem)
+ else
+ raise EJclOperationNotSupportedError.Create;
+end;
+
function TJclAbstractContainer<T>.ItemsCompare(const A, B: T): Integer;
begin
- raise EJclOperationNotSupportedError.Create;
+ if Assigned(FCompare) then
+ Result := FCompare(A, B)
+ else
+ raise EJclOperationNotSupportedError.Create;
end;
function TJclAbstractContainer<T>.ItemsEqual(const A, B: T): Boolean;
begin
- raise EJclOperationNotSupportedError.Create;
+ if Assigned(FEqualityCompare) then
+ Result := FEqualityCompare(A, B)
+ else
+ if Assigned(FCompare) then
+ Result := FCompare(A, B) = 0
+ else
+ raise EJclOperationNotSupportedError.Create;
end;
+procedure TJclAbstractContainer<T>.SetCompare(Value: TCompare<T>);
+begin
+ FCompare := Value;
+end;
+
+procedure TJclAbstractContainer<T>.SetEqualityCompare(Value: TEqualityCompare<T>);
+begin
+ FEqualityCompare := Value;
+end;
+
+procedure TJclAbstractContainer<T>.SetHashConvert(Value: THashConvert<T>);
+begin
+ FHashConvert := Value;
+end;
+
{$ENDIF SUPPORTS_GENERICS}
//=== { TJclAnsiStrCollection } ==============================================
Modified: trunk/jcl/source/common/JclAlgorithms.pas
===================================================================
--- trunk/jcl/source/common/JclAlgorithms.pas 2007-11-20 18:35:10 UTC (rev 2227)
+++ trunk/jcl/source/common/JclAlgorithms.pas 2007-11-21 22:54:41 UTC (rev 2228)
@@ -75,35 +75,39 @@
{$ENDIF ~CLR}
TApplyFunction = function(AObject: TObject): TObject;
- // Pointer functions for comparator
- TIntfCompare = function(const Obj1, Obj2: IInterface): Integer;
- TAnsiStrCompare = function(const Obj, Obj2: AnsiString): Integer;
- TWideStrCompare = function(const Obj, Obj2: WideString): Integer;
- {$IFDEF CONTAINER_ANSISTR}
- TStrCompare = TAnsiStrCompare;
- {$ENDIF CONTAINER_ANSISTR}
- {$IFDEF CONTAINER_WIDESTR}
- TStrCompare = TWideStrCompare;
- {$ENDIF CONTAINER_WIDESTR}
- TSingleCompare = function(const Obj1, Obj2: Single): Integer;
- TDoubleCompare = function(const Obj1, Obj2: Double): Integer;
- TExtendedCompare = function(const Obj1, Obj2: Extended): Integer;
- {$IFDEF MATH_SINGLE_PRECISION}
- TFloatCompare = TSingleCompare;
- {$ENDIF MATH_SINGLE_PRECISION}
- {$IFDEF MATH_DOUBLE_PRECISION}
- TFloatCompare = TDoubleCompare;
- {$ENDIF MATH_DOUBLE_PRECISION}
- {$IFDEF MATH_EXTENDED_PRECISION}
- TFloatCompare = TExtendedCompare;
- {$ENDIF MATH_EXTENDED_PRECISION}
- TIntegerCompare = function(Obj1, Obj2: Integer): Integer;
- TCardinalCompare = function(Obj1, Obj2: Cardinal): Integer;
- TInt64Compare = function(const Obj1, Obj2: Int64): Integer;
+// Apply algorithms
+procedure Apply(const First: IJclIntfIterator; Count: Integer; F: TIntfApplyFunction); overload;
+procedure Apply(const First: IJclAnsiStrIterator; Count: Integer; F: TAnsiStrApplyFunction); overload;
+procedure Apply(const First: IJclWideStrIterator; Count: Integer; F: TWideStrApplyFunction); overload;
+procedure Apply(const First: IJclSingleIterator; Count: Integer; F: TSingleApplyFunction); overload;
+procedure Apply(const First: IJclDoubleIterator; Count: Integer; F: TDoubleApplyFunction); overload;
+procedure Apply(const First: IJclExtendedIterator; Count: Integer; F: TExtendedApplyFunction); overload;
+procedure Apply(const First: IJclIntegerIterator; Count: Integer; F: TIntegerApplyFunction); overload;
+procedure Apply(const First: IJclCardinalIterator; Count: Integer; F: TCardinalApplyFunction); overload;
+procedure Apply(const First: IJclInt64Iterator; Count: Integer; F: TInt64ApplyFunction); overload;
+{$IFNDEF CLR}
+procedure Apply(const First: IJclPtrIterator; Count: Integer; F: TPtrApplyFunction); overload;
+{$ENDIF ~CLR}
+procedure Apply(const First: IJclIterator; Count: Integer; F: TApplyFunction); overload;
+
+type
+ TIntfCompare = JclBase.TIntfCompare;
+ TAnsiStrCompare = JclBase.TAnsiStrCompare;
+ TWideStrCompare = JclBase.TWideStrCompare;
+ {$IFNDEF CONTAINER_NOSTR}
+ TStrCompare = JclBase.TStrCompare;
+ {$ENDIF ~CONTAINER_NOSTR}
+ TSingleCompare = JclBase.TSingleCompare;
+ TDoubleCompare = JclBase.TDoubleCompare;
+ TExtendedCompare = JclBase.TExtendedCompare;
+ TFloatCompare = JclBase.TFloatCompare;
+ TIntegerCompare = JclBase.TIntegerCompare;
+ TCardinalCompare = JclBase.TCardinalCompare;
+ TInt64Compare = JclBase.TInt64Compare;
{$IFNDEF CLR}
- TPtrCompare = function(Obj1, Obj2: Pointer): Integer;
+ TPtrCompare = JclBase.TPtrCompare;
{$ENDIF ~CLR}
- TCompare = function(...
[truncated message content] |
|
From: <ah...@us...> - 2007-11-20 18:35:12
|
Revision: 2227
http://jcl.svn.sourceforge.net/jcl/?rev=2227&view=rev
Author: ahuser
Date: 2007-11-20 10:35:10 -0800 (Tue, 20 Nov 2007)
Log Message:
-----------
- InnoSetup 5.2.2modified
- CompInstall.dll moved from JVCL to JCL
Added Paths:
-----------
trunk/thirdparty/InnoSetup/CompInstall/
trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas
trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dpr
trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dproj
trunk/thirdparty/InnoSetup/CompInstall/CompInstall.res
trunk/thirdparty/InnoSetup/InnoSetup/
trunk/thirdparty/InnoSetup/InnoSetup/Builtins.iss
trunk/thirdparty/InnoSetup/InnoSetup/Compil32.exe
trunk/thirdparty/InnoSetup/InnoSetup/Default.isl
trunk/thirdparty/InnoSetup/InnoSetup/ISCC.exe
trunk/thirdparty/InnoSetup/InnoSetup/ISCmplr.dll
trunk/thirdparty/InnoSetup/InnoSetup/ISCmplr.dls
trunk/thirdparty/InnoSetup/InnoSetup/ISCrypt.dll
trunk/thirdparty/InnoSetup/InnoSetup/ISPP.chm
trunk/thirdparty/InnoSetup/InnoSetup/ISetup.chm
trunk/thirdparty/InnoSetup/InnoSetup/InnoSetupSrcPatch.zip
trunk/thirdparty/InnoSetup/InnoSetup/Languages/
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Basque.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/BrazilianPortuguese.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Catalan.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Czech.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Danish.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Dutch.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Finnish.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/French.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/German.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Hebrew.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Hungarian.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Italian.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Norwegian.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Polish.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Portuguese.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Russian.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Slovak.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Slovenian.isl
trunk/thirdparty/InnoSetup/InnoSetup/Languages/Spanish.isl
trunk/thirdparty/InnoSetup/InnoSetup/ModifiedInnoSetup.txt
trunk/thirdparty/InnoSetup/InnoSetup/Setup.e32
trunk/thirdparty/InnoSetup/InnoSetup/SetupLdr.e32
trunk/thirdparty/InnoSetup/InnoSetup/WizModernImage-IS.bmp
trunk/thirdparty/InnoSetup/InnoSetup/WizModernImage.bmp
trunk/thirdparty/InnoSetup/InnoSetup/WizModernSmallImage-IS.bmp
trunk/thirdparty/InnoSetup/InnoSetup/WizModernSmallImage.bmp
trunk/thirdparty/InnoSetup/InnoSetup/isbunzip.dll
trunk/thirdparty/InnoSetup/InnoSetup/isbzip.dll
trunk/thirdparty/InnoSetup/InnoSetup/isetup.chw
trunk/thirdparty/InnoSetup/InnoSetup/isfaq.htm
trunk/thirdparty/InnoSetup/InnoSetup/islzma.dll
trunk/thirdparty/InnoSetup/InnoSetup/isunzlib.dll
trunk/thirdparty/InnoSetup/InnoSetup/iszlib.dll
trunk/thirdparty/InnoSetup/InnoSetup/license.txt
Removed Paths:
-------------
trunk/thirdparty/InnoSetup/CompInstall.txt
Added: trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas
===================================================================
--- trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas (rev 0)
+++ trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas 2007-11-20 18:35:10 UTC (rev 2227)
@@ -0,0 +1,359 @@
+unit CompInst;
+
+interface
+
+uses
+ Windows, SysUtils, Classes, JclBorlandTools;
+
+function Installations: TJclBorRADToolInstallations;
+
+function compinst_init: Integer; stdcall;
+
+function compinst_isDelphiInstalled(Version: Integer): Integer; stdcall;
+function compinst_isBCBInstalled(Version: Integer): Integer; stdcall;
+function compinst_isBDSInstalled(IDEVersion: Integer): Integer; stdcall;
+
+function compinst_installDelphiDesignPackage(Version: Integer; const BplFilename, Description: PChar): Integer; stdcall;
+function compinst_installBCBDesignPackage(Version: Integer; const BplFilename, Description: PChar): Integer; stdcall;
+function compinst_uninstallDelphiDesignPackage(Version: Integer; const BplFilename: PChar): Integer; stdcall;
+function compinst_uninstallBCBDesignPackage(Version: Integer; const BplFilename: PChar): Integer; stdcall;
+function compinst_uninstallDelphiDesignPackagesPrefixed(Version: Integer; BplFilenamePrefix: PChar): Integer; stdcall;
+function compinst_uninstallBCBDesignPackagesPrefixed(Version: Integer; BplFilenamePrefix: PChar): Integer; stdcall;
+
+function compinst_installDelphiExpert(Version: Integer; const Filename, Description: PChar): Integer; stdcall;
+function compinst_installBCBExpert(Version: Integer; const Filename, Description: PChar): Integer; stdcall;
+function compinst_uninstallDelphiExpert(Version: Integer; const Filename: PChar): Integer; stdcall;
+function compinst_uninstallBCBExpert(Version: Integer; const Filename: PChar): Integer; stdcall;
+function compinst_uninstallDelphiExpertsPrefixed(Version: Integer; FilenamePrefix: PChar): Integer; stdcall;
+function compinst_uninstallBCBExpertsPrefixed(Version: Integer; FilenamePrefix: PChar): Integer; stdcall;
+
+function compinst_addDelphiSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+function compinst_addBCBSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+function compinst_removeDelphiSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+function compinst_removeBCBSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+
+implementation
+
+uses
+ JclPeImage, StrUtils;
+
+var
+ GlobalInstallations: TJclBorRADToolInstallations;
+
+function GetPackageDescription(const BplFilename: string): string;
+var
+ hLib: THandle;
+ Info: TJclPePackageInfo;
+begin
+ Result := '';
+ hLib := LoadLibraryEx(PChar(BplFilename), 0, LOAD_LIBRARY_AS_DATAFILE);
+ if hLib <> 0 then
+ begin
+ Info := TJclPePackageInfo.Create(hLib);
+ try
+ Result := Trim(Info.Description);
+ finally
+ Info.Free;
+ end;
+ FreeLibrary(hLib);
+ end;
+ if Result = '' then
+ Result := ChangeFileExt(ExtractFileName(BplFilename), '');
+end;
+
+procedure SplitPaths(List: TStrings; const Paths: string);
+var
+ I, StartI: Integer;
+ S: string;
+begin
+ StartI := 1;
+ for I := 1 to Length(Paths) do
+ begin
+ if Paths[I] = PathSep then
+ begin
+ S := Trim(Copy(Paths, StartI, I - StartI));
+ if S <> '' then
+ List.Add(S);
+ StartI := I + 1;
+ end;
+ end;
+ S := Trim(Copy(Paths, StartI, MaxInt));
+ if S <> '' then
+ List.Add(S);
+end;
+
+function Installations: TJclBorRADToolInstallations;
+begin
+ if GlobalInstallations = nil then
+ GlobalInstallations := TJclBorRADToolInstallations.Create;
+ Result := GlobalInstallations;
+end;
+
+function compinst_init: Integer; stdcall;
+var
+ I: Integer;
+ Inst: TJclBorRADToolInstallation;
+ VStr: string;
+begin
+ Result := Installations.Count;
+ for I := 0 to Installations.Count - 1 do
+ begin
+ Inst := Installations[I];
+ case Inst.RadToolKind of
+ brDelphi:
+ begin
+ VStr := IntToStr(Inst.VersionNumber);
+ SetEnvironmentVariable(PChar('DELPHI' + VStr), PChar(Inst.RootDir));
+ SetEnvironmentVariable(PChar('DELPHI' + VStr + 'BPL'), PChar(Inst.BPLOutputPath));
+ SetEnvironmentVariable(PChar('DELPHI' + VStr + 'DCP'), PChar(Inst.DCPOutputPath));
+ SetEnvironmentVariable(PChar('DELPHI' + VStr + 'RegKey'), PChar(Inst.ConfigDataLocation));
+ end;
+ brCppBuilder:
+ begin
+ VStr := IntToStr(Inst.VersionNumber);
+ SetEnvironmentVariable(PChar('BCB' + VStr), PChar(Inst.RootDir));
+ SetEnvironmentVariable(PChar('BCB' + VStr + 'BPL'), PChar(Inst.BPLOutputPath));
+ SetEnvironmentVariable(PChar('BCB' + VStr + 'DCP'), PChar(Inst.DCPOutputPath));
+ SetEnvironmentVariable(PChar('BCB' + VStr + 'RegKey'), PChar(Inst.ConfigDataLocation));
+ end;
+ brBorlandDevStudio:
+ begin
+ VStr := IntToStr(9 - 3 + Inst.VersionNumber); // Delphi 9 is BDS 3
+ if bpDelphi32 in Inst.Personalities then
+ begin
+ SetEnvironmentVariable(PChar('DELPHI' + VStr), PChar(Inst.RootDir));
+ SetEnvironmentVariable(PChar('DELPHI' + VStr + 'BPL'), PChar(Inst.BPLOutputPath));
+ SetEnvironmentVariable(PChar('DELPHI' + VStr + 'DCP'), PChar(Inst.DCPOutputPath));
+ SetEnvironmentVariable(PChar('DELPHI' + VStr + 'RegKey'), PChar(Inst.ConfigDataLocation));
+ end;
+ if bpBCBuilder32 in Inst.Personalities then
+ begin
+ SetEnvironmentVariable(PChar('BCB' + VStr), PChar(Inst.RootDir));
+ SetEnvironmentVariable(PChar('BCB' + VStr + 'BPL'), PChar(Inst.BPLOutputPath));
+ SetEnvironmentVariable(PChar('BCB' + VStr + 'DCP'), PChar(Inst.DCPOutputPath));
+ SetEnvironmentVariable(PChar('BCB' + VStr + 'RegKey'), PChar(Inst.ConfigDataLocation));
+ end;
+ end;
+ end;
+ end;
+end;
+
+function compinst_IsDelphiInstalled(Version: Integer): Integer; stdcall;
+begin
+ Result := Ord(Installations.DelphiVersionInstalled[Version]);
+end;
+
+function compinst_IsBCBInstalled(Version: Integer): Integer; stdcall;
+begin
+ Result := Ord(Installations.BCBVersionInstalled[Version]);
+end;
+
+function compinst_IsBDSInstalled(IDEVersion: Integer): Integer; stdcall;
+begin
+ Result := Ord(Installations.BCBVersionInstalled[IDEVersion]);
+end;
+
+{ Design Packages }
+
+function InstallDesignPackage(Inst: TJclBorRADToolInstallation; const BplFilename, Description: string): Integer;
+var
+ Filename, Descr: string;
+ MatchFound: TFilenameCaseMatch;
+begin
+ Result := 0;
+ if Inst <> nil then
+ begin
+ Descr := Description;
+ if Descr = '' then
+ Descr := GetPackageDescription(BplFilename);
+ Filename := ExpandFileNameCase(BplFilename, MatchFound); // correct file name
+ if Inst.RegisterPackage(Filename, Descr) then
+ Result := 1;
+ end;
+end;
+
+function UninstallDesignPackage(Inst: TJclBorRADToolInstallation; const BplFilename: string): Integer;
+begin
+ Result := 0;
+ if Inst <> nil then
+ if Inst.UnregisterPackage(BplFilename) then
+ Result := 1;
+end;
+
+function UninstallDesignPackagesPrefixed(Inst: TJclBorRADToolInstallation; const BplFilenamePrefix: string): Integer;
+var
+ I: Integer;
+ Filename: string;
+begin
+ Result := 0;
+ if Inst <> nil then
+ begin
+ for I := Inst.IdePackages.Count - 1 downto 0 do
+ begin
+ FileName := Inst.IdePackages.PackageFileNames[I];
+ if AnsiStartsText(BplFilenamePrefix, ExtractFileName(FileName)) then
+ begin
+ UninstallDesignPackage(Inst, Filename);
+ Inc(Result);
+ end;
+ end;
+ end;
+end;
+
+{ Experts }
+
+function InstallExpert(Inst: TJclBorRADToolInstallation; const Filename, Description: string): Integer;
+var
+ MatchFound: TFilenameCaseMatch;
+begin
+ Result := 0;
+ if Inst <> nil then
+ begin
+ if Inst.RegisterExpert(ExpandFileNameCase(Filename, MatchFound), Description) then
+ Result := 1;
+ end;
+end;
+
+function UninstallExpert(Inst: TJclBorRADToolInstallation; const Filename: string): Integer;
+begin
+ Result := 0;
+ if Inst <> nil then
+ if Inst.UnregisterExpert(Filename) then
+ Result := 1;
+end;
+
+function UninstallExpertsPrefixed(Inst: TJclBorRADToolInstallation; const FilenamePrefix: string): Integer;
+var
+ I: Integer;
+ Filename: string;
+begin
+ Result := 0;
+ if Inst <> nil then
+ begin
+ for I := Inst.IdePackages.ExpertCount - 1 downto 0 do
+ begin
+ FileName := Inst.IdePackages.ExpertFileNames[I];
+ if AnsiStartsText(FilenamePrefix, ExtractFileName(FileName)) then
+ begin
+ UninstallExpert(Inst, Filename);
+ Inc(Result);
+ end;
+ end;
+ end;
+end;
+
+{ Search Paths }
+
+function ChangeSearchPaths(Inst: TJclBorRADToolInstallation; Installing: Boolean; const SearchPaths, DebugPaths, BrowsePaths: string): Integer;
+begin
+ Result := 0;
+ if Inst <> nil then
+ begin
+ if Installing then
+ begin
+ Inst.AddToLibrarySearchPath(SearchPaths);
+ Inst.AddToDebugDCUPath(DebugPaths);
+ Inst.AddToLibraryBrowsingPath(BrowsePaths);
+ end
+ else
+ begin
+ Inst.RemoveFromLibrarySearchPath(SearchPaths);
+ Inst.RemoveFromDebugDCUPath(DebugPaths);
+ Inst.RemoveFromLibraryBrowsingPath(BrowsePaths);
+ end;
+ Result := 1;
+ end;
+end;
+
+{ Design Packages }
+
+function compinst_installDelphiDesignPackage(Version: Integer; const BplFilename, Description: PChar): Integer; stdcall;
+begin
+ Result := InstallDesignPackage(Installations.DelphiInstallationFromVersion[Version], BplFilename, Description);
+end;
+
+function compinst_installBCBDesignPackage(Version: Integer; const BplFilename, Description: PChar): Integer; stdcall;
+begin
+ Result := InstallDesignPackage(Installations.BCBInstallationFromVersion[Version], BplFilename, Description);
+end;
+
+function compinst_uninstallDelphiDesignPackage(Version: Integer; const BplFilename: PChar): Integer; stdcall;
+begin
+ Result := UninstallDesignPackage(Installations.DelphiInstallationFromVersion[Version], BplFilename);
+end;
+
+function compinst_uninstallBCBDesignPackage(Version: Integer; const BplFilename: PChar): Integer; stdcall;
+begin
+ Result := UninstallDesignPackage(Installations.BCBInstallationFromVersion[Version], BplFilename);
+end;
+
+function compinst_uninstallDelphiDesignPackagesPrefixed(Version: Integer; BplFilenamePrefix: PChar): Integer; stdcall;
+begin
+ Result := UninstallDesignPackagesPrefixed(Installations.DelphiInstallationFromVersion[Version], BplFilenamePrefix);
+end;
+
+function compinst_uninstallBCBDesignPackagesPrefixed(Version: Integer; BplFilenamePrefix: PChar): Integer; stdcall;
+begin
+ Result := UninstallDesignPackagesPrefixed(Installations.BCBInstallationFromVersion[Version], BplFilenamePrefix);
+end;
+
+{ Experts }
+
+function compinst_installDelphiExpert(Version: Integer; const Filename, Description: PChar): Integer; stdcall;
+begin
+ Result := InstallExpert(Installations.DelphiInstallationFromVersion[Version], Filename, Description);
+end;
+
+function compinst_installBCBExpert(Version: Integer; const Filename, Description: PChar): Integer; stdcall;
+begin
+ Result := InstallExpert(Installations.BCBInstallationFromVersion[Version], Filename, Description);
+end;
+
+function compinst_uninstallDelphiExpert(Version: Integer; const Filename: PChar): Integer; stdcall;
+begin
+ Result := UninstallExpert(Installations.DelphiInstallationFromVersion[Version], Filename);
+end;
+
+function compinst_uninstallBCBExpert(Version: Integer; const Filename: PChar): Integer; stdcall;
+begin
+ Result := UninstallExpert(Installations.BCBInstallationFromVersion[Version], Filename);
+end;
+
+function compinst_uninstallDelphiExpertsPrefixed(Version: Integer; FilenamePrefix: PChar): Integer; stdcall;
+begin
+ Result := UninstallExpertsPrefixed(Installations.DelphiInstallationFromVersion[Version], FilenamePrefix);
+end;
+
+function compinst_uninstallBCBExpertsPrefixed(Version: Integer; FilenamePrefix: PChar): Integer; stdcall;
+begin
+ Result := UninstallExpertsPrefixed(Installations.BCBInstallationFromVersion[Version], FilenamePrefix);
+end;
+
+{ Search Paths }
+
+function compinst_addDelphiSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+begin
+ Result := ChangeSearchPaths(Installations.DelphiInstallationFromVersion[Version], True, SearchPaths, DebugPaths, BrowsePaths);
+end;
+
+function compinst_addBCBSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+begin
+ Result := ChangeSearchPaths(Installations.BCBInstallationFromVersion[Version], True, SearchPaths, DebugPaths, BrowsePaths);
+end;
+
+function compinst_removeDelphiSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+begin
+ Result := ChangeSearchPaths(Installations.DelphiInstallationFromVersion[Version], False, SearchPaths, DebugPaths, BrowsePaths);
+end;
+
+function compinst_removeBCBSearchPaths(Version: Integer; SearchPaths, DebugPaths, BrowsePaths: PChar): Integer; stdcall;
+begin
+ Result := ChangeSearchPaths(Installations.BCBInstallationFromVersion[Version], False, SearchPaths, DebugPaths, BrowsePaths);
+end;
+
+initialization
+
+finalization
+ Installations.Free;
+
+end.
Added: trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dpr
===================================================================
--- trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dpr (rev 0)
+++ trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dpr 2007-11-20 18:35:10 UTC (rev 2227)
@@ -0,0 +1,39 @@
+library CompInstall;
+
+uses
+ CompInst in 'CompInst.pas';
+
+{$R *.res}
+
+exports
+ compinst_init,
+
+ compinst_isDelphiInstalled,
+ compinst_isBCBInstalled,
+ compinst_isBDSInstalled,
+
+ compinst_installDelphiDesignPackage,
+ compinst_installBCBDesignPackage,
+ compinst_uninstallDelphiDesignPackage,
+ compinst_uninstallBCBDesignPackage,
+ compinst_uninstallDelphiDesignPackagesPrefixed,
+ compinst_uninstallBCBDesignPackagesPrefixed,
+
+ compinst_installDelphiExpert,
+ compinst_installBCBExpert,
+ compinst_uninstallDelphiExpert,
+ compinst_uninstallBCBExpert,
+ compinst_uninstallDelphiExpertsPrefixed,
+ compinst_uninstallBCBExpertsPrefixed,
+
+ compinst_addDelphiSearchPaths,
+ compinst_addBCBSearchPaths,
+ compinst_removeDelphiSearchPaths,
+ compinst_removeBCBSearchPaths;
+
+begin
+
+end.
+
+
+
Added: trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dproj
===================================================================
--- trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dproj (rev 0)
+++ trunk/thirdparty/InnoSetup/CompInstall/CompInstall.dproj 2007-11-20 18:35:10 UTC (rev 2227)
@@ -0,0 +1,47 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{1e742bfd-8538-4b78-8715-0c8ccf190ba4}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
+ <DCC_DependencyCheckOutputName>..\CompInstall.dll</DCC_DependencyCheckOutputName>
+ <MainSource>CompInstall.dpr</MainSource>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <Version>7.0</Version>
+ <DCC_DebugInformation>False</DCC_DebugInformation>
+ <DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+ <DCC_Define>RELEASE</DCC_Define>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <Version>7.0</Version>
+ <DCC_Define>DEBUG</DCC_Define>
+ <DCC_ExeOutput>..\</DCC_ExeOutput>
+ <DCC_DcuOutput>.</DCC_DcuOutput>
+ <DCC_ObjOutput>.</DCC_ObjOutput>
+ <DCC_HppOutput>.</DCC_HppOutput>
+ </PropertyGroup>
+ <ProjectExtensions>
+ <Borland.Personality>Delphi.Personality</Borland.Personality>
+ <Borland.ProjectType />
+ <BorlandProject>
+<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters><Parameters Name="HostApplication">..\project1.exe</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1031</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
+
+
+
+
+ <Excluded_Packages Name="$(BDS)\bin\dclofficexp100.bpl">Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
+ <Excluded_Packages Name="$(BDS)\bin\dcloffice2k100.bpl">Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
+ <Excluded_Packages Name="$(BDS)\bin\bcboffice2k100.bpl">CodeGear C++Builder Office 2000 Servers Package</Excluded_Packages>
+ <Excluded_Packages Name="$(BDS)\bin\bcbofficexp100.bpl">CodeGear C++Builder Office XP Servers Package</Excluded_Packages>
+ </Excluded_Packages><Source><Source Name="MainSource">CompInstall.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
+ </ProjectExtensions>
+ <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
+ <ItemGroup>
+ <DelphiCompile Include="CompInstall.dpr">
+ <MainSource>MainSource</MainSource>
+ </DelphiCompile>
+ <DCCReference Include="CompInst.pas" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
Added: trunk/thirdparty/InnoSetup/CompInstall/CompInstall.res
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/CompInstall/CompInstall.res
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/thirdparty/InnoSetup/CompInstall.txt
===================================================================
--- trunk/thirdparty/InnoSetup/CompInstall.txt 2007-11-15 17:36:08 UTC (rev 2226)
+++ trunk/thirdparty/InnoSetup/CompInstall.txt 2007-11-20 18:35:10 UTC (rev 2227)
@@ -1 +0,0 @@
-The source code of CompInstall.dll is in the JVCL InnoSetup directory.
\ No newline at end of file
Added: trunk/thirdparty/InnoSetup/InnoSetup/Builtins.iss
===================================================================
--- trunk/thirdparty/InnoSetup/InnoSetup/Builtins.iss (rev 0)
+++ trunk/thirdparty/InnoSetup/InnoSetup/Builtins.iss 2007-11-20 18:35:10 UTC (rev 2227)
@@ -0,0 +1,350 @@
+; BEGIN BUILTINS.ISS
+//
+// Inno Setup Preprocessor 5
+//
+// Copyright (C) 2001-2002 Alex Yackimoff. All Rights Reserved.
+// http://ispp.sourceforge.net
+//
+// Inno Setup (C) 1997-2005 Jordan Russell. All Rights Reserved.
+// Portions by Martijn Laan.
+//
+// $Id: Builtins.iss,v 1.9 2007/02/20 13:01:59 mlaan Exp $
+//
+#if defined(ISPP_INVOKED) && !defined(_BUILTINS_ISS_)
+//
+#if PREPROCVER < 0x01000000
+# error Inno Setup Preprocessor version is outdated
+#endif
+//
+#define _BUILTINS_ISS_
+//
+// ===========================================================================
+//
+// Default states for options.
+//
+//#pragma parseroption -b+ ; short circuit boolean evaluation: on
+//#pragma parseroption -m- ; short circuit multiplication evaluation (0 * A will not eval A): off
+//#pragma parseroption -p+ ; string literals without escape sequences: on
+//#pragma parseroption -u- ; allow undeclared identifiers: off
+//#pragma option -c+ ; pass script to the compiler: on
+//#pragma option -e- ; emit empty lines to translation: off
+//#pragma option -v- ; verbose mode: off
+//
+// ---------------------------------------------------------------------------
+//
+// Verbose levels:
+// 0 - #include and #file acknowledgements
+// 1 - information about any temp files created by #file
+// 2 - #insert and #append acknowledgements
+// 3 - reserved
+// 4 - #dim, #define and #undef acknowledgements
+// 5 - reserved
+// 6 - conditional inclusion acknowledgements
+// 7 - reserved
+// 8 - show strings emitted with #emit directive
+// 9 - macro and functions successfull call acknowledgements
+//10 - Local macro array allocation acknowledgements
+//
+//#pragma verboselevel 0
+//
+#ifndef __POPT_P__
+# define private CStrings
+# pragma parseroption -p+
+#endif
+//
+#pragma spansymbol "\"
+//
+#define True 1
+#define False 0
+#define Yes True
+#define No False
+//
+#define MaxInt 0x7FFFFFFFL
+#define MinInt 0x80000000L
+//
+#define NULL
+#define void
+//
+// TypeOf constants
+//
+#define TYPE_ERROR 0
+#define TYPE_NULL 1
+#define TYPE_INTEGER 2
+#define TYPE_STRING 3
+#define TYPE_MACRO 4
+#define TYPE_FUNC 5
+#define TYPE_ARRAY 6
+//
+// Helper macro to find out the type of an array element or expression. TypeOf
+// standard function only allows identifier as its parameter. Use this macro
+// to convert an expression to identifier.
+//
+#define TypeOf2(any Expr) TypeOf(Expr)
+//
+// ReadReg constants
+//
+#define HKEY_CLASSES_ROOT 0x80000000UL
+#define HKEY_CURRENT_USER 0x80000001UL
+#define HKEY_LOCAL_MACHINE 0x80000002UL
+#define HKEY_USERS 0x80000003UL
+//
+#define HKCR HKEY_CLASSES_ROOT
+#define HKCU HKEY_CURRENT_USER
+#define HKLM HKEY_LOCAL_MACHINE
+#define HKU HKEY_USERS
+//
+// Exec constants
+//
+#define SW_HIDE 0
+#define SW_SHOWNORMAL 1
+#define SW_NORMAL 1
+#define SW_SHOWMINIMIZED 2
+#define SW_SHOWMAXIMIZED 3
+#define SW_MAXIMIZE 3
+#define SW_SHOWNOACTIVATE 4
+#define SW_SHOW 5
+#define SW_MINIMIZE 6
+#define SW_SHOWMINNOACTIVE 7
+#define SW_SHOWNA 8
+#define SW_RESTORE 9
+#define SW_SHOWDEFAULT 10
+#define SW_MAX 10
+//
+// Find constants
+//
+#define FIND_MATCH 0x00
+#define FIND_BEGINS 0x01
+#define FIND_ENDS 0x02
+#define FIND_CONTAINS 0x03
+#define FIND_CASESENSITIVE 0x04
+#define FIND_SENSITIVE FIND_CASESENSITIVE
+#define FIND_AND 0x00
+#define FIND_OR 0x08
+#define FIND_NOT 0x10
+#define FIND_TRIM 0x20
+//
+// FindFirst constants
+//
+#define faReadOnly 0x00000001
+#define faHidden 0x00000002
+#define faSysFile 0x00000004
+#define faVolumeID 0x00000008
+#define faDirectory 0x00000010
+#define faArchive 0x00000020
+#define faSymLink 0x00000040
+#define faAnyFile 0x0000003F
+//
+// GetStringFileInfo standard names
+//
+#define COMPANY_NAME "CompanyName"
+#define FILE_DESCRIPTION "FileDescription"
+#define FILE_VERSION "FileVersion"
+#define INTERNAL_NAME "InternalName"
+#define LEGAL_COPYRIGHT "LegalCopyright"
+#define ORIGINAL_FILENAME "OriginalFilename"
+#define PRODUCT_NAME "ProductName"
+#define PRODUCT_VERSION "ProductVersion"
+//
+// GetStringFileInfo helpers
+//
+#define GetFileCompany(str FileName) GetStringFileInfo(FileName, COMPANY_NAME)
+#define GetFileCopyright(str FileName) GetStringFileInfo(FileName, LEGAL_COPYRIGHT)
+#define GetFileDescription(str FileName) GetStringFileInfo(FileName, FILE_DESCRIPTION)
+#define GetFileProductVersion(str FileName) GetStringFileInfo(FileName, PRODUCT_VERSION)
+#define GetFileVersionString(str FileName) GetStringFileInfo(FileName, FILE_VERSION)
+//
+// ParseVersion
+//
+// Macro internally calls GetFileVersion function and parses string returned
+// by that function (in form "0.0.0.0"). All four version elements are stored
+// in by-reference parameters Major, Minor, Rev, and Build. Macro returns
+// string returned by GetFileVersion.
+//
+#define DeleteToFirstPeriod(str *S) \
+ Local[1] = Copy(S, 1, (Local[0] = Pos(".", S)) - 1), \
+ S = Copy(S, Local[0] + 1), \
+ Local[1]
+//
+#define ParseVersion(str FileName, *Major, *Minor, *Rev, *Build) \
+ Local[1] = Local[0] = GetFileVersion(FileName), \
+ Local[1] == "" ? "" : ( \
+ Major = Int(DeleteToFirstPeriod(Local[1])), \
+ Minor = Int(DeleteToFirstPeriod(Local[1])), \
+ Rev = Int(DeleteToFirstPeriod(Local[1])), \
+ Build = Int(Local[1]), \
+ Local[0])
+//
+// EncodeVer
+//
+// Encodes given four version elements to a 32 bit integer number (8 bits for
+// each element, i.e. elements must be within 0...255 range).
+//
+#define EncodeVer(int Major, int Minor, int Revision = 0, int Build = -1) \
+ Major << 24 | (Minor & 0xFF) << 16 | (Revision & 0xFF) << 8 | (Build >= 0 ? Build & 0xFF : 0)
+//
+// DecodeVer
+//
+// Decodes given 32 bit integer encoded version to its string representation,
+// Digits parameter indicates how many elements to show (if the fourth element
+// is 0, it won't be shown anyway).
+//
+#define DecodeVer(int Ver, int Digits = 3) \
+ Str(Ver >> 0x18 & 0xFF) + (Digits > 1 ? "." : "") + \
+ (Digits > 1 ? \
+ Str(Ver >> 0x10 & 0xFF) + (Digits > 2 ? "." : "") : "") + \
+ (Digits > 2 ? \
+ Str(Ver >> 0x08 & 0xFF) + (Digits > 3 && (Local = Ver & 0xFF) ? "." : "") : "") + \
+ (Digits > 3 && Local ? \
+ Str(Ver & 0xFF) : "")
+//
+// FindSection
+//
+// Returns index of the line following the header of the section. This macro
+// is intended to be used with #insert directive.
+//
+#define FindSection(str Section = "Files") \
+ Find(0, "[" + Section + "]", FIND_MATCH | FIND_TRIM) + 1
+//
+// FindSectionEnd
+//
+// Returns index of the line following last entry of the section. This macro
+// is intended to be used with #insert directive.
+//
+#if VER >= 0x03000000
+# define FindNextSection(int Line) \
+ Find(Line, "[", FIND_BEGINS | FIND_TRIM, "]", FIND_ENDS | FIND_AND)
+# define FindSectionEnd(str Section = "Files") \
+ FindNextSection(FindSection(Section))
+#else
+# define FindSectionEnd(str Section = "Files") \
+ FindSection(Section) + EntryCount(Section)
+#endif
+//
+// FindCode
+//
+// Returns index of the line (of translation) following either [Code] section
+// header, or "program" keyword, if any.
+//
+# define FindCode() \
+ Local[1] = FindSection("Code"), \
+ Local[0] = Find(Local[1] - 1, "program", FIND_BEGINS, ";", FIND_ENDS | FIND_AND), \
+ (Local[0] < 0 ? Local[1] : Local[0] + 1)
+//
+// ExtractFilePath
+//
+// Returns directory portion of the given filename without backslash (unless
+// it is a root directory). If PathName doesn't contain directory portion,
+// the result is an empty string.
+//
+#define ExtractFilePath(str PathName) \
+ (Local[0] = \
+ !(Local[1] = RPos("\", PathName)) ? \
+ "" : \
+ Copy(PathName, 1, Local[1] - 1)), \
+ Local[0] + \
+ ((Local[2] = Len(Local[0])) == 2 && Copy(Local[0], Local[2]) == ":" ? \
+ "\" : \
+ "")
+#define ExtractFileDir(str PathName) \
+ RemoveBackslash(ExtractFilePath(PathName))
+
+#define ExtractFileExt(str PathName) \
+ Local[0] = RPos(".", PathName), \
+ Copy(PathName, Local[0] + 1)
+//
+// ExtractFileName
+//
+// Returns name portion of the given filename. If PathName ends with
+// a backslash, the result is an empty string.
+//
+#define ExtractFileName(str PathName) \
+ !(Local[0] = RPos("\", PathName)) ? \
+ PathName : \
+ Copy(PathName, Local[0] + 1)
+//
+// ChangeFileExt
+//
+// Changes extension in FileName with NewExt. NewExt must not contain
+// period.
+//
+#define ChangeFileExt(str FileName, str NewExt) \
+ !(Local[0] = RPos(".", FileName)) ? \
+ FileName + "." + NewExt : \
+ Copy(FileName, 1, Local[0]) + NewExt
+//
+// AddBackslash
+//
+// Adds a backslash to the string, if it's not already there.
+//
+#define AddBackslash(str S) \
+ Copy(S, Len(S)) == "\" ? S : S + "\"
+//
+// RemoveBackslash
+//
+// Removes trailing backslash from the string unless the string points to
+// a root directory.
+//
+#define RemoveBackslash(str S) \
+ Local[0] = Len(S), \
+ Local[0] > 0 ? \
+ Copy(S, Local[0]) == "\" ? \
+ (Local[0] == 3 && Copy(S, 2, 1) == ":" ? \
+ S : \
+ Copy(S, 1, Local[0] - 1)) : \
+ S : \
+ ""
+//
+// Delete
+//
+// Deletes specified number of characters beginning with Index from S. S is
+// passed by reference (therefore is modified). Acts like Delete function in
+// Delphi (from System unit).
+//
+#define Delete(str *S, int Index, int Count = MaxInt) \
+ S = Copy(S, 1, Index - 1) + Copy(S, Index + Count)
+//
+// Insert
+//
+// Inserts specified Substr at Index'th character into S. S is passed by
+// reference (therefore is modified).
+//
+#define Insert(str *S, int Index, str Substr) \
+ Index > Len(S) + 1 ? \
+ S : \
+ S = Copy(S, 1, Index - 1) + SubStr + Copy(S, Index)
+//
+// YesNo, IsDirSet
+//
+// Returns nonzero value if given string is "yes", "true" or "1". Intended to
+// be used with SetupSetting function. This macro replaces YesNo function
+// available in previous releases.
+//
+#define YesNo(str S) \
+ (S = LowerCase(S)) == "yes" || S == "true" || S == "1"
+//
+#define IsDirSet(str SetupDirective) \
+ YesNo(SetupSetting(SetupDirective))
+//
+//
+#define Power(int X, int P = 2) \
+ !P ? 1 : X * Power(X, P - 1)
+//
+#define Min(int A, int B, int C = MaxInt) \
+ A < B ? A < C ? Int(A) : Int(C) : Int(B)
+//
+#define Max(int A, int B, int C = MinInt) \
+ A > B ? A > C ? Int(A) : Int(C) : Int(B)
+//
+
+; The following message can be overriden in ISS script.
+; It is not required by ISPP license agreement, but it would be appreciated
+; if you do not remove this note.
+
+[Messages]
+AboutSetupNote=Inno Setup Preprocessor home page:%nhttp://ispp.sourceforge.net/
+[/Messages]
+#ifdef CStrings
+# pragma parseroption -p-
+#endif
+#endif
+; END BUILTINS.ISS
Added: trunk/thirdparty/InnoSetup/InnoSetup/Compil32.exe
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/Compil32.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/Default.isl
===================================================================
--- trunk/thirdparty/InnoSetup/InnoSetup/Default.isl (rev 0)
+++ trunk/thirdparty/InnoSetup/InnoSetup/Default.isl 2007-11-20 18:35:10 UTC (rev 2227)
@@ -0,0 +1,326 @@
+; *** Inno Setup version 5.1.11+ English messages ***
+;
+; To download user-contributed translations of this file, go to:
+; http://www.jrsoftware.org/is3rdparty.php
+;
+; Note: When translating this text, do not add periods (.) to the end of
+; messages that didn't have them already, because on those messages Inno
+; Setup adds the periods automatically (appending a period would result in
+; two periods being displayed).
+
+[LangOptions]
+; The following three entries are very important. Be sure to read and
+; understand the '[LangOptions] section' topic in the help file.
+LanguageName=English
+LanguageID=$0409
+LanguageCodePage=0
+; If the language you are translating to requires special font faces or
+; sizes, uncomment any of the following entries and change them accordingly.
+;DialogFontName=
+;DialogFontSize=8
+;WelcomeFontName=Verdana
+;WelcomeFontSize=12
+;TitleFontName=Arial
+;TitleFontSize=29
+;CopyrightFontName=Arial
+;CopyrightFontSize=8
+
+[Messages]
+
+; *** Application titles
+SetupAppTitle=Setup
+SetupWindowTitle=Setup - %1
+UninstallAppTitle=Uninstall
+UninstallAppFullTitle=%1 Uninstall
+
+; *** Misc. common
+InformationTitle=Information
+ConfirmTitle=Confirm
+ErrorTitle=Error
+
+; *** SetupLdr messages
+SetupLdrStartupMessage=This will install %1. Do you wish to continue?
+LdrCannotCreateTemp=Unable to create a temporary file. Setup aborted
+LdrCannotExecTemp=Unable to execute file in the temporary directory. Setup aborted
+
+; *** Startup error messages
+LastErrorMessage=%1.%n%nError %2: %3
+SetupFileMissing=The file %1 is missing from the installation directory. Please correct the problem or obtain a new copy of the program.
+SetupFileCorrupt=The setup files are corrupted. Please obtain a new copy of the program.
+SetupFileCorruptOrWrongVer=The setup files are corrupted, or are incompatible with this version of Setup. Please correct the problem or obtain a new copy of the program.
+NotOnThisPlatform=This program will not run on %1.
+OnlyOnThisPlatform=This program must be run on %1.
+OnlyOnTheseArchitectures=This program can only be installed on versions of Windows designed for the following processor architectures:%n%n%1
+MissingWOW64APIs=The version of Windows you are running does not include functionality required by Setup to perform a 64-bit installation. To correct this problem, please install Service Pack %1.
+WinVersionTooLowError=This program requires %1 version %2 or later.
+WinVersionTooHighError=This program cannot be installed on %1 version %2 or later.
+AdminPrivilegesRequired=You must be logged in as an administrator when installing this program.
+PowerUserPrivilegesRequired=You must be logged in as an administrator or as a member of the Power Users group when installing this program.
+SetupAppRunningError=Setup has detected that %1 is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
+UninstallAppRunningError=Uninstall has detected that %1 is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
+
+; *** Misc. errors
+ErrorCreatingDir=Setup was unable to create the directory "%1"
+ErrorTooManyFilesInDir=Unable to create a file in the directory "%1" because it contains too many files
+
+; *** Setup common messages
+ExitSetupTitle=Exit Setup
+ExitSetupMessage=Setup is not complete. If you exit now, the program will not be installed.%n%nYou may run Setup again at another time to complete the installation.%n%nExit Setup?
+AboutSetupMenuItem=&About Setup...
+AboutSetupTitle=About Setup
+AboutSetupMessage=%1 version %2%n%3%n%n%1 home page:%n%4
+AboutSetupNote=
+TranslatorNote=
+
+; *** Buttons
+ButtonBack=< &Back
+ButtonNext=&Next >
+ButtonInstall=&Install
+ButtonOK=OK
+ButtonCancel=Cancel
+ButtonYes=&Yes
+ButtonYesToAll=Yes to &All
+ButtonNo=&No
+ButtonNoToAll=N&o to All
+ButtonFinish=&Finish
+ButtonBrowse=&Browse...
+ButtonWizardBrowse=B&rowse...
+ButtonNewFolder=&Make New Folder
+
+; *** "Select Language" dialog messages
+SelectLanguageTitle=Select Setup Language
+SelectLanguageLabel=Select the language to use during the installation:
+
+; *** Common wizard text
+ClickNext=Click Next to continue, or Cancel to exit Setup.
+BeveledLabel=
+BrowseDialogTitle=Browse For Folder
+BrowseDialogLabel=Select a folder in the list below, then click OK.
+NewFolderName=New Folder
+
+; *** "Welcome" wizard page
+WelcomeLabel1=Welcome to the [name] Setup Wizard
+WelcomeLabel2=This will install [name/ver] on your computer.%n%nIt is recommended that you close all other applications before continuing.
+
+; *** "Password" wizard page
+WizardPassword=Password
+PasswordLabel1=This installation is password protected.
+PasswordLabel3=Please provide the password, then click Next to continue. Passwords are case-sensitive.
+PasswordEditLabel=&Password:
+IncorrectPassword=The password you entered is not correct. Please try again.
+
+; *** "License Agreement" wizard page
+WizardLicense=License Agreement
+LicenseLabel=Please read the following important information before continuing.
+LicenseLabel3=Please read the following License Agreement. You must accept the terms of this agreement before continuing with the installation.
+LicenseAccepted=I &accept the agreement
+LicenseNotAccepted=I &do not accept the agreement
+
+; *** "Information" wizard pages
+WizardInfoBefore=Information
+InfoBeforeLabel=Please read the following important information before continuing.
+InfoBeforeClickLabel=When you are ready to continue with Setup, click Next.
+WizardInfoAfter=Information
+InfoAfterLabel=Please read the following important information before continuing.
+InfoAfterClickLabel=When you are ready to continue with Setup, click Next.
+
+; *** "User Information" wizard page
+WizardUserInfo=User Information
+UserInfoDesc=Please enter your information.
+UserInfoName=&User Name:
+UserInfoOrg=&Organization:
+UserInfoSerial=&Serial Number:
+UserInfoNameRequired=You must enter a name.
+
+; *** "Select Destination Location" wizard page
+WizardSelectDir=Select Destination Location
+SelectDirDesc=Where should [name] be installed?
+SelectDirLabel3=Setup will install [name] into the following folder.
+SelectDirBrowseLabel=To continue, click Next. If you would like to select a different folder, click Browse.
+DiskSpaceMBLabel=At least [mb] MB of free disk space is required.
+ToUNCPathname=Setup cannot install to a UNC pathname. If you are trying to install to a network, you will need to map a network drive.
+InvalidPath=You must enter a full path with drive letter; for example:%n%nC:\APP%n%nor a UNC path in the form:%n%n\\server\share
+InvalidDrive=The drive or UNC share you selected does not exist or is not accessible. Please select another.
+DiskSpaceWarningTitle=Not Enough Disk Space
+DiskSpaceWarning=Setup requires at least %1 KB of free space to install, but the selected drive only has %2 KB available.%n%nDo you want to continue anyway?
+DirNameTooLong=The folder name or path is too long.
+InvalidDirName=The folder name is not valid.
+BadDirName32=Folder names cannot include any of the following characters:%n%n%1
+DirExistsTitle=Folder Exists
+DirExists=The folder:%n%n%1%n%nalready exists. Would you like to install to that folder anyway?
+DirDoesntExistTitle=Folder Does Not Exist
+DirDoesntExist=The folder:%n%n%1%n%ndoes not exist. Would you like the folder to be created?
+
+; *** "Select Components" wizard page
+WizardSelectComponents=Select Components
+SelectComponentsDesc=Which components should be installed?
+SelectComponentsLabel2=Select the components you want to install; clear the components you do not want to install. Click Next when you are ready to continue.
+FullInstallation=Full installation
+; if possible don't translate 'Compact' as 'Minimal' (I mean 'Minimal' in your language)
+CompactInstallation=Compact installation
+CustomInstallation=Custom installation
+NoUninstallWarningTitle=Components Exist
+NoUninstallWarning=Setup has detected that the following components are already installed on your computer:%n%n%1%n%nDeselecting these components will not uninstall them.%n%nWould you like to continue anyway?
+ComponentSize1=%1 KB
+ComponentSize2=%1 MB
+ComponentsDiskSpaceMBLabel=Current selection requires at least [mb] MB of disk space.
+
+; *** "Select Additional Tasks" wizard page
+WizardSelectTasks=Select Additional Tasks
+SelectTasksDesc=Which additional tasks should be performed?
+SelectTasksLabel2=Select the additional tasks you would like Setup to perform while installing [name], then click Next.
+
+; *** "Select Start Menu Folder" wizard page
+WizardSelectProgramGroup=Select Start Menu Folder
+SelectStartMenuFolderDesc=Where should Setup place the program's shortcuts?
+SelectStartMenuFolderLabel3=Setup will create the program's shortcuts in the following Start Menu folder.
+SelectStartMenuFolderBrowseLabel=To continue, click Next. If you would like to select a different folder, click Browse.
+MustEnterGroupName=You must enter a folder name.
+GroupNameTooLong=The folder name or path is too long.
+InvalidGroupName=The folder name is not valid.
+BadGroupName=The folder name cannot include any of the following characters:%n%n%1
+NoProgramGroupCheck2=&Don't create a Start Menu folder
+
+; *** "Ready to Install" wizard page
+WizardReady=Ready to Install
+ReadyLabel1=Setup is now ready to begin installing [name] on your computer.
+ReadyLabel2a=Click Install to continue with the installation, or click Back if you want to review or change any settings.
+ReadyLabel2b=Click Install to continue with the installation.
+ReadyMemoUserInfo=User information:
+ReadyMemoDir=Destination location:
+ReadyMemoType=Setup type:
+ReadyMemoComponents=Selected components:
+ReadyMemoGroup=Start Menu folder:
+ReadyMemoTasks=Additional tasks:
+
+; *** "Preparing to Install" wizard page
+WizardPreparing=Preparing to Install
+PreparingDesc=Setup is preparing to install [name] on your computer.
+PreviousInstallNotCompleted=The installation/removal of a previous program was not completed. You will need to restart your computer to complete that installation.%n%nAfter restarting your computer, run Setup again to complete the installation of [name].
+CannotContinue=Setup cannot continue. Please click Cancel to exit.
+
+; *** "Installing" wizard page
+WizardInstalling=Installing
+InstallingLabel=Please wait while Setup installs [name] on your computer.
+
+; *** "Setup Completed" wizard page
+FinishedHeadingLabel=Completing the [name] Setup Wizard
+FinishedLabelNoIcons=Setup has finished installing [name] on your computer.
+FinishedLabel=Setup has finished installing [name] on your computer. The application may be launched by selecting the installed icons.
+ClickFinish=Click Finish to exit Setup.
+FinishedRestartLabel=To complete the installation of [name], Setup must restart your computer. Would you like to restart now?
+FinishedRestartMessage=To complete the installation of [name], Setup must restart your computer.%n%nWould you like to restart now?
+ShowReadmeCheck=Yes, I would like to view the README file
+YesRadio=&Yes, restart the computer now
+NoRadio=&No, I will restart the computer later
+; used for example as 'Run MyProg.exe'
+RunEntryExec=Run %1
+; used for example as 'View Readme.txt'
+RunEntryShellExec=View %1
+
+; *** "Setup Needs the Next Disk" stuff
+ChangeDiskTitle=Setup Needs the Next Disk
+SelectDiskLabel2=Please insert Disk %1 and click OK.%n%nIf the files on this disk can be found in a folder other than the one displayed below, enter the correct path or click Browse.
+PathLabel=&Path:
+FileNotInDir2=The file "%1" could not be located in "%2". Please insert the correct disk or select another folder.
+SelectDirectoryLabel=Please specify the location of the next disk.
+
+; *** Installation phase messages
+SetupAborted=Setup was not completed.%n%nPlease correct the problem and run Setup again.
+EntryAbortRetryIgnore=Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation.
+
+; *** Installation status messages
+StatusCreateDirs=Creating directories...
+StatusExtractFiles=Extracting files...
+StatusCreateIcons=Creating shortcuts...
+StatusCreateIniEntries=Creating INI entries...
+StatusCreateRegistryEntries=Creating registry entries...
+StatusRegisterFiles=Registering files...
+StatusSavingUninstall=Saving uninstall information...
+StatusRunProgram=Finishing installation...
+StatusRollback=Rolling back changes...
+
+; *** Misc. errors
+ErrorInternal2=Internal error: %1
+ErrorFunctionFailedNoCode=%1 failed
+ErrorFunctionFailed=%1 failed; code %2
+ErrorFunctionFailedWithMessage=%1 failed; code %2.%n%3
+ErrorExecutingProgram=Unable to execute file:%n%1
+
+; *** Registry errors
+ErrorRegOpenKey=Error opening registry key:%n%1\%2
+ErrorRegCreateKey=Error creating registry key:%n%1\%2
+ErrorRegWriteKey=Error writing to registry key:%n%1\%2
+
+; *** INI errors
+ErrorIniEntry=Error creating INI entry in file "%1".
+
+; *** File copying errors
+FileAbortRetryIgnore=Click Retry to try again, Ignore to skip this file (not recommended), or Abort to cancel installation.
+FileAbortRetryIgnore2=Click Retry to try again, Ignore to proceed anyway (not recommended), or Abort to cancel installation.
+SourceIsCorrupted=The source file is corrupted
+SourceDoesntExist=The source file "%1" does not exist
+ExistingFileReadOnly=The existing file is marked as read-only.%n%nClick Retry to remove the read-only attribute and try again, Ignore to skip this file, or Abort to cancel installation.
+ErrorReadingExistingDest=An error occurred while trying to read the existing file:
+FileExists=The file already exists.%n%nWould you like Setup to overwrite it?
+ExistingFileNewer=The existing file is newer than the one Setup is trying to install. It is recommended that you keep the existing file.%n%nDo you want to keep the existing file?
+ErrorChangingAttr=An error occurred while trying to change the attributes of the existing file:
+ErrorCreatingTemp=An error occurred while trying to create a file in the destination directory:
+ErrorReadingSource=An error occurred while trying to read the source file:
+ErrorCopying=An error occurred while trying to copy a file:
+ErrorReplacingExistingFile=An error occurred while trying to replace the existing file:
+ErrorRestartReplace=RestartReplace failed:
+ErrorRenamingTemp=An error occurred while trying to rename a file in the destination directory:
+ErrorRegisterServer=Unable to register the DLL/OCX: %1
+ErrorRegSvr32Failed=RegSvr32 failed with exit code %1
+ErrorRegisterTypeLib=Unable to register the type library: %1
+
+; *** Post-installation errors
+ErrorOpeningReadme=An error occurred while trying to open the README file.
+ErrorRestartingComputer=Setup was unable to restart the computer. Please do this manually.
+
+; *** Uninstaller messages
+UninstallNotFound=File "%1" does not exist. Cannot uninstall.
+UninstallOpenError=File "%1" could not be opened. Cannot uninstall
+UninstallUnsupportedVer=The uninstall log file "%1" is in a format not recognized by this version of the uninstaller. Cannot uninstall
+UninstallUnknownEntry=An unknown entry (%1) was encountered in the uninstall log
+ConfirmUninstall=Are you sure you want to completely remove %1 and all of its components?
+UninstallOnlyOnWin64=This installation can only be uninstalled on 64-bit Windows.
+OnlyAdminCanUninstall=This installation can only be uninstalled by a user with administrative privileges.
+UninstallStatusLabel=Please wait while %1 is removed from your computer.
+UninstalledAll=%1 was successfully removed from your computer.
+UninstalledMost=%1 uninstall complete.%n%nSome elements could not be removed. These can be removed manually.
+UninstalledAndNeedsRestart=To complete the uninstallation of %1, your computer must be restarted.%n%nWould you like to restart now?
+UninstallDataCorrupted="%1" file is corrupted. Cannot uninstall
+
+; *** Uninstallation phase messages
+ConfirmDeleteSharedFileTitle=Remove Shared File?
+ConfirmDeleteSharedFile2=The system indicates that the following shared file is no longer in use by any programs. Would you like for Uninstall to remove this shared file?%n%nIf any programs are still using this file and it is removed, those programs may not function properly. If you are unsure, choose No. Leaving the file on your system will not cause any harm.
+SharedFileNameLabel=File name:
+SharedFileLocationLabel=Location:
+WizardUninstalling=Uninstall Status
+StatusUninstalling=Uninstalling %1...
+
+; *** WebDownload messages
+WebDownloadConnecting=Connecting...
+WebDownloadDisconnecting=Disconnecting...
+WebDownloadDownloading=Downloading...
+WebDownloadElapsed=[%1 KB] (%2 elapsed)
+WebDownloadRemaining=(%1 remaining)
+WebDownloadFailed=Downloading from "%1" failed
+WebDownloadUnknownProtocol=The protocol "%1" is not supported
+
+; The custom messages below aren't used by Setup itself, but if you make
+; use of them in your scripts, you'll want to translate them.
+
+[CustomMessages]
+
+NameAndVersion=%1 version %2
+AdditionalIcons=Additional icons:
+CreateDesktopIcon=Create a &desktop icon
+CreateQuickLaunchIcon=Create a &Quick Launch icon
+ProgramOnTheWeb=%1 on the Web
+UninstallProgram=Uninstall %1
+LaunchProgram=Launch %1
+AssocFileExtension=&Associate %1 with the %2 file extension
+AssocingFileExtension=Associating %1 with the %2 file extension...
Added: trunk/thirdparty/InnoSetup/InnoSetup/ISCC.exe
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/ISCC.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/ISCmplr.dll
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/ISCmplr.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/ISCmplr.dls
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/ISCmplr.dls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/ISCrypt.dll
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/ISCrypt.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/ISPP.chm
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/ISPP.chm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/ISetup.chm
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/ISetup.chm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/InnoSetupSrcPatch.zip
===================================================================
(Binary files differ)
Property changes on: trunk/thirdparty/InnoSetup/InnoSetup/InnoSetupSrcPatch.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/thirdparty/InnoSetup/InnoSetup/Languages/Basque.isl
===================================================================
--- trunk/thirdparty/InnoSetup/InnoSetup/Languages/Basque.isl (rev 0)
+++ trunk/thirdparty/InnoSetup/InnoSetup/Languages/Basque.isl 2007-11-20 18:35:10 UTC (rev 2227)
@@ -0,0 +1,318 @@
+; *** Inno Setup version 5.1.11+ Basque messages ***
+;
+; Translated by 3ARRANO (3a...@3a...)
+;
+; To download user-contributed translations of this file, go to:
+; http://www.jrsoftware.org/is3rdparty.php
+;
+; Note: When translating this text, do not add periods (.) to the end of
+; messages that didn't have them already, because on those messages Inno
+; Setup adds the periods automatically (appending a period would result in
+; two periods being displayed).
+
+[LangOptions]
+; The following three entries are very important. Be sure to read and
+; understand the '[LangOptions] section' topic in the help file.
+LanguageName=Euskara
+LanguageID=$042d
+LanguageCodePage=0
+; If the language you are translating to requires special font faces or
+; sizes, uncomment any of the following entries and change them accordingly.
+;DialogFontName=
+;DialogFontSize=8
+;WelcomeFontName=Verdana
+;WelcomeFontSize=12
+;TitleFontName=Arial
+;TitleFontSize=29
+;CopyrightFontName=Arial
+;CopyrightFontSize=8
+
+[Messages]
+
+; *** Application titles
+SetupAppTitle=Instalaketa
+SetupWindowTitle=Instalaketa - %1
+UninstallAppTitle=Desinstalaketa
+UninstallAppFullTitle=Desinstalaketa - %1
+
+; *** Misc. common
+InformationTitle=Argibideak
+ConfirmTitle=Berretsi
+ErrorTitle=Akatsa
+
+; *** SetupLdr messages
+SetupLdrStartupMessage=Programa honek %1 instalatuko du. Jarraitu nahi duzu?
+LdrCannotCreateTemp=Ezin izan da aldi baterako fitxategirik sortu. Instalaketa ezeztatu da
+LdrCannotExecTemp=Aldi baterako karpetako fitxategia ezin izan da abiarazi. Instalaketa ezeztatu da
+; *** Startup error messages
+LastErrorMessage=%1.%n%n%2 akatsa: %3
+SetupFileMissing=Ez da %1 fitxategia aurkitu instalaketaren direktorioan. Zuzendu arazoa edo eskuratu programaren kopia berri bat.
+SetupFileCorrupt=Instalaketa fitxategiak hondaturik daude. Eskuratu programaren kopia berri bat.
+SetupFileCorruptOrWrongVer=Instalaketa fitxategiak hondaturik daude, edo ez dira instalatzailearen bertsio honekin bateragarriak. Zuzendu arazoa edo eskuratu programaren kopia berri bat.
+NotOnThisPlatform=Programa hau ez dabil %1 sistemapean.
+OnlyOnThisPlatform=Programa hau %1 sistemapean soilik dabil.
+OnlyOnTheseArchitectures=Programa hau ondorengo prozesagailuen arkitekturetarako diseinatu diren Windowsen bertsioetan soilik instala daiteke:%n%n%1
+MissingWOW64APIs=Darabilzun Windowsen bertsioak ez dakar 64-biteko instalaketa bat burutzeko instalatzaileak behar duen funtzionalitaterik. Arazo hau konpontzeko, instalatu Service Pack %1 zerbitzu paketea.
+WinVersionTooLowError=Programa honek %1 %2 edo bertsio berriagoa behar du.
+WinVersionTooHighError=Programa hau ezin da instalatu %1 %2 edo bertsio berriagoan.
+AdminPrivilegesRequired=Programa hau instalatzeko administratzaile gisa hasi behar duzu saioa.
+PowerUserPrivilegesRequired=Programa hau instalatzeko administratzaile gisa edo Agintedun Erabiltzaileen taldeko kide gisa hasi behar duzu saioa.
+SetupAppRunningError=Instalatzaileak une honetan %1 irekita dagoela nabaritu du.%n%nItxi bere leiho guztiak, ondoren klikatu Ados jarraitzeko, edo Utzi irteteko.
+UninstallAppRunningError=Instalatzaileak une honetan %1 irekita dagoela nabaritu du.%n%nItxi bere leiho guztiak, ondoren klikatu Ados jarraitzeko, edo Utzi irteteko.
+
+; *** Misc. errors
+ErrorCreatingDir=Instalatzaileak ezin izan du "%1" direktorioa sortu
+ErrorTooManyFilesInDir=Ezinezkoa izan da "%1" direktorioan fitxategi bat sortzea, fitxategi gehiegi dituelako barnean
+
+; *** Setup common messages
+ExitSetupTitle=Instalatzailetik Irten
+ExitSetupMessage=Instalaketa ez da burutu. Orain irtenez gero, programa ez da instalatuko.%n%nInstalaketa burutzeko edonoiz ireki dezakezu berriro instalatzailea.%n%nInstalatzailetik Irten?
+AboutSetupMenuItem=&Instalatzaileari Buruz...
+AboutSetupTitle=Instalatzaileari Buruz
+AboutSetupMessage=%1 %2%n%3%n%n%1en webgunea :%n%4
+AboutSetupNote=
+TranslatorNote=
+
+; *** Buttons
+ButtonBack=< A&urrekoa
+ButtonNext=&Hurrengoa >
+ButtonInstall=&Instalatu
+ButtonOK=Ados
+ButtonCancel=Utzi
+ButtonYes=&Bai
+ButtonYesToAll=Bai &Guztiari
+ButtonNo=&Ez
+ButtonNoToAll=E&z Guztiari
+ButtonFinish=A&maitu
+ButtonBrowse=&Arakatu...
+ButtonWizardBrowse=A&rakatu...
+ButtonNewFolder=&Karpeta Berria Sortu
+
+; *** "Select Language" dialog messages
+SelectLanguageTitle=Hautatu Instalatzailearen Hizkuntza
+SelectLanguageLabel=Hautatu instalaketarako erabili nahi duzun hizkuntza:
+
+; *** Common wizard text
+ClickNext=Klikatu Hurrengoa jarraitzeko, edo Utzi instalatzailetik irteteko.
+BeveledLabel=
+BrowseDialogTitle=Karpetak Arakatu
+BrowseDialogLabel=Hautatu karpeta bat azpiko zerrendan, ondoren klikatu Ados.
+NewFolderName=Karpeta Berria
+
+; *** "Welcome" wizard page
+WelcomeLabel1=Ongietorri [name] Instalatzeko Morroira
+WelcomeLabel2=Programa honek [name/ver] zure konputagailuan instalatuko du.%n%nGomendagarria da jarraitu aurretik gainontzeko aplikazioak ixtea.
+
+; *** "Password" wizard page
+WizardPassword=Pasahitza
+PasswordLabel1=Instalaketa hau pasahitzez babesturik dago.
+PasswordLabel3=Sartu pasahitza, ondoren klikatu Hurrengoa jarraitzeko. Pasahitzetan maiuskulak bereizten dira.
+PasswordEditLabel=&Pasahitza:
+IncorrectPassword=Sartu duzun pasahitza ez da zuzena. Saiatu berriro.
+
+; *** "License Agreement" wizard page
+WizardLicense=Lizentziaren Onarpena
+LicenseLabel=Irakurri ondorengo argibide garrantzitsu hauek jarraitu aurretik.
+LicenseLabel3=Irakurri ondo...
[truncated message content] |
|
From: <ou...@us...> - 2007-11-15 17:36:15
|
Revision: 2226
http://jcl.svn.sourceforge.net/jcl/?rev=2226&view=rev
Author: outchy
Date: 2007-11-15 09:36:08 -0800 (Thu, 15 Nov 2007)
Log Message:
-----------
Test with JCF 2.32
Modified Paths:
--------------
branches/code_format/jcl/examples/common/containers/algorithms/AlgorithmsExampleMain.pas
branches/code_format/jcl/examples/common/containers/hashing/HashingExampleMain.pas
branches/code_format/jcl/examples/common/containers/lists/ListExampleMain.pas
branches/code_format/jcl/examples/common/containers/lists/MyObjectList.pas
branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceMain.pas
branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceTests.pas
branches/code_format/jcl/examples/common/containers/trees/TreeExampleMain.pas
branches/code_format/jcl/examples/common/expreval/QExprEvalExampleMain.pas
branches/code_format/jcl/examples/common/filesearch/QFileSearchDemoMain.pas
branches/code_format/jcl/examples/common/graphics/QClipLineDemoMain.pas
branches/code_format/jcl/examples/common/graphics/StretchGraphicDemoMain.pas
branches/code_format/jcl/examples/common/multimedia/MidiOutExampleMain.pas
branches/code_format/jcl/examples/common/multimedia/MidiOutExampleTuningDlg.pas
branches/code_format/jcl/examples/common/numformat/QNumFormatExampleMain.pas
branches/code_format/jcl/examples/common/pcre/PCREDemoMain.pas
branches/code_format/jcl/examples/common/pcre/QPCREDemoMain.pas
branches/code_format/jcl/examples/common/rtti/QRTTIDemoMain.pas
branches/code_format/jcl/examples/common/rtti/RTTIDemoMain.pas
branches/code_format/jcl/examples/common/sysinfo/QEnvironmentExampleMain.pas
branches/code_format/jcl/examples/common/textreader/TextReaderDemoMain.pas
branches/code_format/jcl/examples/windows/appinst/AppInstDemoMain.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoAbstractFrame.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoBlobForm.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoCLRFrame.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoGuidForm.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoMain.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoMetaDataFrame.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoStringsForm.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoTableForm.pas
branches/code_format/jcl/examples/windows/clr/ClrDemoUserStringsForm.pas
branches/code_format/jcl/examples/windows/debug/framestrack/FramesTrackDemoMain.pas
branches/code_format/jcl/examples/windows/debug/reportconverter/formConverter.pas
branches/code_format/jcl/examples/windows/debug/sourceloc/SourceLocDemoMain.pas
branches/code_format/jcl/examples/windows/debug/stacktrack/StackTrackDLLsComLibrary_TLB.pas
branches/code_format/jcl/examples/windows/debug/stacktrack/StackTrackDLLsDemoMain.pas
branches/code_format/jcl/examples/windows/delphitools/common/About.pas
branches/code_format/jcl/examples/windows/delphitools/common/D6MdiMsgFix.pas
branches/code_format/jcl/examples/windows/delphitools/common/FindDlg.pas
branches/code_format/jcl/examples/windows/delphitools/common/SHDocVw_TLB.pas
branches/code_format/jcl/examples/windows/delphitools/common/ToolsUtils.pas
branches/code_format/jcl/examples/windows/delphitools/dependencyviewer/DependViewMain.pas
branches/code_format/jcl/examples/windows/delphitools/dependencyviewer/FileViewer.pas
branches/code_format/jcl/examples/windows/delphitools/peviewer/PeDump.pas
branches/code_format/jcl/examples/windows/delphitools/peviewer/PeGenDef.pas
branches/code_format/jcl/examples/windows/delphitools/peviewer/PeResView.pas
branches/code_format/jcl/examples/windows/delphitools/peviewer/PeResource.pas
branches/code_format/jcl/examples/windows/delphitools/peviewer/PeSearch.pas
branches/code_format/jcl/examples/windows/delphitools/peviewer/PeViewerControl.pas
branches/code_format/jcl/examples/windows/delphitools/peviewer/PeViewerMain.pas
branches/code_format/jcl/examples/windows/delphitools/resfix/ResFixMain.pas
branches/code_format/jcl/examples/windows/delphitools/screenjpg/Main.pas
branches/code_format/jcl/examples/windows/delphitools/toolhelpview/ChangePriority.pas
branches/code_format/jcl/examples/windows/delphitools/toolhelpview/Global.pas
branches/code_format/jcl/examples/windows/delphitools/toolhelpview/HeapDump.pas
branches/code_format/jcl/examples/windows/delphitools/toolhelpview/Main.pas
branches/code_format/jcl/examples/windows/delphitools/toolhelpview/MemoryDump.pas
branches/code_format/jcl/examples/windows/delphitools/toolhelpview/ModulesDump.pas
branches/code_format/jcl/examples/windows/delphitools/toolhelpview/ViewTemplate.pas
branches/code_format/jcl/examples/windows/edisdk/EDICOMExampleMain.pas
branches/code_format/jcl/examples/windows/edisdk/EDISDK_TLB.pas
branches/code_format/jcl/examples/windows/edisdk/comserver/EDISDK_TLB.pas
branches/code_format/jcl/examples/windows/edisdk/comserver/JclEDICOM_ANSIX12.pas
branches/code_format/jcl/examples/windows/filesummary/FileSummaryDemoMain.pas
branches/code_format/jcl/examples/windows/fileversion/VerInfoDemoMain.pas
branches/code_format/jcl/examples/windows/lanman/LanManDemoMain.pas
branches/code_format/jcl/examples/windows/locales/LocalesDemoMain.pas
branches/code_format/jcl/examples/windows/mapi/MapiDemoMain.pas
branches/code_format/jcl/examples/windows/multimedia/MultimediaDemoMain.pas
branches/code_format/jcl/examples/windows/ntfs/SoftLinkDragDropHandler.pas
branches/code_format/jcl/examples/windows/ntservice/NtSvcDemoDependent.pas
branches/code_format/jcl/examples/windows/ntservice/NtSvcDemoGroups.pas
branches/code_format/jcl/examples/windows/ntservice/NtSvcDemoMain.pas
branches/code_format/jcl/examples/windows/peimage/ApiHookDemoMain.pas
branches/code_format/jcl/examples/windows/peimage/UnmangleNameDemoMain.pas
branches/code_format/jcl/examples/windows/registry/RegistryDemoMain.pas
branches/code_format/jcl/examples/windows/structstorage/HexDump.pas
branches/code_format/jcl/examples/windows/structstorage/PropsFrm.pas
branches/code_format/jcl/examples/windows/structstorage/StructStorageExampleMain.pas
branches/code_format/jcl/examples/windows/sysinfo/SysInfoDemoMain.pas
branches/code_format/jcl/examples/windows/tasks/TaskDemoDataModule.pas
branches/code_format/jcl/examples/windows/tasks/TaskDemoMain.pas
branches/code_format/jcl/examples/windows/widestring/WideStringDemoMain.pas
branches/code_format/jcl/experts/common/JclOtaActionConfigureSheet.pas
branches/code_format/jcl/experts/common/JclOtaConfigurationForm.pas
branches/code_format/jcl/experts/common/JclOtaConsts.pas
branches/code_format/jcl/experts/common/JclOtaExceptionForm.pas
branches/code_format/jcl/experts/common/JclOtaResources.pas
branches/code_format/jcl/experts/common/JclOtaUtils.pas
branches/code_format/jcl/experts/common/JclOtaWizardForm.pas
branches/code_format/jcl/experts/common/JclOtaWizardFrame.pas
branches/code_format/jcl/experts/debug/JclDebugThread.pas
branches/code_format/jcl/experts/debug/converter/JclDebugIdeImpl.pas
branches/code_format/jcl/experts/debug/converter/JclDebugIdeResult.pas
branches/code_format/jcl/experts/debug/dialog/ClxExceptDlg.pas
branches/code_format/jcl/experts/debug/dialog/ExceptDlg.pas
branches/code_format/jcl/experts/debug/dialog/ExceptDlgMail.pas
branches/code_format/jcl/experts/debug/dialog/JclOtaExcDlgFileFrame.pas
branches/code_format/jcl/experts/debug/dialog/JclOtaExcDlgRepository.pas
branches/code_format/jcl/experts/debug/dialog/JclOtaExcDlgTraceFrame.pas
branches/code_format/jcl/experts/debug/dialog/JclOtaExcDlgWizard.pas
branches/code_format/jcl/experts/debug/dialog/JclOtaRepositoryReg.pas
branches/code_format/jcl/experts/debug/dialog/JclOtaRepositoryUtils.pas
branches/code_format/jcl/experts/debug/dialog/JclOtaTemplates.pas
branches/code_format/jcl/experts/debug/simdview/JclSIMDCpuInfo.pas
branches/code_format/jcl/experts/debug/simdview/JclSIMDModifyForm.pas
branches/code_format/jcl/experts/debug/simdview/JclSIMDUtils.pas
branches/code_format/jcl/experts/debug/simdview/JclSIMDView.pas
branches/code_format/jcl/experts/debug/simdview/JclSIMDViewForm.pas
branches/code_format/jcl/experts/debug/threadnames/JclIdeThreadStatus.pas
branches/code_format/jcl/experts/debug/threadnames/ThreadExpertSharedNames.pas
branches/code_format/jcl/experts/debug/threadnames/ThreadExpertUnit.pas
branches/code_format/jcl/experts/debug/tools/MapToJdbgMain.pas
branches/code_format/jcl/experts/debug/tools/TlbToMapMain.pas
branches/code_format/jcl/experts/favfolders/IdeOpenDlgFavoriteUnit.pas
branches/code_format/jcl/experts/favfolders/OpenDlgFavAdapter.pas
branches/code_format/jcl/experts/projectanalyzer/ProjAnalyzerFrm.pas
branches/code_format/jcl/experts/projectanalyzer/ProjAnalyzerImpl.pas
branches/code_format/jcl/experts/useswizard/JCLUsesWizard.pas
branches/code_format/jcl/experts/useswizard/JclParseUses.pas
branches/code_format/jcl/experts/useswizard/JclUsesDialog.pas
branches/code_format/jcl/experts/versioncontrol/JclVersionCtrlCVSImpl.pas
branches/code_format/jcl/experts/versioncontrol/JclVersionCtrlCommonOptions.pas
branches/code_format/jcl/experts/versioncontrol/JclVersionCtrlSVNImpl.pas
branches/code_format/jcl/experts/versioncontrol/VersionControlImpl.pas
branches/code_format/jcl/install/JclInstall.pas
branches/code_format/jcl/install/JediInstall.pas
branches/code_format/jcl/install/JediInstallConfigIni.pas
branches/code_format/jcl/install/JediProfiles.pas
branches/code_format/jcl/install/VclGui/FrmCompile.pas
branches/code_format/jcl/install/VclGui/JediGUIProfiles.pas
branches/code_format/jcl/install/prototypes/JediGUIInstall.pas
branches/code_format/jcl/install/prototypes/JediGUIMain.pas
branches/code_format/jcl/source/common/Jcl8087.pas
branches/code_format/jcl/source/common/JclAbstractContainers.pas
branches/code_format/jcl/source/common/JclAlgorithms.pas
branches/code_format/jcl/source/common/JclAnsiStrings.pas
branches/code_format/jcl/source/common/JclArrayLists.pas
branches/code_format/jcl/source/common/JclArraySets.pas
branches/code_format/jcl/source/common/JclBase.pas
branches/code_format/jcl/source/common/JclBinaryTrees.pas
branches/code_format/jcl/source/common/JclBorlandTools.pas
branches/code_format/jcl/source/common/JclComplex.pas
branches/code_format/jcl/source/common/JclCompression.pas
branches/code_format/jcl/source/common/JclContainerIntf.pas
branches/code_format/jcl/source/common/JclCounter.pas
branches/code_format/jcl/source/common/JclDateTime.pas
branches/code_format/jcl/source/common/JclEDI.pas
branches/code_format/jcl/source/common/JclEDISEF.pas
branches/code_format/jcl/source/common/JclEDITranslators.pas
branches/code_format/jcl/source/common/JclEDIXML.pas
branches/code_format/jcl/source/common/JclEDI_ANSIX12.pas
branches/code_format/jcl/source/common/JclEDI_ANSIX12_Ext.pas
branches/code_format/jcl/source/common/JclEDI_UNEDIFACT.pas
branches/code_format/jcl/source/common/JclEDI_UNEDIFACT_Ext.pas
branches/code_format/jcl/source/common/JclExprEval.pas
branches/code_format/jcl/source/common/JclFileUtils.pas
branches/code_format/jcl/source/common/JclHashMaps.pas
branches/code_format/jcl/source/common/JclHashSets.pas
branches/code_format/jcl/source/common/JclLinkedLists.pas
branches/code_format/jcl/source/common/JclLogic.pas
branches/code_format/jcl/source/common/JclMIDI.pas
branches/code_format/jcl/source/common/JclMath.pas
branches/code_format/jcl/source/common/JclMime.pas
branches/code_format/jcl/source/common/JclPCRE.pas
branches/code_format/jcl/source/common/JclQueues.pas
branches/code_format/jcl/source/common/JclRTTI.pas
branches/code_format/jcl/source/common/JclResources.pas
branches/code_format/jcl/source/common/JclSchedule.pas
branches/code_format/jcl/source/common/JclSimpleXml.pas
branches/code_format/jcl/source/common/JclSortedMaps.pas
branches/code_format/jcl/source/common/JclStacks.pas
branches/code_format/jcl/source/common/JclStatistics.pas
branches/code_format/jcl/source/common/JclStrHashMap.pas
branches/code_format/jcl/source/common/JclStreams.pas
branches/code_format/jcl/source/common/JclStringLists.pas
branches/code_format/jcl/source/common/JclStrings.pas
branches/code_format/jcl/source/common/JclSysInfo.pas
branches/code_format/jcl/source/common/JclSysUtils.pas
branches/code_format/jcl/source/common/JclUnitConv.pas
branches/code_format/jcl/source/common/JclUnitVersioning.pas
branches/code_format/jcl/source/common/JclUnitVersioningProviders.pas
branches/code_format/jcl/source/common/JclValidation.pas
branches/code_format/jcl/source/common/JclVectors.pas
branches/code_format/jcl/source/common/JclWideStrings.pas
branches/code_format/jcl/source/common/bzip2.pas
branches/code_format/jcl/source/common/pcre.pas
branches/code_format/jcl/source/prototypes/Hardlinks.pas
branches/code_format/jcl/source/prototypes/JclArrayLists.pas
branches/code_format/jcl/source/prototypes/JclArraySets.pas
branches/code_format/jcl/source/prototypes/JclBinaryTrees.pas
branches/code_format/jcl/source/prototypes/JclHashMaps.pas
branches/code_format/jcl/source/prototypes/JclHashSets.pas
branches/code_format/jcl/source/prototypes/JclLinkedLists.pas
branches/code_format/jcl/source/prototypes/JclVectors.pas
branches/code_format/jcl/source/prototypes/JclWin32.pas
branches/code_format/jcl/source/prototypes/_GraphUtils.pas
branches/code_format/jcl/source/prototypes/_Graphics.pas
branches/code_format/jcl/source/prototypes/zlibh.pas
branches/code_format/jcl/source/unix/zlibh.pas
branches/code_format/jcl/source/vcl/JclFont.pas
branches/code_format/jcl/source/vcl/JclGraphUtils.pas
branches/code_format/jcl/source/vcl/JclGraphics.pas
branches/code_format/jcl/source/vcl/JclPrint.pas
branches/code_format/jcl/source/visclx/JclQGraphUtils.pas
branches/code_format/jcl/source/visclx/JclQGraphics.pas
branches/code_format/jcl/source/windows/Hardlinks.pas
branches/code_format/jcl/source/windows/JclAppInst.pas
branches/code_format/jcl/source/windows/JclCIL.pas
branches/code_format/jcl/source/windows/JclCLR.pas
branches/code_format/jcl/source/windows/JclCOM.pas
branches/code_format/jcl/source/windows/JclConsole.pas
branches/code_format/jcl/source/windows/JclDebug.pas
branches/code_format/jcl/source/windows/JclDotNet.pas
branches/code_format/jcl/source/windows/JclHookExcept.pas
branches/code_format/jcl/source/windows/JclLANMan.pas
branches/code_format/jcl/source/windows/JclLocales.pas
branches/code_format/jcl/source/windows/JclMapi.pas
branches/code_format/jcl/source/windows/JclMetadata.pas
branches/code_format/jcl/source/windows/JclMiscel.pas
branches/code_format/jcl/source/windows/JclMsdosSys.pas
branches/code_format/jcl/source/windows/JclMultimedia.pas
branches/code_format/jcl/source/windows/JclNTFS.pas
branches/code_format/jcl/source/windows/JclPeImage.pas
branches/code_format/jcl/source/windows/JclRegistry.pas
branches/code_format/jcl/source/windows/JclSecurity.pas
branches/code_format/jcl/source/windows/JclShell.pas
branches/code_format/jcl/source/windows/JclStructStorage.pas
branches/code_format/jcl/source/windows/JclSvcCtrl.pas
branches/code_format/jcl/source/windows/JclSynch.pas
branches/code_format/jcl/source/windows/JclTD32.pas
branches/code_format/jcl/source/windows/JclTask.pas
branches/code_format/jcl/source/windows/JclUnicode.pas
branches/code_format/jcl/source/windows/JclWideFormat.pas
branches/code_format/jcl/source/windows/JclWin32.pas
branches/code_format/jcl/source/windows/JclWin32Ex.pas
branches/code_format/jcl/source/windows/JclWinMIDI.pas
branches/code_format/jcl/source/windows/MSHelpServices_TLB.pas
branches/code_format/jcl/source/windows/MSTask.pas
branches/code_format/jcl/source/windows/Snmp.pas
branches/code_format/jcl/source/windows/mscoree_TLB.pas
branches/code_format/jcl/source/windows/mscorlib_TLB.pas
branches/code_format/jcl/source/windows/zlibh.pas
Added Paths:
-----------
branches/code_format/thirdparty/jedi_code_format/
branches/code_format/thirdparty/jedi_code_format/JCF.log
branches/code_format/thirdparty/jedi_code_format/JCFGui.exe
branches/code_format/thirdparty/jedi_code_format/JCFSettings.cfg
Property Changed:
----------------
branches/code_format/thirdparty/InnoSetup/
branches/code_format/thirdparty/InnoSetup/Skin/
branches/code_format/thirdparty/InnoSetup/Skin/images/
branches/code_format/thirdparty/svn_cleaner/
Modified: branches/code_format/jcl/examples/common/containers/algorithms/AlgorithmsExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/containers/algorithms/AlgorithmsExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/containers/algorithms/AlgorithmsExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -243,4 +243,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/containers/hashing/HashingExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/containers/hashing/HashingExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/containers/hashing/HashingExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -119,7 +119,7 @@
Map: IJclIntfIntfMap;
MyObject: IIntfMyObject;
KeyObject: TInterfacedObject;
- It: IJclIntfIterator;
+ It: IJclIntfIterator;
begin
Map := TJclIntfIntfHashMap.Create(DefaultContainerCapacity);
MyObject := TIntfMyObject.Create;
@@ -179,7 +179,7 @@
Map: IJclMap;
MyObject: TMyObject;
KeyObject: TObject;
- It: IJclIterator;
+ It: IJclIterator;
begin
Map := TJclHashMap.Create(DefaultContainerCapacity, False, False);
MyObject := TMyObject.Create;
@@ -204,7 +204,7 @@
var
MySet: IJclIntfSet;
MyObject: IIntfMyObject;
- It: IJclIntfIterator;
+ It: IJclIntfIterator;
begin
MySet := TJclIntfHashSet.Create(DefaultContainerCapacity);
MyObject := TIntfMyObject.Create;
@@ -223,7 +223,7 @@
var
MySet: IJclSet;
MyObject: TMyObject;
- It: IJclIterator;
+ It: IJclIterator;
begin
MySet := TJclHashSet.Create(DefaultContainerCapacity, False);
MyObject := TMyObject.Create;
@@ -242,7 +242,7 @@
var
MySet: IJclIntfSet;
MyObject: IIntfMyObject;
- It: IJclIntfIterator;
+ It: IJclIntfIterator;
begin
MySet := TJclIntfArraySet.Create(DefaultContainerCapacity);
MyObject := TIntfMyObject.Create;
@@ -261,7 +261,7 @@
var
MySet: IJclSet;
MyObject: TMyObject;
- It: IJclIterator;
+ It: IJclIterator;
begin
MySet := TJclArraySet.Create(DefaultContainerCapacity, False);
MyObject := TMyObject.Create;
@@ -283,7 +283,7 @@
procedure TMainForm.btnAnsiStrAnsiStrHashMapClick(Sender: TObject);
var
Map: IJclAnsiStrAnsiStrMap;
- It: IJclAnsiStrIterator;
+ It: IJclAnsiStrIterator;
begin
Map := TJclAnsiStrAnsiStrHashMap.Create(DefaultContainerCapacity);
Map.PutValue('MyKey1', 'MyString1');
@@ -303,7 +303,7 @@
procedure TMainForm.btnWideStrWideStrHashMapClick(Sender: TObject);
var
Map: IJclWideStrWideStrMap;
- It: IJclWideStrIterator;
+ It: IJclWideStrIterator;
begin
Map := TJclWideStrWideStrHashMap.Create(DefaultContainerCapacity);
Map.PutValue('MyKey1', 'MyString1');
@@ -324,7 +324,7 @@
var
Map: IJclAnsiStrMap;
MyObject: TMyObject;
- It: IJclAnsiStrIterator;
+ It: IJclAnsiStrIterator;
begin
Map := TJclAnsiStrHashMap.Create(DefaultContainerCapacity, False);
MyObject := TMyObject.Create;
@@ -348,7 +348,7 @@
var
Map: IJclWideStrMap;
MyObject: TMyObject;
- It: IJclWideStrIterator;
+ It: IJclWideStrIterator;
begin
Map := TJclWideStrHashMap.Create(DefaultContainerCapacity, False);
MyObject := TMyObject.Create;
@@ -371,7 +371,7 @@
procedure TMainForm.btnAnsiStrHashSetClick(Sender: TObject);
var
MySet: IJclAnsiStrSet;
- It: IJclAnsiStrIterator;
+ It: IJclAnsiStrIterator;
begin
MySet := TJclAnsiStrHashSet.Create(DefaultContainerCapacity);
MySet.Add('MyString');
@@ -386,7 +386,7 @@
procedure TMainForm.btnWideStrHashSetClick(Sender: TObject);
var
MySet: IJclWideStrSet;
- It: IJclWideStrIterator;
+ It: IJclWideStrIterator;
begin
MySet := TJclWideStrHashSet.Create(DefaultContainerCapacity);
MySet.Add('MyString');
@@ -401,8 +401,8 @@
procedure TMainForm.btnAnsiStrArraySetClick(Sender: TObject);
var
MySet: IJclAnsiStrSet;
- It: IJclAnsiStrIterator;
- I: Integer;
+ It: IJclAnsiStrIterator;
+ I: Integer;
begin
MySet := TJclAnsiStrArraySet.Create(DefaultContainerCapacity);
for I := 1 to 8 do
@@ -421,8 +421,8 @@
procedure TMainForm.btnWideStrArraySetClick(Sender: TObject);
var
MySet: IJclWideStrSet;
- It: IJclWideStrIterator;
- I: Integer;
+ It: IJclWideStrIterator;
+ I: Integer;
begin
MySet := TJclWideStrArraySet.Create(DefaultContainerCapacity);
for I := 1 to 8 do
@@ -439,4 +439,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/containers/lists/ListExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/containers/lists/ListExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/containers/lists/ListExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -133,7 +133,7 @@
MyArray: IJclIntfArray;
MyObject: IIntfMyObject;
It: IJclIntfIterator;
- I: Integer;
+ I: Integer;
begin
memResult.Lines.Clear;
List := TJclIntfArrayList.Create(DefaultContainerCapacity);
@@ -202,8 +202,8 @@
var
List: IJclIntfList;
MyObject: IIntfMyObject;
- It: IJclIntfIterator;
- I: Integer;
+ It: IJclIntfIterator;
+ I: Integer;
begin
memResult.Lines.Clear;
List := TJclIntfVector.Create(DefaultContainerCapacity);
@@ -241,7 +241,7 @@
var
List: IJclList;
MyObject: TMyObject;
- It: IJclIterator;
+ It: IJclIterator;
begin
memResult.Lines.Clear;
List := TJclArrayList.Create(DefaultContainerCapacity, True);
@@ -275,7 +275,7 @@
var
List: IJclList;
MyObject: TMyObject;
- It: IJclIterator;
+ It: IJclIterator;
begin
memResult.Lines.Clear;
List := TJclLinkedList.Create(nil, True);
@@ -303,8 +303,8 @@
var
List: IJclList;
MyObject: TMyObject;
- It: IJclIterator;
- I: Integer;
+ It: IJclIterator;
+ I: Integer;
begin
memResult.Lines.Clear;
List := TJclVector.Create(DefaultContainerCapacity, True);
@@ -360,8 +360,8 @@
List, Sub: IJclAnsiStrList;
MyArray: IJclAnsiStrArray;
It: IJclAnsiStrIterator;
- I: Integer;
- S: string;
+ I: Integer;
+ S: string;
begin
memResult.Lines.Clear;
List := TJclAnsiStrArrayList.Create(DefaultContainerCapacity);
@@ -394,8 +394,8 @@
List, Sub: IJclWideStrList;
MyArray: IJclWideStrArray;
It: IJclWideStrIterator;
- I: Integer;
- S: string;
+ I: Integer;
+ S: string;
begin
memResult.Lines.Clear;
List := TJclWideStrArrayList.Create(DefaultContainerCapacity);
@@ -504,9 +504,9 @@
procedure TMainForm.btnAnsiStrVectorClick(Sender: TObject);
var
List: IJclAnsiStrList;
- S: string;
- It: IJclAnsiStrIterator;
- I: Integer;
+ S: string;
+ It: IJclAnsiStrIterator;
+ I: Integer;
begin
memResult.Lines.Clear;
List := TJclAnsiStrVector.Create(DefaultContainerCapacity);
@@ -539,9 +539,9 @@
procedure TMainForm.btnWideStrVectorClick(Sender: TObject);
var
List: IJclWideStrList;
- S: string;
- It: IJclWideStrIterator;
- I: Integer;
+ S: string;
+ It: IJclWideStrIterator;
+ I: Integer;
begin
memResult.Lines.Clear;
List := TJclWideStrVector.Create(DefaultContainerCapacity);
@@ -572,4 +572,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/containers/lists/MyObjectList.pas
===================================================================
--- branches/code_format/jcl/examples/common/containers/lists/MyObjectList.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/containers/lists/MyObjectList.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -96,7 +96,7 @@
function TMyObjectList.Contains(AObject: TMyObject): Boolean;
begin
-Result := inherited Contains(AObject);
+ Result := inherited Contains(AObject);
end;
function TMyObjectList.GetObject(Index: Integer): TMyObject;
@@ -130,4 +130,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -155,4 +155,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceTests.pas
===================================================================
--- branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceTests.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/containers/performance/ContainerPerformanceTests.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -29,7 +29,7 @@
const
ResultFormat = '%.1f ms';
- MsecsPerDay = 24 * 60 * 60 * 1000;
+ MsecsPerDay = 24 * 60 * 60 * 1000;
{$IFNDEF RTL140_UP}
const
@@ -42,7 +42,7 @@
procedure TestList(Results: TStrings);
var
List: TList;
- I: Integer;
+ I: Integer;
Start: TDateTime;
begin
Randomize;
@@ -77,8 +77,8 @@
procedure TestJclArrayList(Results: TStrings);
var
List: IJclList;
- It: IJclIterator;
- I: Integer;
+ It: IJclIterator;
+ I: Integer;
Start: TDateTime;
begin
Randomize;
@@ -120,8 +120,8 @@
procedure TestJclLinkedList(Results: TStrings);
var
List: IJclList;
- I: Integer;
- It: IJclIterator;
+ I: Integer;
+ It: IJclIterator;
Start: TDateTime;
begin
Randomize;
@@ -159,7 +159,7 @@
procedure TestJclVector(Results: TStrings);
var
List: IJclList;
- I: Integer;
+ I: Integer;
Start: TDateTime;
begin
Randomize;
@@ -232,7 +232,7 @@
procedure TestJclHashMap(Results: TStrings);
var
Map: IJclMap;
- I: Integer;
+ I: Integer;
Start: TDateTime;
begin
Randomize;
@@ -299,7 +299,7 @@
procedure TestJclAnsiStrAnsiStrHashMap(Results: TStrings);
var
Map: IJclAnsiStrAnsiStrMap;
- I: Integer;
+ I: Integer;
Res: string;
Start: TDateTime;
begin
@@ -326,7 +326,7 @@
procedure TestJclWideStrWideStrHashMap(Results: TStrings);
var
Map: IJclWideStrWideStrMap;
- I: Integer;
+ I: Integer;
Res: string;
Start: TDateTime;
begin
Modified: branches/code_format/jcl/examples/common/containers/trees/TreeExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/containers/trees/TreeExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/containers/trees/TreeExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -72,9 +72,9 @@
procedure TMainForm.btnIntfArrayTreeClick(Sender: TObject);
var
Tree: IJclIntfTree;
- I: Integer;
- Obj: IIntfInteger;
- It: IJclIntfIterator;
+ I: Integer;
+ Obj: IIntfInteger;
+ It: IJclIntfIterator;
begin
memoResult.Lines.Clear;
Tree := TJclIntfBinaryTree.Create(IntfIntegerComparator);
@@ -107,8 +107,8 @@
procedure TMainForm.btnArrayTreeClick(Sender: TObject);
var
Tree: IJclTree;
- I: Integer;
- It: IJclIterator;
+ I: Integer;
+ It: IJclIterator;
begin
memoResult.Lines.Clear;
Tree := TJclBinaryTree.Create(JclAlgorithms.IntegerCompare, True);
@@ -127,8 +127,8 @@
procedure TMainForm.btnAnsiStrBinaryTreeClick(Sender: TObject);
var
Tree: IJclAnsiStrTree;
- I: Integer;
- It: IJclAnsiStrIterator;
+ I: Integer;
+ It: IJclAnsiStrIterator;
begin
memoResult.Lines.Clear;
Tree := TJclAnsiStrBinaryTree.Create(JclAlgorithms.AnsiStrSimpleCompare);
@@ -147,8 +147,8 @@
procedure TMainForm.btnWideStrBinaryTreeClick(Sender: TObject);
var
Tree: IJclWideStrTree;
- I: Integer;
- It: IJclWideStrIterator;
+ I: Integer;
+ It: IJclWideStrIterator;
begin
memoResult.Lines.Clear;
Tree := TJclWideStrBinaryTree.Create(JclAlgorithms.WideStrSimpleCompare);
@@ -165,4 +165,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/expreval/QExprEvalExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/expreval/QExprEvalExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/expreval/QExprEvalExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -3,7 +3,7 @@
interface
uses
- Types, SysUtils, Classes,
+ Types, SysUtils, Classes,
QGraphics, QControls, QForms, QStdCtrls,
JclExprEval;
Modified: branches/code_format/jcl/examples/common/filesearch/QFileSearchDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/filesearch/QFileSearchDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/filesearch/QFileSearchDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -124,7 +124,7 @@
with ListItem do
begin
Caption := Directory + FileInfo.Name;
- Str(GetSizeOfFile(FileInfo):13, S);
+ Str(GetSizeOfFile(FileInfo): 13, S);
SubItems.Add(S);
SubItems.Add(FormatDateTime(' yyyy-mm-dd hh:nn:ss ', FileDateToDateTime(FileInfo.Time)));
SubItems.Add(FileAttributesStr(FileInfo));
@@ -171,7 +171,7 @@
FFileEnumerator.FileSizeMax := StrToInt64(edFileSizeMax.Text);
FFileEnumerator.IncludeSubDirectories := IncludeSubDirectories.Checked;
FFileEnumerator.IncludeHiddenSubDirectories := IncludeHiddenSubDirs.Checked;
- FFileEnumerator.CaseSensitiveSearch := not cbCaseInsensitiveSearch.Checked;
+ FFileEnumerator.CaseSensitiveSearch := not cbCaseInsensitiveSearch.Checked;
FDirCount := 0;
StartBtn.Enabled := False;
@@ -250,7 +250,7 @@
begin
if not IncludeSubDirectories.Checked then
if IncludeHiddenSubDirs.State = cbChecked then
- IncludeHiddenSubDirs.State := cbUnchecked;
+ IncludeHiddenSubDirs.State := cbUnchecked;
end;
procedure TFileSearchForm.DetailsBtnClick(Sender: TObject);
@@ -267,14 +267,13 @@
begin
if SaveDialog.Execute then
with TStringList.Create do
- try
- for I := 0 to FileList.Items.Count - 1 do
- Add(FileList.Items[I].Caption);
- SaveToFile(SaveDialog.FileName);
- finally
- Free;
- end;
+ try
+ for I := 0 to FileList.Items.Count - 1 do
+ Add(FileList.Items[I].Caption);
+ SaveToFile(SaveDialog.FileName);
+ finally
+ Free;
+ end;
end;
end.
-
Modified: branches/code_format/jcl/examples/common/graphics/QClipLineDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/graphics/QClipLineDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/graphics/QClipLineDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -71,7 +71,7 @@
i: Integer;
H, S, L: Single;
begin
- for i := 0 to Length(P)-1 do
+ for i := 0 to Length(P) - 1 do
begin
P[i].X := Random(Width);
P[i].Y := Random(Height);
@@ -91,4 +91,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/graphics/StretchGraphicDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/graphics/StretchGraphicDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/graphics/StretchGraphicDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -31,7 +31,7 @@
JclQGraphics,
{$ENDIF VisualCLX}
{$IFDEF HasShellCtrls}
- {$WARN UNIT_PLATFORM OFF}
+ {$WARN UNIT_PLATFORM OFF}
ShellCtrls,
{$ENDIF HasShellCtrls}
JclFileUtils;
@@ -139,7 +139,7 @@
{$IFDEF MSWINDOWS}
type
- TWMDropFilesCallback = procedure (const FileName: string) of object;
+ TWMDropFilesCallback = procedure(const FileName: string) of object;
procedure ProcessWMDropFiles(var Msg: TWMDropFiles; Callback: TWMDropFilesCallback; DropPoint: PPoint = nil); overload;
var
@@ -201,23 +201,23 @@
WatchSubTree := False;
OnChange := ShellChange;
NotifyFilters := [
- nfFileNameChange,
- nfDirNameChange,
+ nfFileNameChange,
+ nfDirNameChange,
//nfSizeChange,
- nfWriteChange,
- nfSecurityChange];
+ nfWriteChange,
+ nfSecurityChange];
end;
{$ENDIF HasShellCtrls}
{$IFDEF VCL}
DragAcceptFiles(Handle, True);
{$ENDIF VCL}
if ParamCount > 0 then
- with OpenDialog do
- begin
- FileName := ParamStr(1);
- InitialDir := ExtractFileDir(FileName);
- LoadFile(FileName);
- end;
+ with OpenDialog do
+ begin
+ FileName := ParamStr(1);
+ InitialDir := ExtractFileDir(FileName);
+ LoadFile(FileName);
+ end;
end;
{$IFDEF VCL}
@@ -326,13 +326,13 @@
procedure TStretchDemoForm.DoStretch;
var
W, H: Integer;
- T: LongWord;
+ T: LongWord;
begin
with OriginalImage.Picture do
if (Graphic = nil) {$IFDEF VCL} or (Graphic is TMetafile) {$ENDIF} then
Exit;
- W := StretchedPage.Width-2;
- H := StretchedPage.Height-2;
+ W := StretchedPage.Width - 2;
+ H := StretchedPage.Height - 2;
if FPreserveAspectRatio then
with OriginalImage.Picture.Graphic do
begin
@@ -379,14 +379,14 @@
procedure TStretchDemoForm.PrevFile(Sender: TObject);
begin
if FileListIndex > 0 then
- FileListIndex := FileListIndex - 1;
+ FileListIndex := FileListIndex - 1;
LoadSelected;
end;
procedure TStretchDemoForm.NextFile(Sender: TObject);
begin
if FileListIndex < FileListView.Items.Count - 1 then
- FileListIndex := FileListIndex + 1;
+ FileListIndex := FileListIndex + 1;
LoadSelected;
end;
@@ -414,20 +414,20 @@
{$IFDEF VCL}
const
Key_Prior = VK_PRIOR;
- Key_Next = VK_NEXT;
+ Key_Next = VK_NEXT;
{$ENDIF VCL}
begin
case Key of
Key_Prior:
- begin
- PrevFile(Self);
- Key := 0;
- end;
+ begin
+ PrevFile(Self);
+ Key := 0;
+ end;
Key_Next:
- begin
- NextFile(Self);
- Key := 0;
- end;
+ begin
+ NextFile(Self);
+ Key := 0;
+ end;
end;
end;
Modified: branches/code_format/jcl/examples/common/multimedia/MidiOutExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/multimedia/MidiOutExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/multimedia/MidiOutExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -191,4 +191,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/multimedia/MidiOutExampleTuningDlg.pas
===================================================================
--- branches/code_format/jcl/examples/common/multimedia/MidiOutExampleTuningDlg.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/multimedia/MidiOutExampleTuningDlg.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -10,7 +10,7 @@
uses
Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls, Spin,
- JclMath, JclMidi;
+ JclMath, JclMIDI;
type
TTuningDialog = class(TForm)
@@ -52,9 +52,9 @@
const
HalftonesPerOctave = 12;
- MiddleA = 440.0; // Hertz
- MidiMiddleA = 69; // A3 = 440 Hertz
- Digits = 6;
+ MiddleA = 440.0; // Hertz
+ MidiMiddleA = 69; // A3 = 440 Hertz
+ Digits = 6;
MIDIFreqMax = 127.99993896;
FreqHertzMin = 8.17579892;
FreqHertzMax = 13289.70346552;
Modified: branches/code_format/jcl/examples/common/numformat/QNumFormatExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/numformat/QNumFormatExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/numformat/QNumFormatExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -81,8 +81,8 @@
Base: TNumericSystemBase;
S, Mantissa: string;
Exponent: Integer;
- X: Extended;
- C: TCaretPos;
+ X: Extended;
+ C: TCaretPos;
begin
if not Assigned(FNumFormat) then
Exit;
@@ -116,7 +116,7 @@
procedure TMainForm.RandBtnClick(Sender: TObject);
begin
- ValueEdit.Text := FloatToStr(Power(Random * 4 -2, Random(400)));
+ ValueEdit.Text := FloatToStr(Power(Random * 4 - 2, Random(400)));
EvalBtn.Enabled := False;
Display;
end;
Modified: branches/code_format/jcl/examples/common/pcre/PCREDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/pcre/PCREDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/pcre/PCREDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -48,7 +48,7 @@
procedure Match;
function GetUIOptions: TJclAnsiRegExOptions;
procedure UpdateUIOptions;
- procedure LoadFromFile(const Filename:string);
+ procedure LoadFromFile(const Filename: string);
protected
procedure WMDropFiles(var Message: TWMDropFiles); message WM_DROPFILES;
public
@@ -143,7 +143,8 @@
var
Options: TJclAnsiRegExOptions;
begin
- if RE = nil then Exit;
+ if RE = nil then
+ Exit;
Options := RE.Options;
chkIgnoreCase.Checked := roIgnoreCase in Options;
chkMultiLine.Checked := roMultiLine in Options;
@@ -176,18 +177,18 @@
procedure TfrmMain.WMDropFiles(var Message: TWMDropFiles);
var
- i:integer;
- buf:array [0..MAX_PATH] of char;
+ i: integer;
+ buf: array [0..MAX_PATH] of char;
begin
i := DragQueryFile(Message.Drop, $FFFFFFFF, nil, 0);
if i > 0 then
- try
- DragQueryFile(Message.Drop, 0, buf, sizeof(buf));
- if FileExists(buf) then
- LoadFromFile(buf);
- finally
- DragFinish(Message.Drop);
- end;
+ try
+ DragQueryFile(Message.Drop, 0, buf, sizeof(buf));
+ if FileExists(buf) then
+ LoadFromFile(buf);
+ finally
+ DragFinish(Message.Drop);
+ end;
end;
procedure TfrmMain.LoadFromFile(const Filename: string);
@@ -197,4 +198,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/pcre/QPCREDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/pcre/QPCREDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/pcre/QPCREDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -47,7 +47,7 @@
procedure Match;
function GetUIOptions: TJclAnsiRegExOptions;
procedure UpdateUIOptions;
- procedure LoadFromFile(const Filename:string);
+ procedure LoadFromFile(const Filename: string);
protected
//procedure WMDropFiles(var Message: TWMDropFiles); message WM_DROPFILES;
public
@@ -140,7 +140,8 @@
var
Options: TJclAnsiRegExOptions;
begin
- if RE = nil then Exit;
+ if RE = nil then
+ Exit;
Options := RE.Options;
chkIgnoreCase.Checked := roIgnoreCase in Options;
chkMultiLine.Checked := roMultiLine in Options;
@@ -173,4 +174,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/rtti/QRTTIDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/rtti/QRTTIDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/rtti/QRTTIDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -56,7 +56,7 @@
le131, le132, le133, le134, le135, le136, le137, le138, le139, le140,
le141, le142, le143, le144, le145, le146, le147, le148, le149, le150,
le151, le152, le153, le154, le155, le156, le157, le158, le159, le160);
-
+
TLargeSet = set of TLargeEnum;
TLargeSubEnum = le019 .. le150;
TLargeSubSet = set of TLargeSubEnum;
@@ -84,7 +84,7 @@
var
MyEnum: PTypeInfo;
MySubRange: PTypeInfo;
- MySet: PTypeInfo;
+ MySet: PTypeInfo;
MyCutLowerEnum: PTypeInfo;
procedure TForm1.Button1Click(Sender: TObject);
@@ -159,7 +159,7 @@
var
Writer: IJclInfoWriter;
LargeSubSet: TLargeSubSet;
- GUID: TGUID;
+ GUID: TGUID;
begin
mmResult.Lines.Clear;
@@ -169,18 +169,25 @@
try
Writer.Writeln('StrToSet with string=''[le019..le023, le033, le045..le049]''');
JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet, '[le019..le023, le033, le045..le049]');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) + ''', with WantRanges=True');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) + ''', with WantRanges=False');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) +
+ ''', with WantRanges=True');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) +
+ ''', with WantRanges=False');
Writer.Writeln('');
Writer.Writeln('StrToSet with string=''''');
JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet, '');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) + ''', with WantRanges=True');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) + ''', with WantRanges=False');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) +
+ ''', with WantRanges=True');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) +
+ ''', with WantRanges=False');
Writer.Writeln('');
Writer.Writeln('StrToSet with string=''le019 .. le023,le033 , le045 .. le049 ''');
- JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet, 'le019 .. le023,le033 , le045 .. le049 ');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) + ''', with WantRanges=True');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) + ''', with WantRanges=False');
+ JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet,
+ 'le019 .. le023,le033 , le045 .. le049 ');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) +
+ ''', with WantRanges=True');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) +
+ ''', with WantRanges=False');
Writer.Writeln('');
finally
Writer.Outdent;
@@ -200,7 +207,8 @@
Writer.Indent;
try
Writer.Writeln('TypedIntToStr: ' + JclTypedIntToStr(crArrow, TypeInfo(TCursor)));
- Writer.Writeln('StrToTypedInt: ' + IntToStr(JclStrToTypedInt('crArrow', TypeInfo(TCursor))) + ' (should be ' + IntToStr(crArrow) + ')');
+ Writer.Writeln('StrToTypedInt: ' + IntToStr(JclStrToTypedInt('crArrow', TypeInfo(TCursor))) +
+ ' (should be ' + IntToStr(crArrow) + ')');
Writer.Writeln('');
Writer.Writeln('TypedIntToStr: ' + JclTypedIntToStr(1, TypeInfo(TCursor)));
Writer.Writeln('StrToTypedInt: ' + IntToStr(JclStrToTypedInt('1', TypeInfo(TCursor))) + ' (should be 1)');
Modified: branches/code_format/jcl/examples/common/rtti/RTTIDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/rtti/RTTIDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/rtti/RTTIDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -55,7 +55,7 @@
le131, le132, le133, le134, le135, le136, le137, le138, le139, le140,
le141, le142, le143, le144, le145, le146, le147, le148, le149, le150,
le151, le152, le153, le154, le155, le156, le157, le158, le159, le160);
-
+
TLargeSet = set of TLargeEnum;
TLargeSubEnum = le019 .. le150;
TLargeSubSet = set of TLargeSubEnum;
@@ -83,7 +83,7 @@
var
MyEnum: PTypeInfo;
MySubRange: PTypeInfo;
- MySet: PTypeInfo;
+ MySet: PTypeInfo;
MyCutLowerEnum: PTypeInfo;
procedure TForm1.Button1Click(Sender: TObject);
@@ -158,7 +158,7 @@
var
Writer: IJclInfoWriter;
LargeSubSet: TLargeSubSet;
- GUID: TGUID;
+ GUID: TGUID;
begin
mmResult.Lines.Clear;
@@ -168,18 +168,25 @@
try
Writer.Writeln('StrToSet with string=''[le019..le023, le033, le045..le049]''');
JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet, '[le019..le023, le033, le045..le049]');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) + ''', with WantRanges=True');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) + ''', with WantRanges=False');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) +
+ ''', with WantRanges=True');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) +
+ ''', with WantRanges=False');
Writer.Writeln('');
Writer.Writeln('StrToSet with string=''''');
JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet, '');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) + ''', with WantRanges=True');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) + ''', with WantRanges=False');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) +
+ ''', with WantRanges=True');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) +
+ ''', with WantRanges=False');
Writer.Writeln('');
Writer.Writeln('StrToSet with string=''le019 .. le023,le033 , le045 .. le049 ''');
- JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet, 'le019 .. le023,le033 , le045 .. le049 ');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) + ''', with WantRanges=True');
- Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) + ''', with WantRanges=False');
+ JclStrToSet(TypeInfo(TLargeSubSet), LargeSubSet,
+ 'le019 .. le023,le033 , le045 .. le049 ');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, True) +
+ ''', with WantRanges=True');
+ Writer.Writeln('SetToStr of StrToSet = ''' + JclSetToStr(TypeInfo(TLargeSubSet), LargeSubSet, True, False) +
+ ''', with WantRanges=False');
Writer.Writeln('');
finally
Writer.Outdent;
@@ -199,7 +206,8 @@
Writer.Indent;
try
Writer.Writeln('TypedIntToStr: ' + JclTypedIntToStr(crArrow, TypeInfo(TCursor)));
- Writer.Writeln('StrToTypedInt: ' + IntToStr(JclStrToTypedInt('crArrow', TypeInfo(TCursor))) + ' (should be ' + IntToStr(crArrow) + ')');
+ Writer.Writeln('StrToTypedInt: ' + IntToStr(JclStrToTypedInt('crArrow', TypeInfo(TCursor))) +
+ ' (should be ' + IntToStr(crArrow) + ')');
Writer.Writeln('');
Writer.Writeln('TypedIntToStr: ' + JclTypedIntToStr(1, TypeInfo(TCursor)));
Writer.Writeln('StrToTypedInt: ' + IntToStr(JclStrToTypedInt('1', TypeInfo(TCursor))) + ' (should be 1)');
Modified: branches/code_format/jcl/examples/common/sysinfo/QEnvironmentExampleMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/sysinfo/QEnvironmentExampleMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/sysinfo/QEnvironmentExampleMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -3,7 +3,7 @@
interface
uses
- SysUtils, Classes, QControls, QForms, QComCtrls,
+ SysUtils, Classes, QControls, QForms, QComCtrls,
JclSysInfo;
type
@@ -73,4 +73,3 @@
end;
end.
-
Modified: branches/code_format/jcl/examples/common/textreader/TextReaderDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/common/textreader/TextReaderDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/common/textreader/TextReaderDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -141,11 +141,12 @@
AssignFileTotalTime := StopCount(C);
CloseFile(T);
- ReadLnLabel.Caption := Format('Lines: %d, TJclMappedTextReader: %.2f ms, TStringList: %.2f ms, AssignFile: %.2f ms',
+ ReadLnLabel.Caption := Format(
+ 'Lines: %d, TJclMappedTextReader: %.2f ms, TStringList: %.2f ms, AssignFile: %.2f ms',
[LineCount, TotalTime * 1000, StringListTotalTime * 1000, AssignFileTotalTime * 1000]);
finally
Screen.Cursor := crDefault;
- end;
+ end;
end;
Modified: branches/code_format/jcl/examples/windows/appinst/AppInstDemoMain.pas
===================================================================
--- branches/code_format/jcl/examples/windows/appinst/AppInstDemoMain.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/windows/appinst/AppInstDemoMain.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -50,7 +50,7 @@
begin
Items.BeginUpdate;
Items.Clear;
- for I := 0 to InstanceCount -1 do
+ for I := 0 to InstanceCount - 1 do
with Items.Add do
begin
Caption := IntToStr(I + 1);
@@ -124,20 +124,20 @@
// message sent from window of this instance
case ReadMessageCheck(Message, Handle) of
MyDataKind: // It is our data
- begin
- MemoChanging := True; // prevent deadlock, TMemo.OnChange is also fired now
- Memo1.Lines.BeginUpdate;
- try
+ begin
+ MemoChanging := True; // prevent deadlock, TMemo.OnChange is also fired now
+ Memo1.Lines.BeginUpdate;
+ try
// Read TStrings from the message
- ReadMessageStrings(Message, Memo1.Lines)
- finally
- Memo1.Lines.EndUpdate;
- MemoChanging := False;
- end;
- end;
- else
- inherited;
- end;
+ ReadMessageStrings(Message, Memo1.Lines)
+ finally
+ Memo1.Lines.EndUpdate;
+ MemoChanging := False;
+ end;
+ end;
+ else
+ inherited;
+ end;
end
else
inherited;
Modified: branches/code_format/jcl/examples/windows/clr/ClrDemoAbstractFrame.pas
===================================================================
--- branches/code_format/jcl/examples/windows/clr/ClrDemoAbstractFrame.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/windows/clr/ClrDemoAbstractFrame.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -2,7 +2,7 @@
interface
-uses
+uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, JclCLR;
@@ -37,62 +37,64 @@
pch: PChar;
DumpStr: string;
begin
- if AutoClear then memDump.Clear;
+ if AutoClear then
+ memDump.Clear;
ByteCount := 0;
- pch := Ptr;
+ pch := Ptr;
with TCanvas.Create do
- try
- Handle := GetDC(memDump.Handle);
- Font.Name := 'Fixedsys';
- Font.Size := 12;
- if (TextWidth('?')*WIDE_LINE_WIDTH) < memDump.ClientWidth then
- LineWidth := 16
- else if (TextWidth('?')*THIN_LINE_WIDTH) < memDump.ClientWidth then
- LineWidth := 8
- else
- LineWidth := 4;
- finally
- Free;
- end;
+ try
+ Handle := GetDC(memDump.Handle);
+ Font.Name := 'Fixedsys';
+ Font.Size := 12;
+ if (TextWidth('?') * WIDE_LINE_WIDTH) < memDump.ClientWidth then
+ LineWidth := 16
+ else
+ if (TextWidth('?') * THIN_LINE_WIDTH) < memDump.ClientWidth then
+ LineWidth := 8
+ else
+ LineWidth := 4;
+ finally
+ Free;
+ end;
with memDump.Lines do
- try
- BeginUpdate;
+ try
+ BeginUpdate;
- while ByteCount < Size do
- begin
- DumpStr := IntToHex(Base + DWord(ByteCount), 8) + ': ';
- for I:=0 to LineWidth-1 do
+ while ByteCount < Size do
begin
- if ((Size - ByteCount) > LineWidth) or ((Size - ByteCount) > I) then
- DumpStr := DumpStr + IntToHex(Integer(pch[ByteCount+I]), 2) + ' '
- else
- DumpStr := DumpStr + ' ';
- end;
+ DumpStr := IntToHex(Base + DWord(ByteCount), 8) + ': ';
+ for I := 0 to LineWidth - 1 do
+ begin
+ if ((Size - ByteCount) > LineWidth) or ((Size - ByteCount) > I) then
+ DumpStr := DumpStr + IntToHex(Integer(pch[ByteCount + I]), 2) + ' '
+ else
+ DumpStr := DumpStr + ' ';
+ end;
- DumpStr := DumpStr + '; ';
+ DumpStr := DumpStr + '; ';
- for I:=0 to LineWidth-1 do
- begin
- if ((Size - ByteCount) > LineWidth) or ((Size - ByteCount) > I) then
+ for I := 0 to LineWidth - 1 do
begin
- if CharIsAlphaNum(Char(pch[ByteCount+I])) then
- DumpStr := DumpStr + pch[ByteCount+I]
+ if ((Size - ByteCount) > LineWidth) or ((Size - ByteCount) > I) then
+ begin
+ if CharIsAlphaNum(Char(pch[ByteCount + I])) then
+ DumpStr := DumpStr + pch[ByteCount + I]
+ else
+ DumpStr := DumpStr + '.';
+ end
else
- DumpStr := DumpStr + '.'
- end
- else
- DumpStr := DumpStr + ' ';
+ DumpStr := DumpStr + ' ';
+ end;
+
+ Add(DumpStr);
+ Inc(ByteCount, LineWidth);
end;
-
- Add(DumpStr);
- Inc(ByteCount, LineWidth);
+ finally
+ EndUpdate;
end;
- finally
- EndUpdate;
- end;
memDump.Perform(WM_VSCROLL, SB_TOP, 0);
end;
Modified: branches/code_format/jcl/examples/windows/clr/ClrDemoBlobForm.pas
===================================================================
--- branches/code_format/jcl/examples/windows/clr/ClrDemoBlobForm.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/windows/clr/ClrDemoBlobForm.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -35,12 +35,12 @@
class procedure TfrmBlobs.Execute(const AStream: TJclCLRBlobStream);
begin
with TfrmBlobs.Create(nil) do
- try
- ShowBlobs(AStream);
- ShowModal;
- finally
- Free;
- end;
+ try
+ ShowBlobs(AStream);
+ ShowModal;
+ finally
+ Free;
+ end;
end;
procedure TfrmBlobs.ShowBlobs(const AStream: TJclCLRBlobStream);
@@ -53,15 +53,15 @@
Selected: Boolean);
begin
if Selected then
- with TJclCLRBlobRecord(Item.Data) do
- TfrmAbstract.DumpBuf(Memory, Size, memDump,
- FStream.Offset + DWORD(Memory) - DWORD(FStream.Data));
+ with TJclCLRBlobRecord(Item.Data) do
+ TfrmAbstract.DumpBuf(Memory, Size, memDump,
+ FStream.Offset + DWORD(Memory) - DWORD(FStream.Data));
end;
procedure TfrmBlobs.lstBlobsData(Sender: TObject; Item: TListItem);
begin
Item.Caption := IntToStr(Item.Index);
- Item.Data := FStream.Blobs[Item.Index];
+ Item.Data := FStream.Blobs[Item.Index];
Item.SubItems.Add('$' +
IntToHex(FStream.Blobs[Item.Index].Offset, 8));
Modified: branches/code_format/jcl/examples/windows/clr/ClrDemoCLRFrame.pas
===================================================================
--- branches/code_format/jcl/examples/windows/clr/ClrDemoCLRFrame.pas 2007-11-15 11:10:35 UTC (rev 2225)
+++ branches/code_format/jcl/examples/windows/clr/ClrDemoCLRFrame.pas 2007-11-15 17:36:08 UTC (rev 2226)
@@ -7,7 +7,7 @@
ClrDemoAbstractFrame, StdCtrls, JclCLR, CheckLst, ExtCtrls, ComCtrls;
type
- TfrmCLR = class (TfrmAbstract)
+ TfrmCLR = class(TfrmAbstract)
boxFlags: TGroupBox;
edtEntryPointToken: TEdit;
edtVer: TEdit;
@@ -29,7 +29,7 @@
public
procedure ShowInfo(const ACLR: TJclCLRHeaderEx); override;
end;
-
+
var
frmCLR: TfrmCLR;
@@ -45,27 +45,27 @@
{
*********************************** TfrmCLR ************************************
}
-procedure TfrmCLR.lstResourcesSelectItem(Sender: TObject; Item: TListItem;
- Selected: Boolean);
+procedure TfrmCLR.lstResourcesSelectItem(Sender: TObject; Item: TListItem;
+ Selected: Boolean);
begin
if Selected then
- with TJclCLRResourceRecord(Item.Data) do
- DumpBuf(Memory, Size, memResources, RVA);
+ with TJclCLRResourceRecord(Item.Data) do
+ DumpBuf(Memory, Size, memResources, RVA);
end;
procedure TfrmCLR.ShowInfo(const ACLR: TJclCLRHeaderEx);
-
+
procedure UpdateFlags;
var
AFlag: TJclClrImageFlag;
begin
- for AFlag:=Low(TJclClrImageFlag) to High(TJclClrImageFlag) do
+ for AFlag := Low(TJclClrImageFlag) to High(TJclClrImageFlag) do
begin
lstFlags.Checked[Integer(AFlag)] := AFlag in ACLR.Flags;
lstFlags.ItemEnabled[Integer(AFlag)] := False;
end;
end;
-
+
procedure UpdateEntryPointToken;
var
AMethod: TJclCLRTableMethodDefRow;
@@ -84,7 +84,8 @@
else
edtEntryPointToken.Text := AMethod.Name;
end
- else if ACLR.EntryPointToken is TJclCLRTableFileRow then
+ else
+ if ACLR.EntryPointToken is TJclCLRTableFileRow then
edtEntryPointToken.Text := 'External file'
else
edtEntryPointToken.Text := '$' + IntToHex(ACLR.Header.EntryPointToken, 8);
@@ -92,85 +93,85 @@
else
edtEntryPointToken.Text := '(none)';
end;
-
+
procedure UpdateStrongNameSign;
begin
if ACLR.HasStrongNameSignature then
with ACLR.StrongNameSignature, ACLR.Header.StrongNameSignature do
DumpBuf(Memory, Size, memStrongNameSign,
- VirtualAddress-ACLR.Image.RvaToSection(VirtualAddress).PointerToRawData)
+ VirtualAddress - ACLR.Image.RvaToSection(VirtualAddress).PointerToRawData)
else
memStrongNameSign.Clear;
end;
-
+
procedure UpdateResources;
var
I: Integer;
begin
with lstResources.Items do
- try
- BeginUpdate;
- Clear;
-
- if ACLR.HasResources then
- for I:=0 to ACLR.ResourceCount-1 do
- with Add do
- begin
- Caption := IntToStr(I);
- Data := ACLR.Resources[I];
- with ACLR.Resources[I] do
- begin
- SubItems.Add('$' + IntToHex(Offset, 8));
- SubItems.Add('$' + IntToHex(RVA, 8));
- SubItems.Add(IntToStr(Size));
- end;
- end
- else
- memResources.Clear;
- finally
- EndUpdate;
- end;
+ try
+ BeginUpdate;
+ Clear;
+
+ if ACLR.HasResources then
+ for I := 0 to ACLR.ResourceCount - 1 do
+ with Add do
+ begin
+ Caption := IntToStr(I);
+ Data := ACLR.Resources[I];
+ with ACLR.Resources[I] do
+ begin
+ SubItems.Add('$' + IntToHex(Offset, 8));
+ SubItems.Add('$' + IntToHex(RVA, 8));
+ SubItems.Add(IntToStr(Size));
+ end;
+ end
+ else
+ memResources.Clear;
+ finally
+ EndUpdate;
+ end;
end;
-
+
function FormatVTableKinds(const Kinds: TJclClrVTableKinds): string;
var
AKind: TJclClrVTableKind;
begin
Result := '';
- for AKind:=Low(TJclClrVTableKind) to High(TJclClrVTableKind) do
+ for AKind := Low(TJclClrVTableKind) to High(TJclClrVTableKind) do
...
[truncated message content] |
|
From: <ou...@us...> - 2007-11-15 11:10:37
|
Revision: 2225
http://jcl.svn.sourceforge.net/jcl/?rev=2225&view=rev
Author: outchy
Date: 2007-11-15 03:10:35 -0800 (Thu, 15 Nov 2007)
Log Message:
-----------
Initializing new repo for code format tests
Added Paths:
-----------
branches/code_format/
Copied: branches/code_format (from rev 2224, trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-15 11:09:05
|
Revision: 2224
http://jcl.svn.sourceforge.net/jcl/?rev=2224&view=rev
Author: outchy
Date: 2007-11-15 03:09:02 -0800 (Thu, 15 Nov 2007)
Log Message:
-----------
Deleting branch about code format tests (to be recreated from latest revision of trunk)
Removed Paths:
-------------
branches/code_format/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-15 10:03:19
|
Revision: 2223
http://jcl.svn.sourceforge.net/jcl/?rev=2223&view=rev
Author: outchy
Date: 2007-11-15 02:03:17 -0800 (Thu, 15 Nov 2007)
Log Message:
-----------
Fixing suspicious warning about unassigned result
Modified Paths:
--------------
trunk/jcl/source/common/JclArrayLists.pas
trunk/jcl/source/common/JclVectors.pas
trunk/jcl/source/prototypes/containers/JclArrayLists.imp
trunk/jcl/source/prototypes/containers/JclVectors.imp
Modified: trunk/jcl/source/common/JclArrayLists.pas
===================================================================
--- trunk/jcl/source/common/JclArrayLists.pas 2007-11-14 23:12:10 UTC (rev 2222)
+++ trunk/jcl/source/common/JclArrayLists.pas 2007-11-15 10:03:17 UTC (rev 2223)
@@ -2688,13 +2688,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeObject(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3249,13 +3252,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeString(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeString(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3810,13 +3816,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeString(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeString(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -4371,13 +4380,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeSingle(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeSingle(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -4932,13 +4944,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeDouble(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeDouble(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -5493,13 +5508,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeExtended(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeExtended(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -6054,13 +6072,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeInteger(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeInteger(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -6615,13 +6636,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeCardinal(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeCardinal(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -7176,13 +7200,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeInt64(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeInt64(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -7738,13 +7765,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreePointer(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreePointer(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -8300,13 +8330,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeObject(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -8857,13 +8890,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeItem(FElementData[Index]);
+ if Index < (FSize - 1) then
+ TJclBase<T>.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeItem(FElementData[Index]);
- if Index < (FSize - 1) then
- TJclBase<T>.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/common/JclVectors.pas
===================================================================
--- trunk/jcl/source/common/JclVectors.pas 2007-11-14 23:12:10 UTC (rev 2222)
+++ trunk/jcl/source/common/JclVectors.pas 2007-11-15 10:03:17 UTC (rev 2223)
@@ -2644,12 +2644,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeObject(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3145,12 +3148,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeString(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeString(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3646,12 +3652,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeString(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeString(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -4147,12 +4156,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeSingle(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeSingle(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -4648,12 +4660,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeDouble(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeDouble(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -5149,12 +5164,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeExtended(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeExtended(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -5650,12 +5668,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeInteger(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeInteger(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -6151,12 +6172,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeCardinal(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeCardinal(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -6652,12 +6676,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeInt64(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeInt64(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -7155,12 +7182,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreePointer(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreePointer(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -7657,12 +7687,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeObject(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -8155,12 +8188,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := FreeItem(FItems[Index]);
+ TJclBase<T>.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := FreeItem(FItems[Index]);
- TJclBase<T>.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/prototypes/containers/JclArrayLists.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-14 23:12:10 UTC (rev 2222)
+++ trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-15 10:03:17 UTC (rev 2223)
@@ -404,13 +404,16 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := RELEASERNAME(FElementData[Index]);
+ if Index < (FSize - 1) then
+ MOVEARRAY(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := RELEASERNAME(FElementData[Index]);
- if Index < (FSize - 1) then
- MOVEARRAY(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/prototypes/containers/JclVectors.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-14 23:12:10 UTC (rev 2222)
+++ trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-15 10:03:17 UTC (rev 2223)
@@ -350,12 +350,15 @@
WriteLock;
try
{$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Result := RELEASERNAME(FItems[Index]);
+ MOVEARRAY(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ end
+ else
raise EJclOutOfBoundsError.Create;
- Result := RELEASERNAME(FItems[Index]);
- MOVEARRAY(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
{$IFDEF THREADSAFE}
finally
WriteUnlock;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ah...@us...> - 2007-11-14 23:12:11
|
Revision: 2222
http://jcl.svn.sourceforge.net/jcl/?rev=2222&view=rev
Author: ahuser
Date: 2007-11-14 15:12:10 -0800 (Wed, 14 Nov 2007)
Log Message:
-----------
Jcl.NET for Delphi.NET 2007
Modified Paths:
--------------
trunk/jcl/packages/d11.net/Jedi.Jcl.dproj
trunk/jcl/packages/d11.net/template.dproj
trunk/jcl/source/common/JclBase.pas
trunk/jcl/source/common/JclCounter.pas
trunk/jcl/source/common/JclDateTime.pas
trunk/jcl/source/common/JclEDISEF.pas
trunk/jcl/source/common/JclEDIXML.pas
trunk/jcl/source/common/JclEDI_ANSIX12_Ext.pas
trunk/jcl/source/common/JclEDI_UNEDIFACT.pas
trunk/jcl/source/common/JclEDI_UNEDIFACT_Ext.pas
trunk/jcl/source/common/JclStringLists.pas
trunk/jcl/source/common/JclStrings.pas
trunk/jcl/source/windows/JclSynch.pas
Added Paths:
-----------
trunk/jcl/packages/d11.net/Jedi.Jcl.dpk
trunk/jcl/packages/d11.net/template.dpk
Removed Paths:
-------------
trunk/jcl/packages/d11.net/Jedi.Jcl.dpr
trunk/jcl/packages/d11.net/template.dpr
Added: trunk/jcl/packages/d11.net/Jedi.Jcl.dpk
===================================================================
--- trunk/jcl/packages/d11.net/Jedi.Jcl.dpk (rev 0)
+++ trunk/jcl/packages/d11.net/Jedi.Jcl.dpk 2007-11-14 23:12:10 UTC (rev 2222)
@@ -0,0 +1,148 @@
+package Jedi.Jcl;
+
+{$ALIGN 0}
+{$ASSERTIONS ON}
+{$BOOLEVAL OFF}
+{$DEBUGINFO ON}
+{$EXTENDEDSYNTAX ON}
+{$IMPORTEDDATA ON}
+{$IOCHECKS ON}
+{$LOCALSYMBOLS ON}
+{$LONGSTRINGS ON}
+{$OPENSTRINGS ON}
+{$OPTIMIZATION ON}
+{$OVERFLOWCHECKS OFF}
+{$RANGECHECKS OFF}
+{$REFERENCEINFO ON}
+{$SAFEDIVIDE OFF}
+{$STACKFRAMES OFF}
+{$TYPEDADDRESS OFF}
+{$VARSTRINGCHECKS ON}
+{$WRITEABLECONST OFF}
+{$MINENUMSIZE 1}
+{$IMAGEBASE $400000}
+{$RUNONLY}
+{$IMPLICITBUILD OFF}
+{$DEFINE DEBUG}
+
+requires
+ Borland.Delphi,
+ Borland.Vcl,
+ System.Drawing,
+ Borland.VclRtl;
+
+contains
+ JclAbstractContainers in '..\..\source\common\JclAbstractContainers.pas',
+ JclAlgorithms in '..\..\source\common\JclAlgorithms.pas',
+ JclAnsiStrings in '..\..\source\common\JclAnsiStrings.pas',
+ JclArrayLists in '..\..\source\common\JclArrayLists.pas',
+ JclArraySets in '..\..\source\common\JclArraySets.pas',
+ JclBase in '..\..\source\common\JclBase.pas',
+ JclBinaryTrees in '..\..\source\common\JclBinaryTrees.pas',
+ JclComplex in '..\..\source\common\JclComplex.pas',
+ JclContainerIntf in '..\..\source\common\JclContainerIntf.pas',
+ JclCounter in '..\..\source\common\JclCounter.pas',
+ JclDateTime in '..\..\source\common\JclDateTime.pas',
+ JclEDI in '..\..\source\common\JclEDI.pas',
+ JclEDI_ANSIX12 in '..\..\source\common\JclEDI_ANSIX12.pas',
+ JclEDI_ANSIX12_Ext in '..\..\source\common\JclEDI_ANSIX12_Ext.pas',
+ JclEDI_UNEDIFACT in '..\..\source\common\JclEDI_UNEDIFACT.pas',
+ JclEDI_UNEDIFACT_Ext in '..\..\source\common\JclEDI_UNEDIFACT_Ext.pas',
+ JclEDISEF in '..\..\source\common\JclEDISEF.pas',
+ JclEDITranslators in '..\..\source\common\JclEDITranslators.pas',
+ JclEDIXML in '..\..\source\common\JclEDIXML.pas',
+ JclFileUtils in '..\..\source\common\JclFileUtils.pas',
+ JclHashMaps in '..\..\source\common\JclHashMaps.pas',
+ JclHashSets in '..\..\source\common\JclHashSets.pas',
+ JclIniFiles in '..\..\source\common\JclIniFiles.pas',
+ JclLinkedLists in '..\..\source\common\JclLinkedLists.pas',
+ JclLogic in '..\..\source\common\JclLogic.pas',
+ JclMath in '..\..\source\common\JclMath.pas',
+ JclMime in '..\..\source\common\JclMime.pas',
+ JclQueues in '..\..\source\common\JclQueues.pas',
+ JclResources in '..\..\source\common\JclResources.pas',
+ JclRTTI in '..\..\source\common\JclRTTI.pas',
+ JclSimpleXml in '..\..\source\common\JclSimpleXml.pas',
+ JclStacks in '..\..\source\common\JclStacks.pas',
+ JclStatistics in '..\..\source\common\JclStatistics.pas',
+ JclStreams in '..\..\source\common\JclStreams.pas',
+ JclStringLists in '..\..\source\common\JclStringLists.pas',
+ JclStrings in '..\..\source\common\JclStrings.pas',
+ JclSysInfo in '..\..\source\common\JclSysInfo.pas',
+ JclSysUtils in '..\..\source\common\JclSysUtils.pas',
+ JclUnitConv in '..\..\source\common\JclUnitConv.pas',
+ JclValidation in '..\..\source\common\JclValidation.pas',
+ JclVectors in '..\..\source\common\JclVectors.pas',
+ JclSynch in '..\..\source\windows\JclSynch.pas';
+
+[assembly: AssemblyDescription('')]
+[assembly: AssemblyConfiguration('')]
+[assembly: AssemblyCompany('')]
+[assembly: AssemblyProduct('')]
+[assembly: AssemblyCopyright('')]
+[assembly: AssemblyTrademark('')]
+[assembly: AssemblyCulture('')]
+
+
+// Der Delphi-Compiler steuert AssemblyTitleAttribute via ExeDescription.
+// Sie k\xF6nnen dies in der IDE \xFCber Projekt/Optionen festlegen.
+// Wenn Sie das Attribut AssemblyTitle wie unten gezeigt manuell festlegen,
+// wird die IDE-Einstellung \xFCberschrieben.
+// [assembly: AssemblyTitle('')]
+
+
+//
+// Die Versionsinformation einer Assemblierung enth\xE4lt die folgenden vier Werte:
+//
+// Hauptversion
+// Nebenversion
+// Build-Nummer
+// Revision
+//
+// Sie k\xF6nnen alle vier Werte festlegen oder f\xFCr Revision und Build-Nummern die
+// Standardwerte mit '*' - wie nachfolgend gezeigt - verwenden:
+
+[assembly: AssemblyVersion('1.0.*')]
+
+//
+// Zum Signieren einer Assemblierung m\xFCssen Sie einen Schl\xFCssel angeben. Weitere Informationen
+// \xFCber das Signieren von Assemblierungen finden Sie in der Microsoft .NET Framework-Dokumentation.
+//
+// Mit den folgenden Attributen steuern Sie, welcher Schl\xFCssel f\xFCr die Signatur verwendet wird.
+//
+// Hinweise:
+// (*) Wenn kein Schl\xFCssel angegeben wird, ist die Assemblierung nicht signiert.
+// (*) KeyName verweist auf einen Schl\xFCssel, der im Crypto Service Provider
+// (CSP) auf Ihrem Rechner installiert wurde. KeyFile verweist auf eine
+// Datei, die einen Schl\xFCssel enth\xE4lt.
+// (*) Wenn sowohl der KeyFile- als auch der KeyName-Wert angegeben ist, wird
+// die folgende Verarbeitung durchgef\xFChrt:
+// (1) Wenn KeyName in dem CSP gefunden wird, wird dieser Schl\xFCssel verwendet.
+// (2) Wenn KeyName nicht, aber KeyFile vorhanden ist, wird der Schl\xFCssel
+// in KeyFile im CSP installiert und verwendet.
+// (*) Ein KeyFile k\xF6nnen Sie mit dem Utility sn.exe (Starker Name) erzeugen.
+// Der Speicherort von KeyFile sollte relativ zum Projektausgabeverzeichnis
+// angegeben werden. Wenn sich Ihr KeyFile im Projektverzeichnis befindet,
+// w\xFCrden Sie AssemblyKeyFile folgenderma\xDFen festlegen:
+// [assembly: AssemblyKeyFile('mykey.snk')], vorausgesetzt, Ihr
+// Ausgabeverzeichnis ist das Projektverzeichnis (Vorgabe).
+// (*) Verz\xF6gerte Signatur ist eine erweiterte Option; n\xE4here Informationen
+// dazu finden Sie in der Microsoft .NET Framework-Dokumentation.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile('')]
+[assembly: AssemblyKeyName('')]
+
+//
+// Verwenden Sie die folgenden Attribute zur Steuerung der COM-Sichtbarkeit Ihrer Assemblierung.
+// Standardm\xE4\xDFig ist die gesamte Assemblierung f\xFCr COM sichtbar. Die Einstellung false f\xFCr ComVisible
+// ist die f\xFCr Ihre Assemblierung empfohlene Vorgabe. Um dann eine Klasse und ein Interface f\xFCr COM
+// bereitzustellen, setzen Sie jeweils ComVisible auf true. Es wird auch empfohlen das Attribut
+// Guid hinzuzuf\xFCgen.
+//
+
+[assembly: ComVisible(False)]
+//[assembly: Guid('')]
+//[assembly: TypeLibVersion(1, 0)]
+
+end.
Deleted: trunk/jcl/packages/d11.net/Jedi.Jcl.dpr
===================================================================
--- trunk/jcl/packages/d11.net/Jedi.Jcl.dpr 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/packages/d11.net/Jedi.Jcl.dpr 2007-11-14 23:12:10 UTC (rev 2222)
@@ -1,66 +0,0 @@
-Library Jedi.Jcl;
-
-uses
- System.Reflection,
- System.Runtime.InteropServices
- ,
- JclAbstractContainers in '..\..\source\common\JclAbstractContainers.pas' ,
- JclAlgorithms in '..\..\source\common\JclAlgorithms.pas' ,
- JclAnsiStrings in '..\..\source\common\JclAnsiStrings.pas' ,
- JclArrayLists in '..\..\source\common\JclArrayLists.pas' ,
- JclArraySets in '..\..\source\common\JclArraySets.pas' ,
- JclBase in '..\..\source\common\JclBase.pas' ,
- JclBinaryTrees in '..\..\source\common\JclBinaryTrees.pas' ,
- JclComplex in '..\..\source\common\JclComplex.pas' ,
- JclContainerIntf in '..\..\source\common\JclContainerIntf.pas' ,
- JclDateTime in '..\..\source\common\JclDateTime.pas' ,
- JclFileUtils in '..\..\source\common\JclFileUtils.pas' ,
- JclHashMaps in '..\..\source\common\JclHashMaps.pas' ,
- JclHashSets in '..\..\source\common\JclHashSets.pas' ,
- JclIniFiles in '..\..\source\common\JclIniFiles.pas' ,
- JclLinkedLists in '..\..\source\common\JclLinkedLists.pas' ,
- JclLogic in '..\..\source\common\JclLogic.pas' ,
- JclMath in '..\..\source\common\JclMath.pas' ,
- JclMime in '..\..\source\common\JclMime.pas' ,
- JclQueues in '..\..\source\common\JclQueues.pas' ,
- JclResources in '..\..\source\common\JclResources.pas' ,
- JclRTTI in '..\..\source\common\JclRTTI.pas' ,
- JclSortedMaps in '..\..\source\common\JclSortedMaps.pas' ,
- JclStacks in '..\..\source\common\JclStacks.pas' ,
- JclStatistics in '..\..\source\common\JclStatistics.pas' ,
- JclStreams in '..\..\source\common\JclStreams.pas' ,
- JclStrings in '..\..\source\common\JclStrings.pas' ,
- JclSysInfo in '..\..\source\common\JclSysInfo.pas' ,
- JclSysUtils in '..\..\source\common\JclSysUtils.pas' ,
- JclUnitConv in '..\..\source\common\JclUnitConv.pas' ,
- JclValidation in '..\..\source\common\JclValidation.pas' ,
- JclVectors in '..\..\source\common\JclVectors.pas'
- ;
-
-{$LIBSUFFIX '11'}
-
-[assembly: AssemblyTitle('JEDI Code Library')]
-[assembly: AssemblyDescription('JEDI Code Library RTL package')]
-[assembly: AssemblyConfiguration('')]
-[assembly: AssemblyCompany('Project JEDI')]
-[assembly: AssemblyProduct('JEDI Code Library')]
-[assembly: AssemblyCopyright('Copyright (C) 1999, 2007 Project JEDI')]
-[assembly: AssemblyTrademark('')]
-[assembly: AssemblyCulture('')]
-
-// MajorVersion.MinorVersion.BuildNumber.Revision
-[assembly: AssemblyVersion('1.102.0.2726')]
-
-// Package signature
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile('')]
-[assembly: AssemblyKeyName('')]
-
-// Com visibility of the assembly
-[assembly: ComVisible(False)]
-//[assembly: Guid('')]
-//[assembly: TypeLibVersion(1, 0)]
-
-
-begin
-end.
Modified: trunk/jcl/packages/d11.net/Jedi.Jcl.dproj
===================================================================
--- trunk/jcl/packages/d11.net/Jedi.Jcl.dproj 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/packages/d11.net/Jedi.Jcl.dproj 2007-11-14 23:12:10 UTC (rev 2222)
@@ -1,11 +1,13 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <ProjectGuid>{44DB645B-C167-410D-9334-38AF9F0C7913}</ProjectGuid>
- <MainSource>Jedi.Jcl.dpr</MainSource>
+ <ProjectGuid>{42539ecc-f491-48a0-929a-5b8ff3a9fb1f}</ProjectGuid>
+ <MainSource>Jedi.Jcl.dpk</MainSource>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<DCC_DCCCompiler>DCCIL</DCC_DCCCompiler>
- <DCC_DependencyCheckOutputName>Jedi.Jcl110.dll</DCC_DependencyCheckOutputName>
+ <DCC_DependencyCheckOutputName>C:\Dokumente und Einstellungen\All Users\Dokumente\RAD Studio\5.0\Bpl\Jedi.Jcl.dll</DCC_DependencyCheckOutputName>
+ <DCC_UsePackage>Borland.VclRtl;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll;Borland.Vcl;Borland.Delphi</DCC_UsePackage>
<DCC_EnabledPackages>true</DCC_EnabledPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -14,110 +16,109 @@
<DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE</DCC_Define>
- <DCC_DcuOutput>..\..\lib\d11.net</DCC_DcuOutput>
- <DCC_ObjOutput>..\..\lib\d11.net</DCC_ObjOutput>
- <DCC_HppOutput>..\..\lib\d11.net</DCC_HppOutput>
- <DCC_DcpOutput>..\..\lib\d11.net</DCC_DcpOutput>
- <DCC_UnitSearchPath>..\..\lib\d11.net;..\..\source</DCC_UnitSearchPath>
- <DCC_ResourcePath>..\..\lib\d11.net;..\..\source</DCC_ResourcePath>
- <DCC_ObjPath>..\..\lib\d11.net;..\..\source</DCC_ObjPath>
- <DCC_IncludePath>..\..\lib\d11.net;..\..\source</DCC_IncludePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Version>7.0</Version>
<DCC_DebugInfoInExe>True</DCC_DebugInfoInExe>
<DCC_DebugVN>True</DCC_DebugVN>
<DCC_Define>DEBUG</DCC_Define>
+ <DCC_Platform>x86</DCC_Platform>
+ <DCC_NameSpace>Borland.Vcl</DCC_NameSpace>
+ <DCC_UnitSearchPath>..\..\source;C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;$(BDSCOMMONDIR)\Bpl;C:\WINDOWS\assembly\GAC_MSIL\Borland.VclRtl\11.0.5000.9245__91d62ebb5b0d1b1b</DCC_UnitSearchPath>
+ <DCC_ResourcePath>..\..\source;C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;$(BDSCOMMONDIR)\Bpl;C:\WINDOWS\assembly\GAC_MSIL\Borland.VclRtl\11.0.5000.9245__91d62ebb5b0d1b1b</DCC_ResourcePath>
+ <DCC_IncludePath>..\..\source;C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;$(BDSCOMMONDIR)\Bpl;C:\WINDOWS\assembly\GAC_MSIL\Borland.VclRtl\11.0.5000.9245__91d62ebb5b0d1b1b</DCC_IncludePath>
<DCC_DcuOutput>..\..\lib\d11.net</DCC_DcuOutput>
<DCC_ObjOutput>..\..\lib\d11.net</DCC_ObjOutput>
<DCC_HppOutput>..\..\lib\d11.net</DCC_HppOutput>
<DCC_DcpOutput>..\..\lib\d11.net</DCC_DcpOutput>
- <DCC_UnitSearchPath>..\..\lib\d11.net;..\..\source</DCC_UnitSearchPath>
- <DCC_ResourcePath>..\..\lib\d11.net;..\..\source</DCC_ResourcePath>
- <DCC_ObjPath>..\..\lib\d11.net;..\..\source</DCC_ObjPath>
- <DCC_IncludePath>..\..\lib\d11.net;..\..\source</DCC_IncludePath>
+ <DCC_SYMBOL_DEPRECATED>False</DCC_SYMBOL_DEPRECATED>
+ <DCC_SYMBOL_PLATFORM>False</DCC_SYMBOL_PLATFORM>
+ <DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM>
+ <DCC_UNIT_DEPRECATED>False</DCC_UNIT_DEPRECATED>
+ <DCC_WIDECHAR_REDUCED>False</DCC_WIDECHAR_REDUCED>
</PropertyGroup>
<ProjectExtensions>
<Borland.Personality>DelphiDotNet.Personality</Borland.Personality>
- <Borland.ProjectType>Library</Borland.ProjectType>
+ <Borland.ProjectType>Package</Borland.ProjectType>
<BorlandProject>
- <BorlandProject xmlns="">
- <DelphiDotNet.Personality>
- <Parameters>
- <Parameters Name="UseLauncher">False</Parameters>
- <Parameters Name="LoadAllSymbols">True</Parameters>
- <Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
- </Parameters>
- <VersionInfo>
- <VersionInfo Name="IncludeVerInfo">True</VersionInfo>
- <VersionInfo Name="AutoIncBuild">False</VersionInfo>
- <VersionInfo Name="MajorVer">1</VersionInfo>
- <VersionInfo Name="MinorVer">102</VersionInfo>
- <VersionInfo Name="Release">0</VersionInfo>
- <VersionInfo Name="Build">2726</VersionInfo>
- <VersionInfo Name="Debug">False</VersionInfo>
- <VersionInfo Name="PreRelease">False</VersionInfo>
- <VersionInfo Name="Special">False</VersionInfo>
- <VersionInfo Name="Private">False</VersionInfo>
- <VersionInfo Name="DLL">True</VersionInfo>
- <VersionInfo Name="Locale">1031</VersionInfo>
- <VersionInfo Name="CodePage">1252</VersionInfo>
- </VersionInfo>
- <VersionInfoKeys>
- <VersionInfoKeys Name="CompanyName">Project JEDI</VersionInfoKeys>
- <VersionInfoKeys Name="FileDescription">JEDI Code Library RTL package</VersionInfoKeys>
- <VersionInfoKeys Name="FileVersion">1.102.0.2726</VersionInfoKeys>
- <VersionInfoKeys Name="InternalName">Jedi.Jcl</VersionInfoKeys>
- <VersionInfoKeys Name="LegalCopyright">Copyright (C) 1999, 2007 Project JEDI</VersionInfoKeys>
- <VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
- <VersionInfoKeys Name="OriginalFilename">Jedi.Jcl110.dll</VersionInfoKeys>
- <VersionInfoKeys Name="ProductName">JEDI Code Library</VersionInfoKeys>
- <VersionInfoKeys Name="ProductVersion">1.102 Build 2726</VersionInfoKeys>
- <VersionInfoKeys Name="Comments"></VersionInfoKeys>
- </VersionInfoKeys>
- <Source>
- <Source Name="MainSource">Jedi.Jcl.dpr</Source>
- </Source>
- </DelphiDotNet.Personality>
- </BorlandProject>
- </BorlandProject>
+<BorlandProject><DelphiDotNet.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">False</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">True</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1031</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Jedi.Jcl.dpk</Source></Source></DelphiDotNet.Personality></BorlandProject></BorlandProject>
</ProjectExtensions>
- <ItemGroup />
+ <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
<ItemGroup>
- <DelphiCompile Include="Jedi.Jcl.dpr">
+ <Reference Include="$(SystemRoot)\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll">
+ <AssemblyName>System.Drawing</AssemblyName>
+ <Version>2.0.0.0</Version>
+ <HintPath>$(SystemRoot)\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll</HintPath>
+ <AssemblyTag>$(SystemRoot)\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll</AssemblyTag>
+ <LinkUnits>False</LinkUnits>
+ </Reference>
+ <Reference Include="C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Delphi.dll">
+ <AssemblyName>Borland.Delphi</AssemblyName>
+ <Version>11.0.5000.9245</Version>
+ <HintPath>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Delphi.dll</HintPath>
+ <AssemblyTag>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Delphi.dll</AssemblyTag>
+ <LinkUnits>False</LinkUnits>
+ </Reference>
+ <Reference Include="C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Vcl.dll">
+ <AssemblyName>Borland.Vcl</AssemblyName>
+ <Version>11.0.5000.9245</Version>
+ <HintPath>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Vcl.dll</HintPath>
+ <AssemblyTag>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.Vcl.dll</AssemblyTag>
+ <LinkUnits>False</LinkUnits>
+ </Reference>
+ <Reference Include="C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.VclRtl.dll">
+ <AssemblyName>Borland.VclRtl</AssemblyName>
+ <Version>11.0.5000.9245</Version>
+ <HintPath>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.VclRtl.dll</HintPath>
+ <AssemblyTag>C:\Programme\Gemeinsame Dateien\CodeGear Shared\Rad Studio\Shared Assemblies\5.0\Borland.VclRtl.dll</AssemblyTag>
+ <LinkUnits>False</LinkUnits>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <DelphiCompile Include="Jedi.Jcl.dpk">
<MainSource>MainSource</MainSource>
</DelphiCompile>
- <DCCReference Include="..\..\source\common\JclAbstractContainers.pas"/>
- <DCCReference Include="..\..\source\common\JclAlgorithms.pas"/>
- <DCCReference Include="..\..\source\common\JclAnsiStrings.pas"/>
- <DCCReference Include="..\..\source\common\JclArrayLists.pas"/>
- <DCCReference Include="..\..\source\common\JclArraySets.pas"/>
- <DCCReference Include="..\..\source\common\JclBase.pas"/>
- <DCCReference Include="..\..\source\common\JclBinaryTrees.pas"/>
- <DCCReference Include="..\..\source\common\JclComplex.pas"/>
- <DCCReference Include="..\..\source\common\JclContainerIntf.pas"/>
- <DCCReference Include="..\..\source\common\JclDateTime.pas"/>
- <DCCReference Include="..\..\source\common\JclFileUtils.pas"/>
- <DCCReference Include="..\..\source\common\JclHashMaps.pas"/>
- <DCCReference Include="..\..\source\common\JclHashSets.pas"/>
- <DCCReference Include="..\..\source\common\JclIniFiles.pas"/>
- <DCCReference Include="..\..\source\common\JclLinkedLists.pas"/>
- <DCCReference Include="..\..\source\common\JclLogic.pas"/>
- <DCCReference Include="..\..\source\common\JclMath.pas"/>
- <DCCReference Include="..\..\source\common\JclMime.pas"/>
- <DCCReference Include="..\..\source\common\JclQueues.pas"/>
- <DCCReference Include="..\..\source\common\JclResources.pas"/>
- <DCCReference Include="..\..\source\common\JclRTTI.pas"/>
- <DCCReference Include="..\..\source\common\JclSortedMaps.pas"/>
- <DCCReference Include="..\..\source\common\JclStacks.pas"/>
- <DCCReference Include="..\..\source\common\JclStatistics.pas"/>
- <DCCReference Include="..\..\source\common\JclStreams.pas"/>
- <DCCReference Include="..\..\source\common\JclStrings.pas"/>
- <DCCReference Include="..\..\source\common\JclSysInfo.pas"/>
- <DCCReference Include="..\..\source\common\JclSysUtils.pas"/>
- <DCCReference Include="..\..\source\common\JclUnitConv.pas"/>
- <DCCReference Include="..\..\source\common\JclValidation.pas"/>
- <DCCReference Include="..\..\source\common\JclVectors.pas"/>
+ <DCCReference Include="..\..\source\common\JclAbstractContainers.pas" />
+ <DCCReference Include="..\..\source\common\JclAlgorithms.pas" />
+ <DCCReference Include="..\..\source\common\JclAnsiStrings.pas" />
+ <DCCReference Include="..\..\source\common\JclArrayLists.pas" />
+ <DCCReference Include="..\..\source\common\JclArraySets.pas" />
+ <DCCReference Include="..\..\source\common\JclBase.pas" />
+ <DCCReference Include="..\..\source\common\JclBinaryTrees.pas" />
+ <DCCReference Include="..\..\source\common\JclComplex.pas" />
+ <DCCReference Include="..\..\source\common\JclContainerIntf.pas" />
+ <DCCReference Include="..\..\source\common\JclCounter.pas" />
+ <DCCReference Include="..\..\source\common\JclDateTime.pas" />
+ <DCCReference Include="..\..\source\common\JclEDI.pas" />
+ <DCCReference Include="..\..\source\common\JclEDISEF.pas" />
+ <DCCReference Include="..\..\source\common\JclEDITranslators.pas" />
+ <DCCReference Include="..\..\source\common\JclEDIXML.pas" />
+ <DCCReference Include="..\..\source\common\JclEDI_ANSIX12.pas" />
+ <DCCReference Include="..\..\source\common\JclEDI_ANSIX12_Ext.pas" />
+ <DCCReference Include="..\..\source\common\JclEDI_UNEDIFACT.pas" />
+ <DCCReference Include="..\..\source\common\JclEDI_UNEDIFACT_Ext.pas" />
+ <DCCReference Include="..\..\source\common\JclFileUtils.pas" />
+ <DCCReference Include="..\..\source\common\JclHashMaps.pas" />
+ <DCCReference Include="..\..\source\common\JclHashSets.pas" />
+ <DCCReference Include="..\..\source\common\JclIniFiles.pas" />
+ <DCCReference Include="..\..\source\common\JclLinkedLists.pas" />
+ <DCCReference Include="..\..\source\common\JclLogic.pas" />
+ <DCCReference Include="..\..\source\common\JclMath.pas" />
+ <DCCReference Include="..\..\source\common\JclMime.pas" />
+ <DCCReference Include="..\..\source\common\JclQueues.pas" />
+ <DCCReference Include="..\..\source\common\JclResources.pas" />
+ <DCCReference Include="..\..\source\common\JclRTTI.pas" />
+ <DCCReference Include="..\..\source\common\JclSimpleXml.pas" />
+ <DCCReference Include="..\..\source\common\JclStacks.pas" />
+ <DCCReference Include="..\..\source\common\JclStatistics.pas" />
+ <DCCReference Include="..\..\source\common\JclStreams.pas" />
+ <DCCReference Include="..\..\source\common\JclStringLists.pas" />
+ <DCCReference Include="..\..\source\common\JclStrings.pas" />
+ <DCCReference Include="..\..\source\common\JclSysInfo.pas" />
+ <DCCReference Include="..\..\source\common\JclSysUtils.pas" />
+ <DCCReference Include="..\..\source\common\JclUnitConv.pas" />
+ <DCCReference Include="..\..\source\common\JclValidation.pas" />
+ <DCCReference Include="..\..\source\common\JclVectors.pas" />
+ <DCCReference Include="..\..\source\windows\JclSynch.pas" />
</ItemGroup>
- <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
-</Project>
+</Project>
\ No newline at end of file
Added: trunk/jcl/packages/d11.net/template.dpk
===================================================================
--- trunk/jcl/packages/d11.net/template.dpk (rev 0)
+++ trunk/jcl/packages/d11.net/template.dpk 2007-11-14 23:12:10 UTC (rev 2222)
@@ -0,0 +1,75 @@
+package %NAME%;
+{
+-----------------------------------------------------------------------------
+ DO NOT EDIT THIS FILE, IT IS GENERATED BY THE PACKAGE GENERATOR
+ ALWAYS EDIT THE RELATED XML FILE (%XMLNAME%)
+
+ Last generated: %DATETIME%
+-----------------------------------------------------------------------------
+}
+<%%% BEGIN PROGRAMONLY %%%>
+<%%% DO NOT GENERATE %%%>
+<%%% END PROGRAMONLY %%%>
+<%%% BEGIN LIBRARYONLY %%%>
+<%%% DO NOT GENERATE %%%>
+<%%% END LIBRARYONLY %%%>
+
+{$ALIGN 0}
+{$ASSERTIONS ON}
+{$BOOLEVAL OFF}
+{$DEBUGINFO ON}
+{$EXTENDEDSYNTAX ON}
+{$IMPORTEDDATA ON}
+{$IOCHECKS ON}
+{$LOCALSYMBOLS ON}
+{$LONGSTRINGS ON}
+{$OPENSTRINGS ON}
+{$OPTIMIZATION ON}
+{$OVERFLOWCHECKS OFF}
+{$RANGECHECKS OFF}
+{$REFERENCEINFO ON}
+{$SAFEDIVIDE OFF}
+{$STACKFRAMES OFF}
+{$TYPEDADDRESS OFF}
+{$VARSTRINGCHECKS ON}
+{$WRITEABLECONST OFF}
+{$MINENUMSIZE 1}
+{$IMAGEBASE $%IMAGE_BASE%}
+{$%TYPE%ONLY}
+{$IMPLICITBUILD OFF}
+
+requires
+<%%% START REQUIRES %%%>
+ %NAME%,
+<%%% END REQUIRES %%%>
+ ;
+
+contains
+<%%% START FILES %%%>
+ %UNITNAME% in '%FILENAME%' {%FORMNAMEANDTYPE%},
+<%%% END FILES %%%>
+ ;
+
+[assembly: AssemblyTitle('JEDI Code Library for .NET')]
+[assembly: AssemblyDescription('%DESCRIPTION%')]
+[assembly: AssemblyConfiguration('')]
+[assembly: AssemblyCompany('Project JEDI')]
+[assembly: AssemblyProduct('JEDI Code Library')]
+[assembly: AssemblyCopyright('Copyright (C) 1999, 2007 Project JEDI')]
+[assembly: AssemblyTrademark('')]
+[assembly: AssemblyCulture('')]
+
+// MajorVersion.MinorVersion.BuildNumber.Revision
+[assembly: AssemblyVersion('%VERSION_MAJOR_NUMBER%.%VERSION_MINOR_NUMBER%.%RELEASE_NUMBER%.%BUILD_NUMBER%')]
+
+// Package signature
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile('')]
+[assembly: AssemblyKeyName('')]
+
+// Com visibility of the assembly
+[assembly: ComVisible(False)]
+//[assembly: Guid('')]
+//[assembly: TypeLibVersion(1, 0)]
+
+end.
\ No newline at end of file
Deleted: trunk/jcl/packages/d11.net/template.dpr
===================================================================
--- trunk/jcl/packages/d11.net/template.dpr 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/packages/d11.net/template.dpr 2007-11-14 23:12:10 UTC (rev 2222)
@@ -1,39 +0,0 @@
-%PROJECT% %NAME%;
-
-uses
-<%%% START REQUIRES %%%>
- %NAME%,
-<%%% END REQUIRES %%%>
- ,
-<%%% START FILES %%%>
- %UNITNAME% in '%FILENAME%' {%FORMNAMEANDTYPE%},
-<%%% END FILES %%%>
- ;
-
-{$LIBSUFFIX '11'}
-
-[assembly: AssemblyTitle('JEDI Code Library')]
-[assembly: AssemblyDescription('%DESCRIPTION%')]
-[assembly: AssemblyConfiguration('')]
-[assembly: AssemblyCompany('Project JEDI')]
-[assembly: AssemblyProduct('JEDI Code Library')]
-[assembly: AssemblyCopyright('Copyright (C) 1999, 2007 Project JEDI')]
-[assembly: AssemblyTrademark('')]
-[assembly: AssemblyCulture('')]
-
-// MajorVersion.MinorVersion.BuildNumber.Revision
-[assembly: AssemblyVersion('%VERSION_MAJOR_NUMBER%.%VERSION_MINOR_NUMBER%.%RELEASE_NUMBER%.%BUILD_NUMBER%')]
-
-// Package signature
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile('')]
-[assembly: AssemblyKeyName('')]
-
-// Com visibility of the assembly
-[assembly: ComVisible(False)]
-//[assembly: Guid('')]
-//[assembly: TypeLibVersion(1, 0)]
-
-
-begin
-end.
Modified: trunk/jcl/packages/d11.net/template.dproj
===================================================================
--- trunk/jcl/packages/d11.net/template.dproj 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/packages/d11.net/template.dproj 2007-11-14 23:12:10 UTC (rev 2222)
@@ -1,11 +1,12 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>%GUID%</ProjectGuid>
<MainSource>%NAME%%SOURCEEXTENSION%</MainSource>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<DCC_DCCCompiler>DCCIL</DCC_DCCCompiler>
- <DCC_DependencyCheckOutputName>%NAME%110%BINEXTENSION%</DCC_DependencyCheckOutputName>
+ <DCC_DependencyCheckOutputName>%NAME%%BINEXTENSION%</DCC_DependencyCheckOutputName>
<DCC_EnabledPackages>true</DCC_EnabledPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -70,7 +71,7 @@
<VersionInfoKeys Name="InternalName">%NAME%</VersionInfoKeys>
<VersionInfoKeys Name="LegalCopyright">Copyright (C) 1999, 2007 Project JEDI</VersionInfoKeys>
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
- <VersionInfoKeys Name="OriginalFilename">%NAME%110%BINEXTENSION%</VersionInfoKeys>
+ <VersionInfoKeys Name="OriginalFilename">%NAME%%BINEXTENSION%</VersionInfoKeys>
<VersionInfoKeys Name="ProductName">JEDI Code Library</VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">%VERSION_MAJOR_NUMBER%.%VERSION_MINOR_NUMBER% Build %BUILD_NUMBER%</VersionInfoKeys>
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
Modified: trunk/jcl/source/common/JclBase.pas
===================================================================
--- trunk/jcl/source/common/JclBase.pas 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/source/common/JclBase.pas 2007-11-14 23:12:10 UTC (rev 2222)
@@ -47,7 +47,7 @@
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
{$IFDEF CLR}
- System.Reflection,
+ Classes, System.Reflection,
{$ELSE}
{$IFDEF MSWINDOWS}
Windows,
@@ -162,6 +162,9 @@
type
PLargeInteger = ^TLargeInteger;
TLargeInteger = Int64;
+ {$IFNDEF COMPILER11_UP}
+ TBytes = array of Byte;
+ {$ENDIF ~COMPILER11_UP}
{$IFDEF CLR}
type
@@ -265,16 +268,40 @@
procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: Integer); overload;
procedure MoveChar(const Source: string; FromIndex: Integer;
var Dest: string; ToIndex, Count: Integer); overload; // Index: 0..n-1
+
{$IFDEF CLR}
function GetBytesEx(const Value): TBytes;
procedure SetBytesEx(var Value; Bytes: TBytes);
procedure SetIntegerSet(var DestSet: TIntegerSet; Value: UInt32); inline;
-function ByteArrayStringLen(Data: TBytes): Integer;
-function StringToByteArray(const S: string): TBytes;
-function ByteArrayToString(const Data: TBytes; Count: Integer): string;
+function AnsiByteArrayStringLen(Data: TBytes): Integer;
+function StringToAnsiByteArray(const S: string): TBytes;
+function AnsiByteArrayToString(const Data: TBytes; Count: Integer): string;
+
+type
+ TStringAnsiBufferStreamHelper = class helper for TStream
+ public
+ function WriteStringAnsiBuffer(const Buffer: string): Integer; overload;
+ function WriteStringAnsiBuffer(const Buffer: string; StrLen: Integer): Integer; overload;
+ function ReadStringAnsiBuffer(var Buffer: string; AnsiLen: Integer): Integer; overload;
+
+ function WriteStringAnsiBuffer(const Buffer: AnsiString): Integer; overload;
+ function WriteStringAnsiBuffer(const Buffer: AnsiString; StrLen: Integer): Integer; overload;
+ function ReadStringAnsiBuffer(var Buffer: AnsiString; AnsiLen: Integer): Integer; overload;
+ end;
{$ENDIF CLR}
+{$IFNDEF CLR}
+function BytesOf(const Value: AnsiString): TBytes; overload;
+{$IFDEF COMPILER6_UP}
+function BytesOf(const Value: WideString): TBytes; overload;
+function BytesOf(const Value: WideChar): TBytes; overload;
+{$ENDIF COMPILER6_UP}
+function BytesOf(const Value: AnsiChar): TBytes; overload;
+function StringOf(const Bytes: array of Byte): AnsiString; overload;
+function StringOf(const Bytes: Pointer; Size: Cardinal): AnsiString; overload;
+{$ENDIF CLR}
+
type
TJclAddr64 = Int64;
TJclAddr32 = Cardinal;
@@ -284,7 +311,7 @@
{$ELSE ~64BIT}
TJclAddr = TJclAddr32;
{$ENDIF}
-
+
EJclAddr64Exception = class(EJclError);
function Addr64ToAddr32(const Value: TJclAddr64): TJclAddr32;
@@ -1038,7 +1065,7 @@
DestSet := TIntegerSet(Value);
end;
-function ByteArrayStringLen(Data: TBytes): Integer;
+function AnsiByteArrayStringLen(Data: TBytes): Integer;
var
I: Integer;
begin
@@ -1051,7 +1078,7 @@
Result := Length(Data);
end;
-function StringToByteArray(const S: string): TBytes;
+function StringToAnsiByteArray(const S: string): TBytes;
var
I: Integer;
AnsiS: AnsiString;
@@ -1062,7 +1089,7 @@
Result[I] := Byte(AnsiS[I + 1]);
end;
-function ByteArrayToString(const Data: TBytes; Count: Integer): string;
+function AnsiByteArrayToString(const Data: TBytes; Count: Integer): string;
var
I: Integer;
AnsiS: AnsiString;
@@ -1075,6 +1102,121 @@
Result := AnsiS; // convert to System.String
end;
+// == { TStringAnsiBufferStreamHelper } ======================================
+
+function TStringAnsiBufferStreamHelper.WriteStringAnsiBuffer(const Buffer: string; StrLen: Integer): Integer;
+begin
+ Result := WriteStringAnsiBuffer(Copy(Buffer, StrLen));
+end;
+
+function TStringAnsiBufferStreamHelper.WriteStringAnsiBuffer(const Buffer: string): Integer;
+var
+ Bytes: TBytes;
+begin
+ Bytes := StringToAnsiByteArray(Buffer);
+ Result := Write(Bytes, Length(Bytes));
+end;
+
+function TStringAnsiBufferStreamHelper.ReadStringAnsiBuffer(var Buffer: string; AnsiLen: Integer): Integer;
+var
+ Bytes: TBytes;
+begin
+ if AnsiLen > 0 then
+ begin
+ SetLength(Bytes, AnsiLen);
+ Result := Read(Bytes, AnsiLen);
+ Buffer := AnsiByteArrayToString(Bytes, Result);
+ end
+ else
+ begin
+ Buffer := '';
+ Result := 0;
+ end;
+end;
+
+function TStringAnsiBufferStreamHelper.WriteStringAnsiBuffer(const Buffer: AnsiString; StrLen: Integer): Integer;
+begin
+ Result := WriteStringAnsiBuffer(Copy(Buffer, StrLen));
+end;
+
+function TStringAnsiBufferStreamHelper.WriteStringAnsiBuffer(const Buffer: AnsiString): Integer;
+var
+ Bytes: TBytes;
+begin
+ Bytes := BytesOf(Buffer);
+ Result := Write(Bytes, Length(Bytes));
+end;
+
+function TStringAnsiBufferStreamHelper.ReadStringAnsiBuffer(var Buffer: AnsiString; AnsiLen: Integer): Integer;
+var
+ Bytes: TBytes;
+begin
+ if AnsiLen > 0 then
+ begin
+ SetLength(Bytes, AnsiLen);
+ Result := Read(Bytes, AnsiLen);
+ SetLength(Bytes, Result);
+ Buffer := StringOf(Bytes);
+ end
+ else
+ begin
+ Buffer := '';
+ Result := 0;
+ end;
+end;
+
+{$ELSE}
+
+function BytesOf(const Value: AnsiString): TBytes;
+begin
+ SetLength(Result, Length(Value));
+ if Value <> '' then
+ Move(Pointer(Value)^, Result[0], Length(Value));
+end;
+
+{$IFDEF COMPILER6_UP}
+function BytesOf(const Value: WideString): TBytes;
+begin
+ if Value <> '' then
+ Result := BytesOf(AnsiString(Value))
+ else
+ SetLength(Result, 0);
+end;
+
+function BytesOf(const Value: WideChar): TBytes;
+begin
+ Result := BytesOf(WideString(Value));
+end;
+{$ENDIF COMPILER6_UP}
+
+function BytesOf(const Value: AnsiChar): TBytes;
+begin
+ SetLength(Result, 1);
+ Result[0] := Byte(Value);
+end;
+
+function StringOf(const Bytes: array of Byte): AnsiString;
+begin
+ if Length(Bytes) > 0 then
+ begin
+ SetLength(Result, Length(Bytes));
+ Move(Bytes[0], Pointer(Result)^, Length(Bytes));
+ end
+ else
+ Result := '';
+end;
+
+function StringOf(const Bytes: Pointer; Size: Cardinal): AnsiString;
+begin
+ if (Bytes <> nil) and (Size > 0) then
+ begin
+ SetLength(Result, Size);
+ Move(Bytes^, Pointer(Result)^, Size);
+ end
+ else
+ Result := '';
+end;
+
{$ENDIF CLR}
//== { EJclWin32Error } ======================================================
Modified: trunk/jcl/source/common/JclCounter.pas
===================================================================
--- trunk/jcl/source/common/JclCounter.pas 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/source/common/JclCounter.pas 2007-11-14 23:12:10 UTC (rev 2222)
@@ -102,6 +102,15 @@
SysUtils,
JclResources;
+procedure NoCounterError;
+begin
+ {$IFDEF CLR}
+ raise EJclCounterError.Create(RsNoCounter);
+ {$ELSE}
+ raise EJclCounterError.CreateRes(@RsNoCounter);
+ {$ENDIF CLR}
+end;
+
constructor TJclCounter.Create(const Compensate: Boolean);
const
Iterations: Integer = 10000;
@@ -113,7 +122,7 @@
{$IFDEF MSWINDOWS}
if not QueryPerformanceFrequency(FFrequency) then
- raise EJclCounterError.CreateRes(@RsNoCounter);
+ NoCounterError;
{$ENDIF MSWINDOWS}
{$IFDEF LINUX}
FFrequency := 100000; // 1 sec = 10E6 microseconds, therefore we have to divide by 10E5
@@ -147,8 +156,8 @@
FElapsedTime := 0;
FOverallElapsedTime := 0;
{$IFDEF MSWINDOWS}
- if not QueryPerformanceCounter(FStart) then
- raise EJclCounterError.CreateRes(@RsNoCounter);
+ if not QueryPerformanceCounter(FStart) then
+ NoCounterError;
{$ENDIF MSWINDOWS}
{$IFDEF LINUX}
GetTimeOfDay(FTimeval, nil);
@@ -160,7 +169,7 @@
begin
{$IFDEF MSWINDOWS}
if not QueryPerformanceCounter(FStop) then
- raise EJclCounterError.CreateRes(@RsNoCounter);
+ NoCounterError;
{$ENDIF MSWINDOWS}
{$IFDEF LINUX}
GetTimeOfDay(FTimeval, nil);
@@ -178,7 +187,7 @@
begin
{$IFDEF MSWINDOWS}
if not QueryPerformanceCounter(TimeNow) then
- raise EJclCounterError.CreateRes(@RsNoCounter);
+ NoCounterError;
{$ENDIF MSWINDOWS}
{$IFDEF LINUX}
GetTimeOfDay(FTimeval, nil);
Modified: trunk/jcl/source/common/JclDateTime.pas
===================================================================
--- trunk/jcl/source/common/JclDateTime.pas 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/source/common/JclDateTime.pas 2007-11-14 23:12:10 UTC (rev 2222)
@@ -62,6 +62,7 @@
{$ENDIF UNITVERSIONING}
{$IFDEF CLR}
System.Globalization, System.Runtime.InteropServices,
+ System.Runtime.InteropServices.ComTypes,
{$ELSE}
{$IFDEF MSWINDOWS}
Windows,
@@ -87,7 +88,7 @@
{$IFDEF CLR}
type
- TFileTime = System.Runtime.InteropServices.FILETIME;
+ TFileTime = System.Runtime.InteropServices.ComTypes.FILETIME;
{$ENDIF CLR}
{ Encode / Decode functions }
Modified: trunk/jcl/source/common/JclEDISEF.pas
===================================================================
--- trunk/jcl/source/common/JclEDISEF.pas 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/source/common/JclEDISEF.pas 2007-11-14 23:12:10 UTC (rev 2222)
@@ -58,7 +58,7 @@
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
{$ENDIF ~EDI_WEAK_PACKAGE_UNITS}
- JclEDI;
+ JclBase, JclEDI;
const
SectionTag_VER = '.VER';
@@ -168,17 +168,14 @@
procedure SetData(const Data: string);
procedure SetParent(const Value: TEDISEFDataObject); virtual;
property OwnerItemRef: TEDISEFDataObjectListItem read FOwnerItemRef write FOwnerItemRef;
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; virtual; abstract;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
function Assemble: string; virtual; abstract;
procedure Disassemble; virtual; abstract;
procedure UpdateOwnerItemName;
- {$IFDEF COMPILER6_UP} // Hide warnings in D5
- function Clone(NewParent: TEDISEFDataObject): TEDISEFDataObject; virtual; abstract;
- {$ELSE}
- function Clone(NewParent: TEDISEFDataObject): TEDISEFDataObject; virtual;
- {$ENDIF COMPILER6_UP}
+ function Clone(NewParent: TEDISEFDataObject): TEDISEFDataObject;
published
property State: TEDIDataObjectDataState read FState;
property Id: string read FId write SetId;
@@ -256,6 +253,7 @@
FRepeatCount: Integer;
protected
procedure SetParent(const Value: TEDISEFDataObject); override;
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -343,6 +341,7 @@
FRequirementDesignator: string;
FRepeatCount: Integer;
FEDISEFTextSets: TEDISEFTextSets;
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -369,6 +368,8 @@
end;
TEDISEFSubElement = class(TEDISEFElement)
+ protected
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -386,6 +387,8 @@
FRepeatCount: Integer;
FExtendedData: string;
FEDISEFTextSets: TEDISEFTextSets;
+ protected
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -452,6 +455,8 @@
FExtendedData: string;
function GetOwnerLoopId: string;
function GetParentLoopId: string;
+ protected
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -524,6 +529,8 @@
function GetParentLoopId: string;
function GetParentSet: TEDISEFSet;
function GetParentTable: TEDISEFTable;
+ protected
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -559,6 +566,8 @@
TEDISEFTable = class(TEDISEFDataObjectGroup)
private
function GetSEFSet: TEDISEFSet;
+ protected
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -592,6 +601,8 @@
FEDISEFTextSets: TEDISEFTextSets;
function GetEDISEFTable(Index: Integer): TEDISEFTable;
procedure BuildSegmentObjectListFromLoop(ObjectList: TObjectList; Loop: TEDISEFLoop);
+ protected
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -650,6 +661,8 @@
function GetEDISEFCodesList: TStrings;
function GetEDISEFStd: TStrings;
function GetEDISEFIni: TStrings;
+ protected
+ function CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject; override;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
@@ -2435,12 +2448,10 @@
inherited Destroy;
end;
-{$IFNDEF COMPILER6_UP}
function TEDISEFDataObject.Clone(NewParent: TEDISEFDataObject): TEDISEFDataObject;
begin
- Result := nil;
+ Result := CloneDataObject(NewParent);
end;
-{$ENDIF ~COMPILER6_UP}
function TEDISEFDataObject.GetData: string;
begin
@@ -2658,6 +2669,11 @@
FRepeatCount := EDISEFElement.RepeatCount;
end;
+function TEDISEFElement.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFElement.Clone(NewParent: TEDISEFDataObject): TEDISEFElement;
begin
Result := TEDISEFElement.Create(NewParent);
@@ -2753,6 +2769,11 @@
Result := inherited Assemble;
end;
+function TEDISEFSubElement.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFSubElement.Clone(NewParent: TEDISEFDataObject): TEDISEFSubElement;
begin
Result := TEDISEFSubElement.Create(NewParent);
@@ -2839,6 +2860,11 @@
end;
end;
+function TEDISEFCompositeElement.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFCompositeElement.Clone(NewParent: TEDISEFDataObject): TEDISEFCompositeElement;
var
ListItem: TEDISEFDataObjectListItem;
@@ -3100,6 +3126,11 @@
end;
end;
+function TEDISEFSegment.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFSegment.Clone(NewParent: TEDISEFDataObject): TEDISEFSegment;
var
ListItem: TEDISEFDataObjectListItem;
@@ -3423,6 +3454,11 @@
Result := FId + SEFDelimiter_Colon + IntToStr(FMaximumRepeat) + Result;
end;
+function TEDISEFLoop.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFLoop.Clone(NewParent: TEDISEFDataObject): TEDISEFLoop;
begin
Result := nil;
@@ -3589,6 +3625,11 @@
end;
end;
+function TEDISEFTable.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFTable.Clone(NewParent: TEDISEFDataObject): TEDISEFTable;
begin
Result := nil;
@@ -3689,6 +3730,11 @@
end;
end;
+function TEDISEFSet.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFSet.Clone(NewParent: TEDISEFDataObject): TEDISEFSet;
begin
Result := nil;
@@ -3973,6 +4019,11 @@
FData := Result;
end;
+function TEDISEFFile.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFFile.Clone(NewParent: TEDISEFDataObject): TEDISEFFile;
begin
Result := nil;
@@ -4017,14 +4068,22 @@
begin
EDIFileStream := TFileStream.Create(FFileName, fmOpenRead or fmShareDenyNone);
try
+ {$IFDEF CLR}
+ EDIFileStream.ReadStringAnsiBuffer(FData, EDIFileStream.Size);
+ {$ELSE}
SetLength(FData, EDIFileStream.Size);
EDIFileStream.Read(Pointer(FData)^, EDIFileStream.Size);
+ {$ENDIF CLR}
finally
EDIFileStream.Free;
end;
end
else
+ {$IFDEF CLR}
+ raise EJclEDIError.Create(RsEDIError001);
+ {$ELSE}
raise EJclEDIError.CreateRes(@RsEDIError001);
+ {$ENDIF CLR}
end;
procedure TEDISEFFile.ParseTextSets;
@@ -4299,13 +4358,21 @@
begin
EDIFileStream := TFileStream.Create(FFileName, fmCreate or fmShareDenyNone);
try
+ {$IFDEF CLR}
+ EDIFileStream.WriteStringAnsiBuffer(FData);
+ {$ELSE}
EDIFileStream.Write(Pointer(FData)^, Length(FData));
+ {$ENDIF CLR}
finally
EDIFileStream.Free;
end;
end
else
+ {$IFDEF CLR}
+ raise EJclEDIError.Create(RsEDIError002);
+ {$ELSE}
raise EJclEDIError.CreateRes(@RsEDIError002);
+ {$ENDIF CLR}
end;
procedure TEDISEFTable.Disassemble;
@@ -4376,6 +4443,11 @@
end;
end;
+function TEDISEFRepeatingPattern.CloneDataObject(NewParent: TEDISEFDataObject): TEDISEFDataObject;
+begin
+ Result := Clone(NewParent);
+end;
+
function TEDISEFRepeatingPattern.Clone(NewParent: TEDISEFDataObject): TEDISEFRepeatingPattern;
var
ListItem: TEDISEFDataObjectListItem;
Modified: trunk/jcl/source/common/JclEDIXML.pas
===================================================================
--- trunk/jcl/source/common/JclEDIXML.pas 2007-11-14 22:52:18 UTC (rev 2221)
+++ trunk/jcl/source/common/JclEDIXML.pas 2007-11-14 23:12:10 UTC (rev 2222)
@@ -62,7 +62,7 @@
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
{$ENDIF ~EDI_WEAK_PACKAGE_UNITS}
- JclEDI, JclEDI_ANSIX12;
+ JclBase, JclEDI, JclEDI_ANSIX12;
const
XMLTag_Element = 'Element';
@@ -175,9 +175,9 @@
FDelimiters: TEDIXMLDelimiters;
FAttributes: TEDIXMLAttributes;
FErrorLog: TStrings;
- FSpecPointer: Pointer;
- FCustomData1: Pointer;
- FCustomData2: Pointer;
+ FSpecPointer: TEDIObject;
+ FCustomData1: TCustomData;
+ FCustomData2: TCustomData;
function GetData: string;
procedure SetData(const Data: string);
function Assemble: string; virtual; abstract;
@@ -185,9 +185,9 @@
public
constructor Create(Parent: TEDIXMLDataObject); reintroduce;
destructor Destroy; override;
- property SpecPointer: Pointer read FSpecPointer write FSpecPointer;
- property CustomData1: Pointer read FCustomData1 write FCustomData1;
- property CustomData2: Pointer read FCustomData2 write FCustomData2;
+ property SpecPointer: TEDIObject read FSpecPointer write FSpecPointer;
+ property CustomData1: TCustomData read FCustomData1 write FCustomData1;
+ property CustomData2: TCustomData read FCustomData2 write FCustomData2;
published
property State: TEDIDataObjectDataState read FState;
property Data: string read GetData write SetData;
@@ -721,7 +721,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError047);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError047);
end;
OriginalData := FData;
@@ -760,7 +760,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError046);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError046);
end;
// Set next start positon
StartPos := 1;
@@ -773,7 +773,7 @@
FAttributes.ParseAttributes(XMLStartTag);
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError048);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError048);
// Set data start positon
StartPos := SearchResult + FDelimiters.ETDLength;
// Check for CData tag
@@ -797,10 +797,10 @@
FData := Copy(FData, StartPos, (EndPos - StartPos));
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError050);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError050);
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError049);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError049);
// Handle Entity Reference Characters
StrReplace(FData, EDIXML_HTMLLessThanSign, EDIXML_LessThanSign, [rfReplaceAll]);
StrReplace(FData, EDIXML_HTMLGreaterThanSign, EDIXML_GreaterThanSign, [rfReplaceAll]);
@@ -920,7 +920,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError042);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError042);
end;
AttributeString := FAttributes.CombineAttributes;
@@ -970,7 +970,7 @@
SetLength(FElements, High(FElements));
end
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError058, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError058, [IntToStr(Index)]);
end;
procedure TEDIXMLSegment.DeleteElements;
@@ -1003,7 +1003,7 @@
SetLength(FElements, Length(FElements) - Count);
end
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError058, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError058, [IntToStr(Index)]);
end;
procedure TEDIXMLSegment.Disassemble;
@@ -1017,7 +1017,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError041);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError041);
end;
// Set next start positon
StartPos := 1;
@@ -1031,7 +1031,7 @@
FAttributes.ParseAttributes(XMLStartTag);
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError043);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError043);
// Set next start positon
StartPos := SearchResult + FDelimiters.ETDLength;
// Search for element
@@ -1051,10 +1051,10 @@
FElements[I].Disassemble;
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError050);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError050);
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError049);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError049);
// Set next start positon
StartPos := SearchResult + FDelimiters.ETDLength;
// Search for element
@@ -1072,15 +1072,15 @@
if Index <= High(FElements) then
begin
if not Assigned(FElements[Index]) then
- raise EJclEDIError.CreateResFmt(@EDIXMLError057, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError057, [IntToStr(Index)]);
Result := FElements[Index];
end
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError056, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError056, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError055, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError055, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError054, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError054, [IntToStr(Index)]);
end;
function TEDIXMLSegment.GetIndexPositionFromParent: Integer;
@@ -1249,11 +1249,11 @@
FElements[Index] := Element;
end
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError053, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError053, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError052, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError052, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError051, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError051, [IntToStr(Index)]);
end;
//=== { TEDIXMLTransactionSetSegment } =======================================
@@ -1398,7 +1398,7 @@
SetLength(FEDIDataObjects, High(FEDIDataObjects));
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError040);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError040);
end;
procedure TEDIXMLDataObjectGroup.DeleteEDIDataObjects;
@@ -1418,15 +1418,15 @@
if Index <= High(FEDIDataObjects) then
begin
if not Assigned(FEDIDataObjects[Index]) then
- raise EJclEDIError.CreateResFmt(@EDIXMLError039, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError039, [IntToStr(Index)]);
Result := FEDIDataObjects[Index];
end
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError038, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError038, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError037, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError037, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError036, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError036, [IntToStr(Index)]);
end;
function TEDIXMLDataObjectGroup.InsertEDIDataObject(InsertIndex: Integer;
@@ -1509,11 +1509,11 @@
FEDIDataObjects[Index] := EDIDataObject;
end
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError035, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError035, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError034, [IntToStr(Index)])
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError034, [IntToStr(Index)])
else
- raise EJclEDIError.CreateResFmt(@EDIXMLError033, [IntToStr(Index)]);
+ raise EJclEDIError.CreateResFmt({$IFNDEF CLR}@{$ENDIF}EDIXMLError033, [IntToStr(Index)]);
end;
//=== { TEDIXMLTransactionSetLoop } ==========================================
@@ -1549,7 +1549,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError030);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError030);
end;
AttributeString := FAttributes.CombineAttributes;
@@ -1584,7 +1584,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError029);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError029);
end;
// Set next start positon
StartPos := 1;
@@ -1598,7 +1598,7 @@
FAttributes.ParseAttributes(XMLStartTag);
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError031);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError031);
// Set next start positon
StartPos := SearchResult + FDelimiters.ETDLength;
// Determine the nearest tag to search for
@@ -1631,10 +1631,10 @@
EDIDataObjects[I].Disassemble;
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError045);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError045);
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError044);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError044);
end
else
begin
@@ -1669,10 +1669,10 @@
EDIDataObjects[I].Disassemble;
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError032);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError032);
end
else
- raise EJclEDIError.CreateRes(@EDIXMLError031);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError031);
end;
// Set next start positon
StartPos := SearchResult + FDelimiters.ETDLength;
@@ -1730,7 +1730,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError026);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLError026);
end;
AttributeString := FAttributes.CombineAttributes;
@@ -1765,7 +1765,7 @@
begin
FDelimiters := InternalAssignDelimiters;
if not Assigned(FDelimiters) then
- raise EJclEDIError.CreateRes(@EDIXMLError025);
+ raise EJclEDIError.CreateRes({$IFNDEF CLR}@{$ENDIF}EDIXMLE...
[truncated message content] |
|
From: <ah...@us...> - 2007-11-14 22:52:20
|
Revision: 2221
http://jcl.svn.sourceforge.net/jcl/?rev=2221&view=rev
Author: ahuser
Date: 2007-11-14 14:52:18 -0800 (Wed, 14 Nov 2007)
Log Message:
-----------
Removed CLRx,CLRx_UP because the version can be changed by a compiler switch
Modified Paths:
--------------
trunk/jcl/source/jedi.inc
Modified: trunk/jcl/source/jedi.inc
===================================================================
--- trunk/jcl/source/jedi.inc 2007-11-14 22:36:46 UTC (rev 2220)
+++ trunk/jcl/source/jedi.inc 2007-11-14 22:52:18 UTC (rev 2221)
@@ -293,17 +293,6 @@
RTL185_UP Defined when compiling with Delphi for Win32 2007 or later
-- CLR Versions
-
- Directive Description
- ------------------------------------------------------------------------------
- CLR Defined when compiling for .NET
- CLR1 Defined when compiling for .NET 1.0 and 1.1
- CLR1_UP Defined when compiling for .NET 1.0 or later
- CLR2 Defined when compiling for .NET 2.0
- CLR2_UP Defined when compiling for .NET 2.0 or later
-
-
- Feature Directives
The features directives are used to test if the compiler supports specific
@@ -914,8 +903,6 @@
{$DEFINE SUPPORTS_NESTED_CONSTANTS}
{$DEFINE SUPPORTS_NESTED_TYPES}
{$IFDEF CLR}
- {$DEFINE CLR1}
- {$DEFINE CLR1_UP}
{$DEFINE SUPPORTS_ENHANCED_RECORDS}
{$DEFINE SUPPORTS_CLASS_FIELDS}
{$DEFINE SUPPORTS_CLASS_HELPERS}
@@ -927,10 +914,6 @@
{$ENDIF COMPILER9_UP}
{$IFDEF COMPILER10_UP}
- {$IFDEF CLR}
- {$DEFINE CLR1}
- {$DEFINE CLR1_UP}
- {$ENDIF CLR}
{$DEFINE SUPPORTS_ENHANCED_RECORDS}
{$DEFINE SUPPORTS_CLASS_FIELDS}
{$DEFINE SUPPORTS_CLASS_HELPERS}
@@ -942,9 +925,6 @@
{$IFDEF COMPILER11_UP}
{$IFDEF CLR}
- {$DEFINE CLR1_UP}
- {$DEFINE CLR2}
- {$DEFINE CLR2_UP}
{$DEFINE SUPPORTS_GENERICS}
{$ENDIF CLR}
{$ENDIF COMPILER11_UP}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ah...@us...> - 2007-11-14 22:36:47
|
Revision: 2220
http://jcl.svn.sourceforge.net/jcl/?rev=2220&view=rev
Author: ahuser
Date: 2007-11-14 14:36:46 -0800 (Wed, 14 Nov 2007)
Log Message:
-----------
Added CLRx, CLRx_UP
Added Delphi.NET 2007
Modified Paths:
--------------
trunk/jcl/source/jedi.inc
Modified: trunk/jcl/source/jedi.inc
===================================================================
--- trunk/jcl/source/jedi.inc 2007-11-14 22:29:53 UTC (rev 2219)
+++ trunk/jcl/source/jedi.inc 2007-11-14 22:36:46 UTC (rev 2220)
@@ -76,6 +76,7 @@
MSWINDOWS Defined when target platform is 32 bit Windows
LINUX Defined when target platform is Linux
UNIX Defined when target platform is Linux or Unix
+ CLR Defined when target platform is .NET
- Visual library Directives
@@ -292,6 +293,17 @@
RTL185_UP Defined when compiling with Delphi for Win32 2007 or later
+- CLR Versions
+
+ Directive Description
+ ------------------------------------------------------------------------------
+ CLR Defined when compiling for .NET
+ CLR1 Defined when compiling for .NET 1.0 and 1.1
+ CLR1_UP Defined when compiling for .NET 1.0 or later
+ CLR2 Defined when compiling for .NET 2.0
+ CLR2_UP Defined when compiling for .NET 2.0 or later
+
+
- Feature Directives
The features directives are used to test if the compiler supports specific
@@ -549,9 +561,20 @@
{$UNDEF UNKNOWN_COMPILER_VERSION}
{$ENDIF}
- {$IFDEF UNKNOWN_COMPILER_VERSION} // adjust for newer version
+ {$IFDEF VER190} // Delphi.NET 2007
+ {$DEFINE BDS}
{$DEFINE BDS5}
+ {$DEFINE COMPILER11}
+ {$DEFINE DELPHI11}
+ {$DEFINE DELPHI2007} // synonym to DELPHI10
+ {$DEFINE DELPHICOMPILER11}
+ {$DEFINE RTL190_UP}
+ {$UNDEF UNKNOWN_COMPILER_VERSION}
+ {$ENDIF VER190}
+
+ {$IFDEF UNKNOWN_COMPILER_VERSION} // adjust for newer version (always use latest version)
{$DEFINE BDS}
+ {$DEFINE BDS5}
{$DEFINE COMPILER11}
{$DEFINE DELPHI11}
{$DEFINE DELPHI2007} // synonym to DELPHI11
@@ -724,6 +747,7 @@
{ RTLX_UP from RTLX_UP mappings }
{------------------------------------------------------------------------------}
+{$IFDEF RTL190_UP} {$DEFINE RTL185_UP} {$ENDIF}
{$IFDEF RTL185_UP} {$DEFINE RTL180_UP} {$ENDIF}
{$IFDEF RTL180_UP} {$DEFINE RTL170_UP} {$ENDIF}
{$IFDEF RTL170_UP} {$DEFINE RTL160_UP} {$ENDIF}
@@ -890,6 +914,8 @@
{$DEFINE SUPPORTS_NESTED_CONSTANTS}
{$DEFINE SUPPORTS_NESTED_TYPES}
{$IFDEF CLR}
+ {$DEFINE CLR1}
+ {$DEFINE CLR1_UP}
{$DEFINE SUPPORTS_ENHANCED_RECORDS}
{$DEFINE SUPPORTS_CLASS_FIELDS}
{$DEFINE SUPPORTS_CLASS_HELPERS}
@@ -901,6 +927,10 @@
{$ENDIF COMPILER9_UP}
{$IFDEF COMPILER10_UP}
+ {$IFDEF CLR}
+ {$DEFINE CLR1}
+ {$DEFINE CLR1_UP}
+ {$ENDIF CLR}
{$DEFINE SUPPORTS_ENHANCED_RECORDS}
{$DEFINE SUPPORTS_CLASS_FIELDS}
{$DEFINE SUPPORTS_CLASS_HELPERS}
@@ -912,6 +942,9 @@
{$IFDEF COMPILER11_UP}
{$IFDEF CLR}
+ {$DEFINE CLR1_UP}
+ {$DEFINE CLR2}
+ {$DEFINE CLR2_UP}
{$DEFINE SUPPORTS_GENERICS}
{$ENDIF CLR}
{$ENDIF COMPILER11_UP}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-14 22:30:00
|
Revision: 2219
http://jcl.svn.sourceforge.net/jcl/?rev=2219&view=rev
Author: outchy
Date: 2007-11-14 14:29:53 -0800 (Wed, 14 Nov 2007)
Log Message:
-----------
Introducing containers for common types (Single, Double, Extended, Integer, Cardinal, Int64 and Pointer)
Single, Double and Extended containers are aliased to Float containers according to global math precision preference.
Modified Paths:
--------------
trunk/jcl/source/common/JclAbstractContainers.pas
trunk/jcl/source/common/JclAlgorithms.pas
trunk/jcl/source/common/JclArrayLists.pas
trunk/jcl/source/common/JclArraySets.pas
trunk/jcl/source/common/JclBase.pas
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/common/JclHashMaps.pas
trunk/jcl/source/common/JclHashSets.pas
trunk/jcl/source/common/JclLinkedLists.pas
trunk/jcl/source/common/JclQueues.pas
trunk/jcl/source/common/JclSortedMaps.pas
trunk/jcl/source/common/JclStacks.pas
trunk/jcl/source/common/JclVectors.pas
trunk/jcl/source/prototypes/JclArrayLists.pas
trunk/jcl/source/prototypes/JclArraySets.pas
trunk/jcl/source/prototypes/JclBinaryTrees.pas
trunk/jcl/source/prototypes/JclHashMaps.pas
trunk/jcl/source/prototypes/JclHashSets.pas
trunk/jcl/source/prototypes/JclLinkedLists.pas
trunk/jcl/source/prototypes/JclQueues.pas
trunk/jcl/source/prototypes/JclSortedMaps.pas
trunk/jcl/source/prototypes/JclStacks.pas
trunk/jcl/source/prototypes/JclVectors.pas
Modified: trunk/jcl/source/common/JclAbstractContainers.pas
===================================================================
--- trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-14 00:30:09 UTC (rev 2218)
+++ trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-14 22:29:53 UTC (rev 2219)
@@ -226,6 +226,133 @@
function Hash(const AString: WideString): Integer;
end;
+ TJclSingleAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclSingleContainer, IJclSingleEqualityComparer,
+ IJclSingleComparer, IJclSingleHashConverter)
+ protected
+ FPrecision: Single;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
+ function FreeSingle(var AValue: Single): Single;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclSingleEqualityComparer }
+ function ItemsEqual(const A, B: Single): Boolean;
+ { IJclSingleComparer }
+ function ItemsCompare(const A, B: Single): Integer;
+ { IJclSingleContainer }
+ function GetPrecision: Single; virtual;
+ procedure SetPrecision(const Value: Single); virtual;
+ { IJclSingleHashConverter }
+ function Hash(const AValue: Single): Integer;
+ public
+ property Precision: Single read GetPrecision write SetPrecision;
+ end;
+
+ TJclDoubleAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclDoubleContainer, IJclDoubleEqualityComparer,
+ IJclDoubleComparer, IJclDoubleHashConverter)
+ protected
+ FPrecision: Double;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
+ function FreeDouble(var AValue: Double): Double;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclDoubleEqualityComparer }
+ function ItemsEqual(const A, B: Double): Boolean;
+ { IJclDoubleComparer }
+ function ItemsCompare(const A, B: Double): Integer;
+ { IJclDoubleContainer }
+ function GetPrecision: Double; virtual;
+ procedure SetPrecision(const Value: Double); virtual;
+ { IJclDoubleHashConverter }
+ function Hash(const AValue: Double): Integer;
+ public
+ property Precision: Double read GetPrecision write SetPrecision;
+ end;
+
+ TJclExtendedAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclExtendedContainer, IJclExtendedEqualityComparer,
+ IJclExtendedComparer, IJclExtendedHashConverter)
+ protected
+ FPrecision: Extended;
+ procedure AssignPropertiesTo(Dest: TJclAbstractContainerBase); override;
+ function FreeExtended(var AValue: Extended): Extended;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclExtendedEqualityComparer }
+ function ItemsEqual(const A, B: Extended): Boolean;
+ { IJclExtendedComparer }
+ function ItemsCompare(const A, B: Extended): Integer;
+ { IJclExtendedContainer }
+ function GetPrecision: Extended; virtual;
+ procedure SetPrecision(const Value: Extended); virtual;
+ { IJclExtendedHashConverter }
+ function Hash(const AValue: Extended): Integer;
+ public
+ property Precision: Extended read GetPrecision write SetPrecision;
+ end;
+
+ TJclIntegerAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclIntegerEqualityComparer, IJclIntegerComparer,
+ IJclIntegerHashConverter)
+ protected
+ function FreeInteger(var AValue: Integer): Integer;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclIntegerEqualityComparer }
+ function ItemsEqual(A, B: Integer): Boolean;
+ { IJclIntegerComparer }
+ function ItemsCompare(A, B: Integer): Integer;
+ { IJclIntegerHashConverter }
+ function Hash(AValue: Integer): Integer;
+ end;
+
+ TJclCardinalAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclCardinalEqualityComparer, IJclCardinalComparer,
+ IJclCardinalHashConverter)
+ protected
+ function FreeCardinal(var AValue: Cardinal): Cardinal;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclIntegerEqualityComparer }
+ function ItemsEqual(A, B: Cardinal): Boolean;
+ { IJclIntegerComparer }
+ function ItemsCompare(A, B: Cardinal): Integer;
+ { IJclIntegerHashConverter }
+ function Hash(AValue: Cardinal): Integer;
+ end;
+
+ TJclInt64AbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclInt64EqualityComparer, IJclInt64Comparer,
+ IJclInt64HashConverter)
+ protected
+ function FreeInt64(var AValue: Int64): Int64;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclInt64EqualityComparer }
+ function ItemsEqual(const A, B: Int64): Boolean;
+ { IJclInt64Comparer }
+ function ItemsCompare(const A, B: Int64): Integer;
+ { IJclInt64HashConverter }
+ function Hash(const AValue: Int64): Integer;
+ end;
+
+ {$IFNDEF CLR}
+ TJclPtrAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclCloneable, IJclIntfCloneable, IJclContainer, IJclPtrEqualityComparer, IJclPtrComparer, IJclPtrHashConverter)
+ protected
+ function FreePointer(var APtr: Pointer): Pointer;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclPtrEqualityComparer }
+ function ItemsEqual(A, B: Pointer): Boolean;
+ { IJclPtrComparer }
+ function ItemsCompare(A, B: Pointer): Integer;
+ { IJclPtrHashConverter }
+ function Hash(AValue: Pointer): Integer;
+ end;
+ {$ENDIF ~CLR}
+
TJclAbstractContainer = class(TJclAbstractContainerBase, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
IJclCloneable, IJclIntfCloneable, IJclContainer, IJclObjectOwner, IJclEqualityComparer, IJclComparer)
private
@@ -935,6 +1062,269 @@
FEncoding := Value;
end;
+//=== { TJclSingleAbstractContainer } ========================================
+
+procedure TJclSingleAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclSingleAbstractContainer then
+ TJclSingleAbstractContainer(Dest).Precision := Precision;
+end;
+
+function TJclSingleAbstractContainer.FreeSingle(var AValue: Single): Single;
+begin
+ Result := AValue;
+ AValue := 0.0;
+end;
+
+function TJclSingleAbstractContainer.GetPrecision: Single;
+begin
+ Result := FPrecision;
+end;
+
+function TJclSingleAbstractContainer.Hash(const AValue: Single): Integer;
+const
+ A = 0.6180339887; // (sqrt(5) - 1) / 2
+begin
+ Result := Round(MaxInt * Frac(AValue * A));
+end;
+
+function TJclSingleAbstractContainer.ItemsCompare(const A, B: Single): Integer;
+begin
+ if Abs(A - B) <= FPrecision then
+ Result := 0
+ else
+ if A > B then
+ Result := 1
+ else
+ Result := -1;
+end;
+
+function TJclSingleAbstractContainer.ItemsEqual(const A, B: Single): Boolean;
+begin
+ Result := Abs(A - B) <= FPrecision;
+end;
+
+procedure TJclSingleAbstractContainer.SetPrecision(const Value: Single);
+begin
+ FPrecision := Value;
+end;
+
+//=== { TJclDoubleAbstractContainer } ========================================
+
+procedure TJclDoubleAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclDoubleAbstractContainer then
+ TJclDoubleAbstractContainer(Dest).Precision := Precision;
+end;
+
+function TJclDoubleAbstractContainer.FreeDouble(var AValue: Double): Double;
+begin
+ Result := AValue;
+ AValue := 0.0;
+end;
+
+function TJclDoubleAbstractContainer.GetPrecision: Double;
+begin
+ Result := FPrecision;
+end;
+
+function TJclDoubleAbstractContainer.Hash(const AValue: Double): Integer;
+const
+ A = 0.6180339887; // (sqrt(5) - 1) / 2
+begin
+ Result := Round(MaxInt * Frac(AValue * A));
+end;
+
+function TJclDoubleAbstractContainer.ItemsCompare(const A, B: Double): Integer;
+begin
+ if Abs(A - B) <= FPrecision then
+ Result := 0
+ else
+ if A > B then
+ Result := 1
+ else
+ Result := -1;
+end;
+
+function TJclDoubleAbstractContainer.ItemsEqual(const A, B: Double): Boolean;
+begin
+ Result := Abs(A - B) <= FPrecision;
+end;
+
+procedure TJclDoubleAbstractContainer.SetPrecision(const Value: Double);
+begin
+ FPrecision := Value;
+end;
+
+//=== { TJclExtendedAbstractContainer } ======================================
+
+procedure TJclExtendedAbstractContainer.AssignPropertiesTo(Dest: TJclAbstractContainerBase);
+begin
+ inherited AssignPropertiesTo(Dest);
+ if Dest is TJclExtendedAbstractContainer then
+ TJclExtendedAbstractContainer(Dest).Precision := Precision;
+end;
+
+function TJclExtendedAbstractContainer.FreeExtended(var AValue: Extended): Extended;
+begin
+ Result := AValue;
+ AValue := 0.0;
+end;
+
+function TJclExtendedAbstractContainer.GetPrecision: Extended;
+begin
+ Result := FPrecision;
+end;
+
+function TJclExtendedAbstractContainer.Hash(const AValue: Extended): Integer;
+const
+ A = 0.6180339887; // (sqrt(5) - 1) / 2
+begin
+ Result := Round(MaxInt * Frac(AValue * A));
+end;
+
+function TJclExtendedAbstractContainer.ItemsCompare(const A, B: Extended): Integer;
+begin
+ if Abs(A - B) <= FPrecision then
+ Result := 0
+ else
+ if A > B then
+ Result := 1
+ else
+ Result := -1;
+end;
+
+function TJclExtendedAbstractContainer.ItemsEqual(const A, B: Extended): Boolean;
+begin
+ Result := Abs(A - B) <= FPrecision;
+end;
+
+procedure TJclExtendedAbstractContainer.SetPrecision(const Value: Extended);
+begin
+ FPrecision := Value;
+end;
+
+//=== { TJclIntegerAbstractContainer } =======================================
+
+function TJclIntegerAbstractContainer.FreeInteger(var AValue: Integer): Integer;
+begin
+ Result := AValue;
+ AValue := 0;
+end;
+
+function TJclIntegerAbstractContainer.Hash(AValue: Integer): Integer;
+begin
+ Result := AValue;
+end;
+
+function TJclIntegerAbstractContainer.ItemsCompare(A, B: Integer): Integer;
+begin
+ if A > B then
+ Result := 1
+ else
+ if A < B then
+ Result := -1
+ else
+ Result := 0;
+end;
+
+function TJclIntegerAbstractContainer.ItemsEqual(A, B: Integer): Boolean;
+begin
+ Result := A = B;
+end;
+
+//=== { TJclCardinalAbstractContainer } ======================================
+
+function TJclCardinalAbstractContainer.FreeCardinal(var AValue: Cardinal): Cardinal;
+begin
+ Result := AValue;
+ AValue := 0;
+end;
+
+function TJclCardinalAbstractContainer.Hash(AValue: Cardinal): Integer;
+begin
+ Result := AValue and MaxInt;
+end;
+
+function TJclCardinalAbstractContainer.ItemsCompare(A, B: Cardinal): Integer;
+begin
+ if A > B then
+ Result := 1
+ else
+ if A < B then
+ Result := -1
+ else
+ Result := 0;
+end;
+
+function TJclCardinalAbstractContainer.ItemsEqual(A, B: Cardinal): Boolean;
+begin
+ Result := A = B;
+end;
+
+//=== { TJclInt64AbstractContainer } =========================================
+
+function TJclInt64AbstractContainer.FreeInt64(var AValue: Int64): Int64;
+begin
+ Result := AValue;
+ AValue := 0;
+end;
+
+function TJclInt64AbstractContainer.Hash(const AValue: Int64): Integer;
+begin
+ Result := AValue and MaxInt;
+end;
+
+function TJclInt64AbstractContainer.ItemsCompare(const A, B: Int64): Integer;
+begin
+ if A > B then
+ Result := 1
+ else
+ if A < B then
+ Result := -1
+ else
+ Result := 0;
+end;
+
+function TJclInt64AbstractContainer.ItemsEqual(const A, B: Int64): Boolean;
+begin
+ Result := A = B;
+end;
+
+{$IFNDEF CLR}
+
+//=== { TJclPtrAbstractContainer } ===========================================
+
+function TJclPtrAbstractContainer.FreePointer(var APtr: Pointer): Pointer;
+begin
+ Result := APtr;
+ APtr := nil;
+end;
+
+function TJclPtrAbstractContainer.Hash(AValue: Pointer): Integer;
+begin
+ Result := Integer(AValue) and MaxInt;
+end;
+
+function TJclPtrAbstractContainer.ItemsCompare(A, B: Pointer): Integer;
+begin
+ if Integer(A) > Integer(B) then
+ Result := 1
+ else
+ if Integer(A) < Integer(B) then
+ Result := -1
+ else
+ Result := 0;
+end;
+
+function TJclPtrAbstractContainer.ItemsEqual(A, B: Pointer): Boolean;
+begin
+ Result := Integer(A) = Integer(B);
+end;
+{$ENDIF ~CLR}
+
//=== { TJclAbstractContainer } ==============================================
constructor TJclAbstractContainer.Create(const ALockDelegate: IInterface; AOwnsObjects: Boolean);
Modified: trunk/jcl/source/common/JclAlgorithms.pas
===================================================================
--- trunk/jcl/source/common/JclAlgorithms.pas 2007-11-14 00:30:09 UTC (rev 2218)
+++ trunk/jcl/source/common/JclAlgorithms.pas 2007-11-14 22:29:53 UTC (rev 2219)
@@ -55,6 +55,24 @@
{$IFDEF CONTAINER_WIDESTR}
TStrApplyFunction = TWideStrApplyFunction;
{$ENDIF CONTAINER_WIDESTR}
+ TSingleApplyFunction = function(const Value: Single): Single;
+ TDoubleApplyFunction = function(const Value: Double): Double;
+ TExtendedApplyFunction = function(const Value: Extended): Extended;
+ {$IFDEF MATH_SINGLE_PRECISION}
+ TFloatApplyFunction = TSingleApplyFunction;
+ {$ENDIF MATH_SINGLE_PRECISION}
+ {$IFDEF MATH_DOUBLE_PRECISION}
+ TFloatApplyFunction = TDoubleApplyFunction;
+ {$ENDIF MATH_DOUBLE_PRECISION}
+ {$IFDEF MATH_EXTENDED_PRECISION}
+ TFloatApplyFunction = TExtendedApplyFunction;
+ {$ENDIF MATH_EXTENDED_PRECISION}
+ TIntegerApplyFunction = function(AValue: Integer): Integer;
+ TCardinalApplyFunction = function(AValue: Cardinal): Cardinal;
+ TInt64ApplyFunction = function(const Value: Int64): Int64;
+ {$IFNDEF CLR}
+ TPtrApplyFunction = function(APtr: Pointer): Pointer;
+ {$ENDIF ~CLR}
TApplyFunction = function(AObject: TObject): TObject;
// Pointer functions for comparator
@@ -67,6 +85,24 @@
{$IFDEF CONTAINER_WIDESTR}
TStrCompare = TWideStrCompare;
{$ENDIF CONTAINER_WIDESTR}
+ TSingleCompare = function(const Obj1, Obj2: Single): Integer;
+ TDoubleCompare = function(const Obj1, Obj2: Double): Integer;
+ TExtendedCompare = function(const Obj1, Obj2: Extended): Integer;
+ {$IFDEF MATH_SINGLE_PRECISION}
+ TFloatCompare = TSingleCompare;
+ {$ENDIF MATH_SINGLE_PRECISION}
+ {$IFDEF MATH_DOUBLE_PRECISION}
+ TFloatCompare = TDoubleCompare;
+ {$ENDIF MATH_DOUBLE_PRECISION}
+ {$IFDEF MATH_EXTENDED_PRECISION}
+ TFloatCompare = TExtendedCompare;
+ {$ENDIF MATH_EXTENDED_PRECISION}
+ TIntegerCompare = function(Obj1, Obj2: Integer): Integer;
+ TCardinalCompare = function(Obj1, Obj2: Cardinal): Integer;
+ TInt64Compare = function(const Obj1, Obj2: Int64): Integer;
+ {$IFNDEF CLR}
+ TPtrCompare = function(Obj1, Obj2: Pointer): Integer;
+ {$ENDIF ~CLR}
TCompare = function(Obj1, Obj2: TObject): Integer;
// Compare functions
@@ -74,6 +110,16 @@
function AnsiStrSimpleCompare(const Obj1, Obj2: AnsiString): Integer;
function WideStrSimpleCompare(const Obj1, Obj2: WideString): Integer;
function StrSimpleCompare(const Obj1, Obj2: string): Integer;
+function SingleSimpleCompare(const Obj1, Obj2: Single): Integer;
+function DoubleSimpleCompare(const Obj1, Obj2: Double): Integer;
+function ExtendedSimpleCompare(const Obj1, Obj2: Extended): Integer;
+function FloatSimpleCompare(const Obj1, Obj2: Float): Integer;
+function IntegerSimpleCompare(Obj1, Obj2: Integer): Integer;
+function CardinalSimpleCompare(Obj1, Obj2: Cardinal): Integer;
+function Int64SimpleCompare(const Obj1, Obj2: Int64): Integer;
+{$IFNDEF CLR}
+function PtrSimpleCompare(Obj1, Obj2: Pointer): Integer;
+{$ENDIF ~CLR}
function SimpleCompare(Obj1, Obj2: TObject): Integer;
function IntegerCompare(Obj1, Obj2: TObject): Integer;
@@ -82,6 +128,15 @@
procedure Apply(const First: IJclIntfIterator; Count: Integer; F: TIntfApplyFunction); overload;
procedure Apply(const First: IJclAnsiStrIterator; Count: Integer; F: TAnsiStrApplyFunction); overload;
procedure Apply(const First: IJclWideStrIterator; Count: Integer; F: TWideStrApplyFunction); overload;
+procedure Apply(const First: IJclSingleIterator; Count: Integer; F: TSingleApplyFunction); overload;
+procedure Apply(const First: IJclDoubleIterator; Count: Integer; F: TDoubleApplyFunction); overload;
+procedure Apply(const First: IJclExtendedIterator; Count: Integer; F: TExtendedApplyFunction); overload;
+procedure Apply(const First: IJclIntegerIterator; Count: Integer; F: TIntegerApplyFunction); overload;
+procedure Apply(const First: IJclCardinalIterator; Count: Integer; F: TCardinalApplyFunction); overload;
+procedure Apply(const First: IJclInt64Iterator; Count: Integer; F: TInt64ApplyFunction); overload;
+{$IFNDEF CLR}
+procedure Apply(const First: IJclPtrIterator; Count: Integer; F: TPtrApplyFunction); overload;
+{$ENDIF ~CLR}
procedure Apply(const First: IJclIterator; Count: Integer; F: TApplyFunction); overload;
// Find algorithms
@@ -91,6 +146,22 @@
AComparator: TAnsiStrCompare): IJclAnsiStrIterator; overload;
function Find(const First: IJclWideStrIterator; Count: Integer; const AString: string;
AComparator: TWideStrCompare): IJclWideStrIterator; overload;
+function Find(const First: IJclSingleIterator; Count: Integer; const AValue: Single;
+ AComparator: TSingleCompare): IJclSingleIterator; overload;
+function Find(const First: IJclDoubleIterator; Count: Integer; const AValue: Double;
+ AComparator: TDoubleCompare): IJclDoubleIterator; overload;
+function Find(const First: IJclExtendedIterator; Count: Integer; const AValue: Extended;
+ AComparator: TExtendedCompare): IJclExtendedIterator; overload;
+function Find(const First: IJclIntegerIterator; Count: Integer; AValue: Integer;
+ AComparator: TIntegerCompare): IJclIntegerIterator; overload;
+function Find(const First: IJclCardinalIterator; Count: Integer; AValue: Cardinal;
+ AComparator: TCardinalCompare): IJclCardinalIterator; overload;
+function Find(const First: IJclInt64Iterator; Count: Integer; const AValue: Int64;
+ AComparator: TInt64Compare): IJclInt64Iterator; overload;
+{$IFNDEF CLR}
+function Find(const First: IJclPtrIterator; Count: Integer; APtr: Pointer;
+ AComparator: TPtrCompare): IJclPtrIterator; overload;
+{$ENDIF ~CLR}
function Find(const First: IJclIterator; Count: Integer; AObject: TObject;
AComparator: TCompare): IJclIterator; overload;
@@ -101,6 +172,22 @@
const AString: AnsiString; AComparator: TAnsiStrCompare): Integer; overload;
function CountObject(const First: IJclWideStrIterator; Count: Integer;
const AString: WideString; AComparator: TWideStrCompare): Integer; overload;
+function CountObject(const First: IJclSingleIterator; Count: Integer; const AValue: Single;
+ AComparator: TSingleCompare): Integer; overload;
+function CountObject(const First: IJclDoubleIterator; Count: Integer; const AValue: Double;
+ AComparator: TDoubleCompare): Integer; overload;
+function CountObject(const First: IJclExtendedIterator; Count: Integer; const AValue: Extended;
+ AComparator: TExtendedCompare): Integer; overload;
+function CountObject(const First: IJclIntegerIterator; Count: Integer; AValue: Integer;
+ AComparator: TIntegerCompare): Integer; overload;
+function CountObject(const First: IJclCardinalIterator; Count: Integer; AValue: Cardinal;
+ AComparator: TCardinalCompare): Integer; overload;
+function CountObject(const First: IJclInt64Iterator; Count: Integer; const AValue: Int64;
+ AComparator: TInt64Compare): Integer; overload;
+{$IFNDEF CLR}
+function CountObject(const First: IJclPtrIterator; Count: Integer; APtr: Pointer;
+ AComparator: TPtrCompare): Integer; overload;
+{$ENDIF ~CLR}
function CountObject(const First: IJclIterator; Count: Integer; AObject: TObject;
AComparator: TCompare): Integer; overload;
@@ -111,6 +198,22 @@
const Output: IJclAnsiStrIterator); overload;
procedure Copy(const First: IJclWideStrIterator; Count: Integer;
const Output: IJclWideStrIterator); overload;
+procedure Copy(const First: IJclSingleIterator; Count: Integer;
+ const Output: IJclSingleIterator); overload;
+procedure Copy(const First: IJclDoubleIterator; Count: Integer;
+ const Output: IJclDoubleIterator); overload;
+procedure Copy(const First: IJclExtendedIterator; Count: Integer;
+ const Output: IJclExtendedIterator); overload;
+procedure Copy(const First: IJclIntegerIterator; Count: Integer;
+ const Output: IJclIntegerIterator); overload;
+procedure Copy(const First: IJclCardinalIterator; Count: Integer;
+ const Output: IJclCardinalIterator); overload;
+procedure Copy(const First: IJclInt64Iterator; Count: Integer;
+ const Output: IJclInt64Iterator); overload;
+{$IFNDEF CLR}
+procedure Copy(const First: IJclPtrIterator; Count: Integer;
+ const Output: IJclPtrIterator); overload;
+{$ENDIF ~CLR}
procedure Copy(const First: IJclIterator; Count: Integer;
const Output: IJclIterator); overload;
@@ -118,18 +221,45 @@
procedure Generate(const List: IJclIntfList; Count: Integer; const AInterface: IInterface); overload;
procedure Generate(const List: IJclAnsiStrList; Count: Integer; const AString: AnsiString); overload;
procedure Generate(const List: IJclWideStrList; Count: Integer; const AString: WideString); overload;
+procedure Generate(const List: IJclSingleList; Count: Integer; const AValue: Single); overload;
+procedure Generate(const List: IJclDoubleList; Count: Integer; const AValue: Double); overload;
+procedure Generate(const List: IJclExtendedList; Count: Integer; const AValue: Extended); overload;
+procedure Generate(const List: IJclIntegerList; Count: Integer; AValue: Integer); overload;
+procedure Generate(const List: IJclCardinalList; Count: Integer; AValue: Cardinal); overload;
+procedure Generate(const List: IJclInt64List; Count: Integer; const AValue: Int64); overload;
+{$IFNDEF CLR}
+procedure Generate(const List: IJclPtrList; Count: Integer; APtr: Pointer); overload;
+{$ENDIF CLR}
procedure Generate(const List: IJclList; Count: Integer; AObject: TObject); overload;
// Fill algorithms
procedure Fill(const First: IJclIntfIterator; Count: Integer; const AInterface: IInterface); overload;
procedure Fill(const First: IJclAnsiStrIterator; Count: Integer; const AString: AnsiString); overload;
procedure Fill(const First: IJclWideStrIterator; Count: Integer; const AString: WideString); overload;
+procedure Fill(const First: IJclSingleIterator; Count: Integer; const AValue: Single); overload;
+procedure Fill(const First: IJclDoubleIterator; Count: Integer; const AValue: Double); overload;
+procedure Fill(const First: IJclExtendedIterator; Count: Integer; const AValue: Extended); overload;
+procedure Fill(const First: IJclIntegerIterator; Count: Integer; AValue: Integer); overload;
+procedure Fill(const First: IJclCardinalIterator; Count: Integer; AValue: Cardinal); overload;
+procedure Fill(const First: IJclInt64Iterator; Count: Integer; const AValue: Int64); overload;
+{$IFNDEF CLR}
+procedure Fill(const First: IJclPtrIterator; Count: Integer; APtr: Pointer); overload;
+{$ENDIF ~CLR}
procedure Fill(const First: IJclIterator; Count: Integer; AObject: TObject); overload;
// Reverse algorithms
procedure Reverse(const First, Last: IJclIntfIterator); overload;
procedure Reverse(const First, Last: IJclAnsiStrIterator); overload;
procedure Reverse(const First, Last: IJclWideStrIterator); overload;
+procedure Reverse(const First, Last: IJclSingleIterator); overload;
+procedure Reverse(const First, Last: IJclDoubleIterator); overload;
+procedure Reverse(const First, Last: IJclExtendedIterator); overload;
+procedure Reverse(const First, Last: IJclIntegerIterator); overload;
+procedure Reverse(const First, Last: IJclCardinalIterator); overload;
+procedure Reverse(const First, Last: IJclInt64Iterator); overload;
+{$IFNDEF CLR}
+procedure Reverse(const First, Last: IJclPtrIterator); overload;
+{$ENDIF CLR}
procedure Reverse(const First, Last: IJclIterator); overload;
type
@@ -143,23 +273,59 @@
{$IFDEF CONTAINER_WIDESTR}
TStrSortProc = TWideStrSortProc;
{$ENDIF CONTAINER_WIDESTR}
+ TSingleSortProc = procedure(const AList: IJclSingleList; L, R: Integer; AComparator: TSingleCompare);
+ TDoubleSortProc = procedure(const AList: IJclDoubleList; L, R: Integer; AComparator: TDoubleCompare);
+ TExtendedSortProc = procedure(const AList: IJclExtendedList; L, R: Integer; AComparator: TExtendedCompare);
+ TIntegerSortProc = procedure(const AList: IJclIntegerList; L, R: Integer; AComparator: TIntegerCompare);
+ TCardinalSortProc = procedure(const AList: IJclCardinalList; L, R: Integer; AComparator: TCardinalCompare);
+ TInt64SortProc = procedure(const AList: IJclInt64List; L, R: Integer; AComparator: TInt64Compare);
+ {$IFNDEF CLR}
+ TPtrSortProc = procedure(const AList: IJclPtrList; L, R: Integer; AComparator: TPtrCompare);
+ {$ENDIF ~CLR}
TSortProc = procedure(const AList: IJclList; L, R: Integer; AComparator: TCompare);
procedure QuickSort(const AList: IJclIntfList; L, R: Integer; AComparator: TIntfCompare); overload;
procedure QuickSort(const AList: IJclAnsiStrList; L, R: Integer; AComparator: TAnsiStrCompare); overload;
procedure QuickSort(const AList: IJclWideStrList; L, R: Integer; AComparator: TWideStrCompare); overload;
+procedure QuickSort(const AList: IJclSingleList; L, R: Integer; AComparator: TSingleCompare); overload;
+procedure QuickSort(const AList: IJclDoubleList; L, R: Integer; AComparator: TDoubleCompare); overload;
+procedure QuickSort(const AList: IJclExtendedList; L, R: Integer; AComparator: TExtendedCompare); overload;
+procedure QuickSort(const AList: IJclIntegerList; L, R: Integer; AComparator: TIntegerCompare); overload;
+procedure QuickSort(const AList: IJclCardinalList; L, R: Integer; AComparator: TCardinalCompare); overload;
+procedure QuickSort(const AList: IJclInt64List; L, R: Integer; AComparator: TInt64Compare); overload;
+{$IFNDEF CLR}
+procedure QuickSort(const AList: IJclPtrList; L, R: Integer; AComparator: TPtrCompare); overload;
+{$ENDIF ~CLR}
procedure QuickSort(const AList: IJclList; L, R: Integer; AComparator: TCompare); overload;
var
IntfSortProc: TIntfSortProc = QuickSort;
AnsiStrSortProc: TAnsiStrSortProc = QuickSort;
WideStrSortProc: TWideStrSortProc = QuickSort;
+ SingleSortProc: TSingleSortProc = QuickSort;
+ DoubleSortProc: TDoubleSortProc = QuickSort;
+ ExtendedSortProc: TExtendedSortProc = QuickSort;
+ IntegerSortProc: TIntegerSortProc = QuickSort;
+ CardinalSortProc: TCardinalSortProc = QuickSort;
+ Int64SortProc: TInt64SortProc = QuickSort;
+ {$IFNDEF CLR}
+ PtrSortProc: TPtrSortProc = QuickSort;
+ {$ENDIF ~CLR}
SortProc: TSortProc = QuickSort;
// Sort algorithms
procedure Sort(const AList: IJclIntfList; First, Last: Integer; AComparator: TIntfCompare); overload;
procedure Sort(const AList: IJclAnsiStrList; First, Last: Integer; AComparator: TAnsiStrCompare); overload;
procedure Sort(const AList: IJclWideStrList; First, Last: Integer; AComparator: TWideStrCompare); overload;
+procedure Sort(const AList: IJclSingleList; First, Last: Integer; AComparator: TSingleCompare); overload;
+procedure Sort(const AList: IJclDoubleList; First, Last: Integer; AComparator: TDoubleCompare); overload;
+procedure Sort(const AList: IJclExtendedList; First, Last: Integer; AComparator: TExtendedCompare); overload;
+procedure Sort(const AList: IJclIntegerList; First, Last: Integer; AComparator: TIntegerCompare); overload;
+procedure Sort(const AList: IJclCardinalList; First, Last: Integer; AComparator: TCardinalCompare); overload;
+procedure Sort(const AList: IJclInt64List; First, Last: Integer; AComparator: TInt64Compare); overload;
+{$IFNDEF CLR}
+procedure Sort(const AList: IJclPtrList; First, Last: Integer; AComparator: TPtrCompare); overload;
+{$ENDIF ~CLR}
procedure Sort(const AList: IJclList; First, Last: Integer; AComparator: TCompare); overload;
{$IFDEF SUPPORTS_GENERICS}
@@ -243,6 +409,96 @@
end;
end;
+function SingleSimpleCompare(const Obj1, Obj2: Single): Integer;
+begin
+ if Obj1 < Obj2 then
+ Result := -1
+ else
+ if Obj1 > Obj2 then
+ Result := 1
+ else
+ Result := 0;
+end;
+
+function DoubleSimpleCompare(const Obj1, Obj2: Double): Integer;
+begin
+ if Obj1 < Obj2 then
+ Result := -1
+ else
+ if Obj1 > Obj2 then
+ Result := 1
+ else
+ Result := 0;
+end;
+
+function ExtendedSimpleCompare(const Obj1, Obj2: Extended): Integer;
+begin
+ if Obj1 < Obj2 then
+ Result := -1
+ else
+ if Obj1 > Obj2 then
+ Result := 1
+ else
+ Result := 0;
+end;
+
+function FloatSimpleCompare(const Obj1, Obj2: Float): Integer;
+begin
+ if Obj1 < Obj2 then
+ Result := -1
+ else
+ if Obj1 > Obj2 then
+ Result := 1
+ else
+ Result := 0;
+end;
+
+function IntegerSimpleCompare(Obj1, Obj2: Integer): Integer;
+begin
+ if Obj1 < Obj2 then
+ Result := -1
+ else
+ if Obj1 > Obj2 then
+ Result := 1
+ else
+ Result := 0;
+end;
+
+function CardinalSimpleCompare(Obj1, Obj2: Cardinal): Integer;
+begin
+ if Obj1 < Obj2 then
+ Result := -1
+ else
+ if Obj1 > Obj2 then
+ Result := 1
+ else
+ Result := 0;
+end;
+
+function Int64SimpleCompare(const Obj1, Obj2: Int64): Integer;
+begin
+ if Obj1 < Obj2 then
+ Result := -1
+ else
+ if Obj1 > Obj2 then
+ Result := 1
+ else
+ Result := 0;
+end;
+
+{$IFNDEF CLR}
+function PtrSimpleCompare(Obj1, Obj2: Pointer): Integer;
+begin
+ if Integer(Obj1) < Integer(Obj2) then
+ Result := -1
+ else
+ if Integer(Obj1) > Integer(Obj2) then
+ Result := 1
+ else
+ Result := 0;
+end;
+{$ENDIF ~CLR}
+
function SimpleCompare(Obj1, Obj2: TObject): Integer;
begin
if Cardinal(Obj1) < Cardinal(Obj2) then
@@ -256,7 +512,13 @@
function IntegerCompare(Obj1, Obj2: TObject): Integer;
begin
- Result := Integer(Obj1) - Integer(Obj2);
+ if Integer(Obj1) < Integer(Obj2) then
+ Result := -1
+ else
+ if Integer(Obj1) > Integer(Obj2) then
+ Result := 1
+ else
+ Result := 0;
end;
procedure Apply(const First: IJclIntfIterator; Count: Integer; F: TIntfApplyFunction);
@@ -292,6 +554,85 @@
Break;
end;
+procedure Apply(const First: IJclSingleIterator; Count: Integer; F: TSingleApplyFunction);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ First.SetValue(F(First.Next))
+ else
+ Break;
+end;
+
+procedure Apply(const First: IJclDoubleIterator; Count: Integer; F: TDoubleApplyFunction);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ First.SetValue(F(First.Next))
+ else
+ Break;
+end;
+
+procedure Apply(const First: IJclExtendedIterator; Count: Integer; F: TExtendedApplyFunction);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ First.SetValue(F(First.Next))
+ else
+ Break;
+end;
+
+procedure Apply(const First: IJclIntegerIterator; Count: Integer; F: TIntegerApplyFunction);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ First.SetValue(F(First.Next))
+ else
+ Break;
+end;
+
+procedure Apply(const First: IJclCardinalIterator; Count: Integer; F: TCardinalApplyFunction);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ First.SetValue(F(First.Next))
+ else
+ Break;
+end;
+
+procedure Apply(const First: IJclInt64Iterator; Count: Integer; F: TInt64ApplyFunction);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ First.SetValue(F(First.Next))
+ else
+ Break;
+end;
+
+{$IFNDEF CLR}
+procedure Apply(const First: IJclPtrIterator; Count: Integer; F: TPtrApplyFunction);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ First.SetPtr(F(First.Next))
+ else
+ Break;
+end;
+{$ENDIF ~CLR}
+
procedure Apply(const First: IJclIterator; Count: Integer; F: TApplyFunction);
var
I: Integer;
@@ -360,6 +701,141 @@
Break;
end;
+function Find(const First: IJclSingleIterator; Count: Integer; const AValue: Single;
+ AComparator: TSingleCompare): IJclSingleIterator;
+var
+ I: Integer;
+begin
+ Result := nil;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ if AComparator(First.Next, AValue) = 0 then
+ begin
+ Result := First;
+ Break;
+ end;
+ end
+ else
+ Break;
+end;
+
+function Find(const First: IJclDoubleIterator; Count: Integer; const AValue: Double;
+ AComparator: TDoubleCompare): IJclDoubleIterator;
+var
+ I: Integer;
+begin
+ Result := nil;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ if AComparator(First.Next, AValue) = 0 then
+ begin
+ Result := First;
+ Break;
+ end;
+ end
+ else
+ Break;
+end;
+
+function Find(const First: IJclExtendedIterator; Count: Integer; const AValue: Extended;
+ AComparator: TExtendedCompare): IJclExtendedIterator;
+var
+ I: Integer;
+begin
+ Result := nil;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ if AComparator(First.Next, AValue) = 0 then
+ begin
+ Result := First;
+ Break;
+ end;
+ end
+ else
+ Break;
+end;
+
+function Find(const First: IJclIntegerIterator; Count: Integer; AValue: Integer;
+ AComparator: TIntegerCompare): IJclIntegerIterator;
+var
+ I: Integer;
+begin
+ Result := nil;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ if AComparator(First.Next, AValue) = 0 then
+ begin
+ Result := First;
+ Break;
+ end;
+ end
+ else
+ Break;
+end;
+
+function Find(const First: IJclCardinalIterator; Count: Integer; AValue: Cardinal;
+ AComparator: TCardinalCompare): IJclCardinalIterator;
+var
+ I: Integer;
+begin
+ Result := nil;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ if AComparator(First.Next, AValue) = 0 then
+ begin
+ Result := First;
+ Break;
+ end;
+ end
+ else
+ Break;
+end;
+
+function Find(const First: IJclInt64Iterator; Count: Integer; const AValue: Int64;
+ AComparator: TInt64Compare): IJclInt64Iterator;
+var
+ I: Integer;
+begin
+ Result := nil;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ if AComparator(First.Next, AValue) = 0 then
+ begin
+ Result := First;
+ Break;
+ end;
+ end
+ else
+ Break;
+end;
+
+{$IFNDEF CLR}
+function Find(const First: IJclPtrIterator; Count: Integer; APtr: Pointer;
+ AComparator: TPtrCompare): IJclPtrIterator;
+var
+ I: Integer;
+begin
+ Result := nil;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ if AComparator(First.Next, APtr) = 0 then
+ begin
+ Result := First;
+ Break;
+ end;
+ end
+ else
+ Break;
+end;
+{$ENDIF ~CLR}
+
function Find(const First: IJclIterator; Count: Integer; AObject: TObject;
AComparator: TCompare): IJclIterator;
var
@@ -418,6 +894,99 @@
Break;
end;
+function CountObject(const First: IJclSingleIterator; Count: Integer; const AValue: Single;
+ AComparator: TSingleCompare): Integer;
+var
+ I: Integer;
+begin
+ Result := 0;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ Inc(Result, Ord(AComparator(First.Next, AValue) = 0))
+ else
+ Break;
+end;
+
+function CountObject(const First: IJclDoubleIterator; Count: Integer; const AValue: Double;
+ AComparator: TDoubleCompare): Integer;
+var
+ I: Integer;
+begin
+ Result := 0;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ Inc(Result, Ord(AComparator(First.Next, AValue) = 0))
+ else
+ Break;
+end;
+
+function CountObject(const First: IJclExtendedIterator; Count: Integer; const AValue: Extended;
+ AComparator: TExtendedCompare): Integer;
+var
+ I: Integer;
+begin
+ Result := 0;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ Inc(Result, Ord(AComparator(First.Next, AValue) = 0))
+ else
+ Break;
+end;
+
+function CountObject(const First: IJclIntegerIterator; Count: Integer; AValue: Integer;
+ AComparator: TIntegerCompare): Integer;
+var
+ I: Integer;
+begin
+ Result := 0;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ Inc(Result, Ord(AComparator(First.Next, AValue) = 0))
+ else
+ Break;
+end;
+
+function CountObject(const First: IJclCardinalIterator; Count: Integer; AValue: Cardinal;
+ AComparator: TCardinalCompare): Integer;
+var
+ I: Integer;
+begin
+ Result := 0;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ Inc(Result, Ord(AComparator(First.Next, AValue) = 0))
+ else
+ Break;
+end;
+
+function CountObject(const First: IJclInt64Iterator; Count: Integer; const AValue: Int64;
+ AComparator: TInt64Compare): Integer;
+var
+ I: Integer;
+begin
+ Result := 0;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ Inc(Result, Ord(AComparator(First.Next, AValue) = 0))
+ else
+ Break;
+end;
+
+{$IFNDEF CLR}
+function CountObject(const First: IJclPtrIterator; Count: Integer; APtr: Pointer;
+ AComparator: TPtrCompare): Integer;
+var
+ I: Integer;
+begin
+ Result := 0;
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ Inc(Result, Ord(AComparator(First.Next, APtr) = 0))
+ else
+ Break;
+end;
+{$ENDIF ~CLR}
+
function CountObject(const First: IJclIterator; Count: Integer; AObject: TObject;
AComparator: TCompare): Integer;
var
@@ -476,6 +1045,113 @@
Break;
end;
+procedure Copy(const First: IJclSingleIterator; Count: Integer;
+ const Output: IJclSingleIterator);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if Output.HasNext and First.HasNext then
+ begin
+ Output.Next;
+ Output.SetValue(First.Next);
+ end
+ else
+ Break;
+end;
+
+procedure Copy(const First: IJclDoubleIterator; Count: Integer;
+ const Output: IJclDoubleIterator);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if Output.HasNext and First.HasNext then
+ begin
+ Output.Next;
+ Output.SetValue(First.Next);
+ end
+ else
+ Break;
+end;
+
+procedure Copy(const First: IJclExtendedIterator; Count: Integer;
+ const Output: IJclExtendedIterator);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if Output.HasNext and First.HasNext then
+ begin
+ Output.Next;
+ Output.SetValue(First.Next);
+ end
+ else
+ Break;
+end;
+
+procedure Copy(const First: IJclIntegerIterator; Count: Integer;
+ const Output: IJclIntegerIterator);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if Output.HasNext and First.HasNext then
+ begin
+ Output.Next;
+ Output.SetValue(First.Next);
+ end
+ else
+ Break;
+end;
+
+procedure Copy(const First: IJclCardinalIterator; Count: Integer;
+ const Output: IJclCardinalIterator);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if Output.HasNext and First.HasNext then
+ begin
+ Output.Next;
+ Output.SetValue(First.Next);
+ end
+ else
+ Break;
+end;
+
+procedure Copy(const First: IJclInt64Iterator; Count: Integer;
+ const Output: IJclInt64Iterator);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if Output.HasNext and First.HasNext then
+ begin
+ Output.Next;
+ Output.SetValue(First.Next);
+ end
+ else
+ Break;
+end;
+
+{$IFNDEF CLR}
+procedure Copy(const First: IJclPtrIterator; Count: Integer;
+ const Output: IJclPtrIterator);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if Output.HasNext and First.HasNext then
+ begin
+ Output.Next;
+ Output.SetPtr(First.Next);
+ end
+ else
+ Break;
+end;
+{$ENDIF ~CLR}
+
procedure Copy(const First: IJclIterator; Count: Integer;
const Output: IJclIterator);
var
@@ -521,6 +1197,71 @@
List.Add(AString);
end;
+procedure Generate(const List: IJclSingleList; Count: Integer; const AValue: Single);
+var
+ I: Integer;
+begin
+ List.Clear;
+ for I := Count - 1 downto 0 do
+ List.Add(AValue);
+end;
+
+procedure Generate(const List: IJclDoubleList; Count: Integer; const AValue: Double);
+var
+ I: Integer;
+begin
+ List.Clear;
+ for I := Count - 1 downto 0 do
+ List.Add(AValue);
+end;
+
+procedure Generate(const List: IJclExtendedList; Count: Integer; const AValue: Extended);
+var
+ I: Integer;
+begin
+ List.Clear;
+ for I := Count - 1 downto 0 do
+ List.Add(AValue);
+end;
+
+procedure Generate(const List: IJclIntegerList; Count: Integer; AValue: Integer);
+var
+ I: Integer;
+begin
+ List.Clear;
+ for I := Count - 1 downto 0 do
+ List.Add(AValue);
+end;
+
+procedure Generate(const List: IJclCardinalList; Count: Integer; AValue: Cardinal);
+var
+ I: Integer;
+begin
+ List.Clear;
+ for I := Count - 1 downto 0 do
+ List.Add(AValue);
+end;
+
+procedure Generate(const List: IJclInt64List; Count: Integer; const AValue: Int64);
+var
+ I: Integer;
+begin
+ List.Clear;
+ for I := Count - 1 downto 0 do
+ List.Add(AValue);
+end;
+
+{$IFNDEF CLR}
+procedure Generate(const List: IJclPtrList; Count: Integer; APtr: Pointer);
+var
+ I: Integer;
+begin
+ List.Clear;
+ for I := Count - 1 downto 0 do
+ List.Add(APtr);
+end;
+{$ENDIF ~CLR}
+
procedure Generate(const List: IJclList; Count: Integer; AObject: TObject);
var
I: Integer;
@@ -575,6 +1316,106 @@
Break;
end;
+procedure Fill(const First: IJclSingleIterator; Count: Integer; const AValue: Single);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ First.Next;
+ First.SetValue(AValue);
+ end
+ else
+ Break;
+end;
+
+procedure Fill(const First: IJclDoubleIterator; Count: Integer; const AValue: Double);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ First.Next;
+ First.SetValue(AValue);
+ end
+ else
+ Break;
+end;
+
+procedure Fill(const First: IJclExtendedIterator; Count: Integer; const AValue: Extended);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ First.Next;
+ First.SetValue(AValue);
+ end
+ else
+ Break;
+end;
+
+procedure Fill(const First: IJclIntegerIterator; Count: Integer; AValue: Integer);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ First.Next;
+ First.SetValue(AValue);
+ end
+ else
+ Break;
+end;
+
+procedure Fill(const First: IJclCardinalIterator; Count: Integer; AValue: Cardinal);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ First.Next;
+ First.SetValue(AValue);
+ end
+ else
+ Break;
+end;
+
+procedure Fill(const First: IJclInt64Iterator; Count: Integer; const AValue: Int64);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ First.Next;
+ First.SetValue(AValue);
+ end
+ else
+ Break;
+end;
+
+{$IFNDEF CLR}
+procedure Fill(const First: IJclPtrIterator; Count: Integer; APtr: Pointer);
+var
+ I: Integer;
+begin
+ for I := Count - 1 downto 0 do
+ if First.HasNext then
+ begin
+ First.Next;
+ First.SetPtr(APtr);
+ end
+ else
+ Break;
+end;
+{$ENDIF ~CLR}
+
procedure Fill(const First: IJclIterator; Count: Integer; AObject: TObject);
var
I: Integer;
@@ -640,6 +1481,127 @@
end;
end;
+procedure Reverse(const First, Last: IJclSingleIterator);
+var
+ Obj: Single;
+begin
+ if not First.HasNext then
+ Exit;
+ if not Last.HasPrevious then
+ Exit;
+ while First.NextIndex <= Last.PreviousIndex do
+ begin
+ Obj := First.Next;
+ Last.Previous;
+ First.SetValue(Last.GetValue);
+ Last.SetValue(Obj);
+ end;
+end;
+
+procedure Reverse(const First, Last: IJclDoubleIterator);
+var
+ Obj: Double;
+begin
+ if not First.HasNext then
+ Exit;
+ if not Last.HasPrevious then
+ Exit;
+ while First.NextIndex <= Last.PreviousIndex do
+ begin
+ Obj := First.Next;
+ Last.Previous;
+ First.SetValue(Last.GetValue);
+ Last.SetValue(Obj);
+ end;
+end;
+
+procedure Reverse(const First, Last: IJclExtendedIterator);
+var
+ Obj: Extended;
+begin
+ if not First.HasNext then
+ Exit;
+ if not Last.HasPrevious then
+ Exit;
+ while First.NextIndex <= Last.PreviousIndex do
+ begin
+ Obj := First.Next;
+ Last.Previous;
+ First.SetValue(Last.GetValue);
+ Last.SetValue(Obj);
+ end;
+end;
+
+procedure Reverse(const First, Last: IJclIntegerIterator);
+var
+ Obj: Integer;
+begin
+ if not First.HasNext then
+ Exit;
+ if not Last.HasPrevious then
+ Exit;
+ while First.NextIndex <= Last.PreviousIndex do
+ begin
+ Obj := First.Next;
+ Last.Previous;
+ First.SetValue(Last.GetValue);
+ Last.SetValue(Obj);
+ end;
+end;
+
+procedure Reverse(const First, Last: IJclCardinalIterator);
+var
+ Obj: Cardinal;
+begin
+ if not First.HasNext then
+ Exit;
+ if not Last.HasPrevious then
+ Exit;
+ while First.NextIndex <= Last.PreviousIndex do
+ begin
+ Obj := First.Next;
+ Last.Previous;
+ First.SetValue(Last.GetValue);
+ Last.SetValue(Obj);
+ end;
+end;
+
+procedure Reverse(const First, Last: IJclInt64Iterator);
+var
+ Obj: Int64;
+begin
+ if not First.HasNext then
+ Exit;
+ if not Last.HasPrevious then
+ Exit;
+ while First.NextIndex <= Last.PreviousIndex do
+ begin
+ Obj := First.Next;
+ Last.Previous;
+ First.SetValue(Last.GetValue);
+ Last.SetValue(Obj);
+ end;
+end;
+
+{$IFNDEF CLR}
+procedure Reverse(const First, Last: IJclPtrIterator);
+var
+ Obj: Pointer;
+begin
+ if not First.HasNext then
+ Exit;
+ if not Last.HasPrevious then
+ Exit;
+ while First.NextIndex <= Last.PreviousIndex do
+ begin
+ Obj := First.Next;
+ Last.Previous;
+ First.SetPtr(Last.GetPtr);
+ Last.SetPtr(Obj);
+ end;
+end;
+{$ENDIF ~CLR}
+
procedure Reverse(const First, Last: IJclIterator);
var
Obj: TObject;
@@ -762,6 +1724,246 @@
until I >= R;
end;
+procedure QuickSort(const AList: IJclSingleList; L, R: Integer; AComparator: TSingleCompare);
+var
+ I, J, P: Integer;
+ Obj: Single;
+begin
+ repeat
+ I := L;
+ J := R;
+ P := (L + R) shr 1;
+ repeat
+ while AComparator(AList.GetValue(I), AList.GetValue(P)) < 0 do
+ Inc(I);
+ while AComparator(AList.GetValue(J), AList.GetValue(P)) > 0 do
+ Dec(J);
+ if I <= J then
+ begin
+ Obj := AList.GetValue(I);
+ AList.SetValue(I, AList.GetValue(J));
+ AList.SetValue(J, Obj);
+ if P = I then
+ P := J
+ else
+ if P = J then
+ P := I;
+ Inc(I);
+ Dec(J);
+ end;
+ until I > J;
+ if L < J then
+ QuickSort(AList, L, J, AComparator);
+ L := I;
+ until I >= R;
+end;
+
+procedure QuickSort(const AList: IJclDoubleList; L, R: Integer; AComparator: TDoubleCompare);
+var
+ I, J, P: Integer;
+ Obj: Double;
+begin
+ repeat
+ I := L;
+ J := R;
+ P := (L + R) shr 1;
+ repeat
+ while AComparator(AList.GetValue(I), AList.GetValue(P)) < 0 do
+ Inc(I);
+ while AComparator(AList.GetValue(J), AList.GetValue(P)) > 0 do
+ Dec(J);
+ if I <= J then
+ begin
+ Obj := AList.GetValue(I);
+ AList.SetValue(I, AList.GetValue(J));
+ AList.SetValue(J, Obj);
+ if P = I then
+ P := J
+ else
+ if P = J then
+ P := I;
+ Inc(I);
+ Dec(J);
+ end;
+ until I > J;
+ if L < J then
+ QuickSort(AList, L, J, AComparator);
+ L := I;
+ until I >= R;
+end;
+
+procedure QuickSort(const AList: IJclExtendedList; L, R: Integer; AComparator: TExtendedCompare);
+var
+ I, J, P: Integer;
+ Obj: Extended;
+begin
+ repeat
+ I := L;
+ J := R;
+ P := (L + R) shr 1;
+ repeat
+ while AComparator(AList.GetValue(I), AList.GetValue(P)) < 0 do
+ Inc(I);
+ while AComparator(AList.GetValue(J), AList.GetValue(P)) > 0 do
+ Dec(J);
+ if I <= J then
+ begin
+ Obj := AList.GetValue(I);
+ AList.SetValue(I, AList.GetValue(J));
+ AList.SetValue(J, Obj);
+ if P = I then
+ P := J
+ else
+ if P = J then
+ P := I;
+ Inc(I);
+ Dec(J);
+ end;
+ until I > J;
+ if L < J then
+ QuickSort(AList, L, J, AComparator);
+ L := I;
+ until I >= R;
+end;
+
+procedure QuickSort(const AList: IJclIntegerList; L, R: Integer; AComparator: TIntegerCompare);
+var
+ I, J, P: Integer;
+ Obj: Integer;
+begin
+ repeat
+ I := L;
+ J := R;
+ P := (L + R) shr 1;
+ repeat
+ while AComparator(AList.GetValue(I), AList.GetValue(P)) < 0 do
+ Inc(I);
+ while AComparator(AList.GetValue(J), AList.GetValue(P)) > 0 do
+ Dec(J);
+ if I <= J then
+ begin
+ Obj := AList.GetValue(I);
+ AList.SetValue(I, AList.GetValue(J));
+ AList.SetValue(J, Obj);
+ if P = I then
+ P := J
+ else
+ if P = J then
+ P := I;
+ Inc(I);
+ Dec(J);
+ end;
+ until I > J;
+ if L < J then
+ QuickSort(AList, L, J, AComparator);
+ L := I;
+ until I >= R;
+end;
+
+procedure QuickSort(const AList: IJclCardinalList; L, R: Integer; AComparator: TCardinalCompare);
+var
+ I, J, P: Integer;
+ Obj: Cardinal;
+begin
+ repeat
+ I := L;
+ J := R;
+ P := (L + R) shr 1;
+ repeat
+ while AComparator(AList.GetValue(I), AList.GetValue(P)) < 0 do
+ Inc(I);
+ while AComparator(AList.GetValue(J), AList.GetValue(P)) > 0 do
+ Dec(J);
+ if I <= J then
+ begin
+ Obj := AList.GetValue(I);
+ AList.SetValue(I, AList.GetValue(J));
+ AList.SetValue(J, Obj);
+ if P = I then
+ P := J
+ else
+ if P = J then
+ P := I;
+ Inc(I);
+ Dec(J);
+ end;
+ until I > J;
+ if L < J then
+ QuickSort(AList, L, J, AComparator);
+ L := I;
+ until I >= R;
+end;
+
+procedure QuickSort(const AList: IJclInt64List; L, R: Integer; AComparator: TInt64Compare);
+var
+ I, J, P: Integer;
+ Obj: Int64;
+begin
+ repeat
+ I := L;
+ J := R;
+ P := (L + R) shr 1;
+ repeat
+ while AComparator(AList.GetValue(I), AList.GetValue(P)) < 0 do
+ Inc(I);
+ while AComparator(AList.GetValue(J), AList.GetValue(P)) > 0 do
+ Dec(J);
+ if I <= J then
+ begin
+ Obj := AList.GetValue(I);
+ AList.SetValue(I, AList.GetValue(J));
+ AList.SetValue(J, Obj);
+ if P = I then
+ P := J
+ else
+ if P = J then
+ P := I;
+ Inc(I);
+ Dec(J);
+ end;
+ until I > J;
+ if L < J then
+ QuickSort(AList, L, J, AComparator);
+ L := I;
+ until I >= R;
+end;
+
+{$IFNDEF CLR}
+procedure QuickSort(const AList: IJclPtrList; L, R: Integer; AComparator: TPtrCompare);
+var
+ I, J, P: Integer;
+ Obj: Pointer;
+begin
+ repeat
+ I := L;
+ J := R;
+ P := (L + R) shr 1;
+ repeat
+ while AComparator(AList.GetPtr(I), AList.GetPtr(P)) < 0 do
+ Inc(I);
+ while AComparator(AList.GetPtr(J), AList.GetPtr(P)) > 0 do
+ Dec(J);
+ if I <= J then
+ begin
+ Obj := AList.GetPtr(I);
+ AList.SetPtr(I, AList.GetPtr(J));
+ AList.SetPtr(J, Obj);
+ if P = I then
+ P := J
+ else
+ if P = J then
+ P := I;
+ Inc(I);
+ Dec(J);
+ end;
+ until I > J;
+ if L < J then
+ QuickSort(AList, L, J, AComparator);
+ L := I;
+ until I >= R;
+end;
+{$ENDIF ~CLR}
+
procedure QuickSort(const AList: IJclList; L, R: Integer; AComparator: TCompare);
var
I, J, P: Integer;
@@ -811,6 +2013,43 @@
WideStrSortProc(AList, First, Last, AComparator);
end;
+procedure Sort(const AList: IJclSingleList; First, Last: Integer; AComparator: TSingleCompare);
+begin
+ SingleSortProc(AList, First, Last, AComparator);
+end;
+
+procedure Sort(const AList: IJclDoubleList; First, Last: Integer; AComparator: TDoubleCompare);
+begin
+ DoubleSortProc(AList, First, Last, AComparator);
+end;
+
+procedure Sort(const AList: IJclExtendedList; First, Last: Integer; AComparator: TExtendedCompare);
+begin
+ ExtendedSortProc(AList, First, Last, AComparator);
+end;
+
+procedure Sort(const AList: IJclIntegerList; First, Last: Integer; AComparator: TIntegerCompare);
+begin
+ IntegerSortProc(AList, First, Last, AComparator);
+end;
+
+procedure Sort(const AList: IJclCardinalList; First, Last: Integer; AComparator: TCardinalCompare);
+begin
+ CardinalSortProc(AList, First, Last, AComparator);
+end;
+
+procedure Sort(const AList: IJclInt64List; First, Last: Integer; AComparator: TInt64Compare);
+begin
+ Int64SortProc(AList, First, Last, AComparator);
+end;
+
+{$IFNDEF CLR}
+procedure Sort(const AList: IJclPtrList; First, Last: Integer; AComparator: TPtrCompare);
+begin
+ PtrSortProc(AList, First, Last, AComparator);
+end;
+{$ENDIF ~CLR}
+
procedure Sort(const AList: IJclList; First, Last: Integer; AComparator: TCompare);
begin
SortProc(AList, First, Last, AComparator);
Modified: trunk/jcl/source/common/JclArrayLists.pas
===================================================================
--- trunk/jcl/source/common/JclArrayLists.pas 2007-11-14 00:30:09 UTC (rev 2218)
+++ trunk/jcl/source/common/JclArrayLists.pas 2007-11-14 22:29:53 UTC (rev 2219)
@@ -197,6 +197,333 @@
{$ENDIF CONTAINER_WIDESTR}
+ TJclSingleArrayList = class(TJclSingleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclIntfCloneable, IJclCloneable, IJclPackable, IJclGrowable, IJclContainer, IJclSingleContainer, IJclSingleEqualityComparer,
+ IJclSingleCollection, IJclSingleList, IJclSingleArray)
+ private
+ FElementData: JclBase.TDynSingleArray;
+ protected
+ procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
+ { IJclPackable }
+ procedure SetCapacity(Value: Integer); override;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclSingleCollection }
+ function Add(const AValue: Single): Boolean;
+ function AddAll(const ACollection: IJclSingleCollection): Boolean;
+ procedure Clear;
+ function Contains(const AValue: Single): Boolean;
+ function ContainsAll(const ACollection: IJclSingleCollection): Boolean;
+ function Equals(const ACollection: IJclSingleCollection): Boolean;
+ function First: IJclSingleIterator;
+ function IsEmpty: Boolean;
+ function Last: IJclSingleIterator;
+ function Remove(const AValue: Single): Boolean;
+ function RemoveAll(const ACollection: IJclSingleCollection): Boolean;
+ function RetainAll(const ACollection: IJclSingleCollection): Boolean;
+ function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclSingleIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
+ { IJclSingleList }
+ function Insert(Index: Integer; const AValue: Single): Boolean;
+ function InsertAll(Index: Integer; const ACollection: IJclSingleCollection): Boolean;
+ function GetValue(Index: Integer): Single;
+ function IndexOf(const AValue: Single): Integer;
+ function LastIndexOf(const AValue: Single): Integer;
+ function Delete(Index: Integer): Single; overload;
+ procedure SetValue(Index: Integer; const AValue: Single);
+ function SubList(First, Count: Integer): IJclSingleList;
+ function CreateEmptyContainer: TJclAbstractContainerBase; override;
+ public
+ constructor Create(ACapacity: Integer); overload;
+ constructor Create(const ACollection: IJclSingleCollection); overload;
+ destructor Destroy; override;
+ end;
+
+
+ TJclDoubleArrayList = class(TJclDoubleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclIntfCloneable, IJclCloneable, IJclPackable, IJclGrowable, IJclContainer, IJclDoubleContainer, IJclDoubleEqualityComparer,
+ IJclDoubleCollection, IJclDoubleList, IJclDoubleArray)
+ private
+ FElementData: JclBase.TDynDoubleArray;
+ protected
+ procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
+ { IJclPackable }
+ procedure SetCapacity(Value: Integer); override;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclDoubleCollection }
+ function Add(const AValue: Double): Boolean;
+ function AddAll(const ACollection: IJclDoubleCollection): Boolean;
+ procedure Clear;
+ function Contains(const AValue: Double): Boolean;
+ function ContainsAll(const ACollection: IJclDoubleCollection): Boolean;
+ function Equals(const ACollection: IJclDoubleCollection): Boolean;
+ function First: IJclDoubleIterator;
+ function IsEmpty: Boolean;
+ function Last: IJclDoubleIterator;
+ function Remove(const AValue: Double): Boolean;
+ function RemoveAll(const ACollection: IJclDoubleCollection): Boolean;
+ function RetainAll(const ACollection: IJclDoubleCollection): Boolean;
+ function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclDoubleIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
+ { IJclDoubleList }
+ function Insert(Index: Integer; const AValue: Double): Boolean;
+ function InsertAll(Index: Integer; const ACollection: IJclDoubleCollection): Boolean;
+ function GetValue(Index: Integer): Double;
+ function IndexOf(const AValue: Double): Integer;
+ function LastIndexOf(const AValue: Double): Integer;
+ function Delete(Index: Integer): Double; overload;
+ procedure SetValue(Index: Integer; const AValue: Double);
+ function SubList(First, Count: Integer): IJclDoubleList;
+ function CreateEmptyContainer: TJclAbstractContainerBase; override;
+ public
+ constructor Create(ACapacity: Integer); overload;
+ constructor Create(const ACollection: IJclDoubleCollection); overload;
+ destructor Destroy; override;
+ end;
+
+
+ TJclExtendedArrayList = class(TJclExtendedAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
+ IJclIntfCloneable, IJclCloneable, IJclPackable, IJclGrowable, IJclContainer, IJclExtendedContainer, IJclExtendedEqualityComparer,
+ IJclExtendedCollection, IJclExtendedList, IJclExtendedArray)
+ private
+ FElementData: JclBase.TDynExtendedArray;
+ protected
+ procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
+ { IJclPackable }
+ procedure SetCapacity(Value: Integer); override;
+ { IJclIntfCloneable }
+ function IJclIntfCloneable.Clone = IntfClone;
+ { IJclExtendedCollection }
+ function Add(const AValue: Exte...
[truncated message content] |
|
From: <usc...@us...> - 2007-11-14 00:30:11
|
Revision: 2218
http://jcl.svn.sourceforge.net/jcl/?rev=2218&view=rev
Author: uschuster
Date: 2007-11-13 16:30:09 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
fixed example for older versions
Modified Paths:
--------------
branches/compression/jcl/examples/windows/compression/archive/ArchiveDemo.dpr
branches/compression/jcl/examples/windows/compression/archive/ArchiveDemo.res
branches/compression/jcl/examples/windows/compression/archive/UMain.pas
Modified: branches/compression/jcl/examples/windows/compression/archive/ArchiveDemo.dpr
===================================================================
--- branches/compression/jcl/examples/windows/compression/archive/ArchiveDemo.dpr 2007-11-13 23:54:57 UTC (rev 2217)
+++ branches/compression/jcl/examples/windows/compression/archive/ArchiveDemo.dpr 2007-11-14 00:30:09 UTC (rev 2218)
@@ -8,7 +8,6 @@
begin
Application.Initialize;
- Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Modified: branches/compression/jcl/examples/windows/compression/archive/ArchiveDemo.res
===================================================================
(Binary files differ)
Modified: branches/compression/jcl/examples/windows/compression/archive/UMain.pas
===================================================================
--- branches/compression/jcl/examples/windows/compression/archive/UMain.pas 2007-11-13 23:54:57 UTC (rev 2217)
+++ branches/compression/jcl/examples/windows/compression/archive/UMain.pas 2007-11-14 00:30:09 UTC (rev 2218)
@@ -1,5 +1,7 @@
unit UMain;
+{$I jcl.inc}
+
interface
uses
@@ -97,7 +99,7 @@
var
Directory: string;
begin
- if FileCtrl.SelectDirectory('Select directory', '', Directory, [sdNewUI], Self) then
+ if FileCtrl.SelectDirectory('Select directory', '', Directory {$IFDEF COMPILER9_UP} , [sdNewUI], Self {$ENDIF}) then
begin
(FArchive as TJclCompressArchive).AddDirectory(ExtractFileName(Directory), Directory, True, True);
ListView1.Items.BeginUpdate;
@@ -158,7 +160,7 @@
var
Directory: string;
begin
- if FileCtrl.SelectDirectory('Target directory', '', Directory, [sdNewUI], Self) then
+ if FileCtrl.SelectDirectory('Target directory', '', Directory {$IFDEF COMPILER9_UP} , [sdNewUI], Self {$ENDIF}) then
begin
if FArchive is TJclDecompressArchive then
TJclDecompressArchive(FArchive).ExtractAll(Directory, True)
@@ -178,7 +180,7 @@
Directory: string;
Index: Integer;
begin
- if FileCtrl.SelectDirectory('Target directory', '', Directory, [sdNewUI], Self) then
+ if FileCtrl.SelectDirectory('Target directory', '', Directory {$IFDEF COMPILER9_UP} , [sdNewUI], Self {$ENDIF}) then
begin
for Index := 0 to ListView1.Items.Count - 1 do
FArchive.Items[Index].Selected := ListView1.Items.Item[Index].Selected;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <usc...@us...> - 2007-11-13 23:54:58
|
Revision: 2217
http://jcl.svn.sourceforge.net/jcl/?rev=2217&view=rev
Author: uschuster
Date: 2007-11-13 15:54:57 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
- fixed compilation with D5
- added missing file size in stream version of TJclCompressArchive.AddFile
Modified Paths:
--------------
branches/compression/jcl/source/common/JclCompression.pas
Modified: branches/compression/jcl/source/common/JclCompression.pas
===================================================================
--- branches/compression/jcl/source/common/JclCompression.pas 2007-11-13 19:39:23 UTC (rev 2216)
+++ branches/compression/jcl/source/common/JclCompression.pas 2007-11-13 23:54:57 UTC (rev 2217)
@@ -1061,6 +1061,7 @@
{$ENDIF MSWINDOWS}
{$IFDEF COMPILER5}
ComObj, // GUIDToString
+ JclUnicode, // WideSameText // TODO: should we use WideSameText from JclUnicode also for D6 and higher?
{$ENDIF COMPILER5}
JclDateTime, JclFileUtils, JclResources;
@@ -3016,6 +3017,7 @@
AItem.PackedName := PackedName;
AItem.Stream := AStream;
AItem.OwnsStream := AOwnsStream;
+ AItem.FileSize := AStream.Size - AStream.Position;
except
AItem.Destroy;
raise;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ah...@us...> - 2007-11-13 19:39:33
|
Revision: 2216
http://jcl.svn.sourceforge.net/jcl/?rev=2216&view=rev
Author: ahuser
Date: 2007-11-13 11:39:23 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
Style clean
Modified Paths:
--------------
trunk/jcl/source/vcl/JclFont.pas
Modified: trunk/jcl/source/vcl/JclFont.pas
===================================================================
--- trunk/jcl/source/vcl/JclFont.pas 2007-11-13 17:10:17 UTC (rev 2215)
+++ trunk/jcl/source/vcl/JclFont.pas 2007-11-13 19:39:23 UTC (rev 2216)
@@ -33,7 +33,7 @@
interface
type
- TFontType = (ftAuto, ftCaption, ftContent);
+ TFontType = (ftAuto, ftCaption, ftContent);
procedure SetObjectFontToSystemFont(const AObject: TObject; const FontType: TFontType = ftAuto);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-13 17:10:19
|
Revision: 2215
http://jcl.svn.sourceforge.net/jcl/?rev=2215&view=rev
Author: outchy
Date: 2007-11-13 09:10:17 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
collection containers now compatible with for..in loops (Delphi 2005 and newer)
Modified Paths:
--------------
trunk/jcl/source/common/JclAbstractContainers.pas
trunk/jcl/source/common/JclArrayLists.pas
trunk/jcl/source/common/JclBinaryTrees.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/common/JclHashSets.pas
trunk/jcl/source/common/JclLinkedLists.pas
trunk/jcl/source/common/JclVectors.pas
trunk/jcl/source/prototypes/containers/JclArrayLists.imp
trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
trunk/jcl/source/prototypes/containers/JclHashSets.imp
trunk/jcl/source/prototypes/containers/JclLinkedLists.imp
trunk/jcl/source/prototypes/containers/JclVectors.imp
Modified: trunk/jcl/source/common/JclAbstractContainers.pas
===================================================================
--- trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/common/JclAbstractContainers.pas 2007-11-13 17:10:17 UTC (rev 2215)
@@ -287,6 +287,9 @@
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; virtual; abstract;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; virtual; abstract;
function Size: Integer; virtual; abstract;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclAnsistrIterator; virtual; abstract;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrFlatContainer }
procedure LoadFromStrings(Strings: TStrings);
procedure SaveToStrings(Strings: TStrings);
@@ -319,6 +322,9 @@
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; virtual; abstract;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; virtual; abstract;
function Size: Integer; virtual; abstract;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclWideStrIterator; virtual; abstract;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrFlatContainer }
end;
Modified: trunk/jcl/source/common/JclArrayLists.pas
===================================================================
--- trunk/jcl/source/common/JclArrayLists.pas 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/common/JclArrayLists.pas 2007-11-13 17:10:17 UTC (rev 2215)
@@ -80,6 +80,9 @@
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIntfIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfList }
function Insert(Index: Integer; const AInterface: IInterface): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclIntfCollection): Boolean;
@@ -122,6 +125,9 @@
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclAnsiStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrList }
function Insert(Index: Integer; const AString: AnsiString): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclAnsiStrCollection): Boolean;
@@ -164,6 +170,9 @@
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclWideStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrList }
function Insert(Index: Integer; const AString: WideString): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclWideStrCollection): Boolean;
@@ -213,6 +222,9 @@
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclList }
function Insert(Index: Integer; AObject: TObject): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclCollection): Boolean;
@@ -256,6 +268,9 @@
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator<T>;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclList<T> }
function Insert(Index: Integer; const AItem: T): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclCollection<T>): Boolean;
@@ -364,6 +379,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(const AInterface: IInterface);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: IInterface read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const AOwnList: IJclIntfList; ACursor: Integer; AValid: Boolean);
end;
@@ -426,6 +445,17 @@
Result := FOwnList.Insert(FCursor, AInterface);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TIntfItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TIntfItr.Next: IInterface;
begin
if Valid then
@@ -498,6 +528,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: AnsiString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: AnsiString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const AOwnList: IJclAnsiStrList; ACursor: Integer; AValid: Boolean);
end;
@@ -560,6 +594,17 @@
Result := FOwnList.Insert(FCursor, AString);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TAnsiStrItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TAnsiStrItr.Next: AnsiString;
begin
if Valid then
@@ -632,6 +677,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: WideString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: WideString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const AOwnList: IJclWideStrList; ACursor: Integer; AValid: Boolean);
end;
@@ -694,6 +743,17 @@
Result := FOwnList.Insert(FCursor, AString);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TWideStrItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TWideStrItr.Next: WideString;
begin
if Valid then
@@ -766,6 +826,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(AObject: TObject);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: TObject read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const AOwnList: IJclList; ACursor: Integer; AValid: Boolean);
end;
@@ -828,6 +892,17 @@
Result := FOwnList.Insert(FCursor, AObject);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr.Next: TObject;
begin
if Valid then
@@ -902,6 +977,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetItem(const AItem: T);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: T read GetItem;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const AOwnList: IJclList<T>; ACursor: Integer; AValid: Boolean);
end;
@@ -964,6 +1043,17 @@
Result := FOwnList.Insert(FCursor, AItem);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr<T>.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr<T>.Next: T;
begin
if Valid then
@@ -1271,6 +1361,13 @@
Result := TIntfItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclIntfArrayList.GetEnumerator: IJclIntfIterator;
+begin
+ Result := TIntfItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclIntfArrayList.GetObject(Index: Integer): IInterface;
begin
{$IFDEF THREADSAFE}
@@ -1825,6 +1922,13 @@
Result := TAnsiStrItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclAnsiStrArrayList.GetEnumerator: IJclAnsiStrIterator;
+begin
+ Result := TAnsiStrItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclAnsiStrArrayList.GetString(Index: Integer): AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -2379,6 +2483,13 @@
Result := TWideStrItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclWideStrArrayList.GetEnumerator: IJclWideStrIterator;
+begin
+ Result := TWideStrItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclWideStrArrayList.GetString(Index: Integer): WideString;
begin
{$IFDEF THREADSAFE}
@@ -2933,6 +3044,13 @@
Result := TItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclArrayList.GetEnumerator: IJclIterator;
+begin
+ Result := TItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclArrayList.GetObject(Index: Integer): TObject;
begin
{$IFDEF THREADSAFE}
@@ -3483,6 +3601,13 @@
Result := TItr<T>.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclArrayList<T>.GetEnumerator: IJclIterator<T>;
+begin
+ Result := TItr<T>.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclArrayList<T>.GetItem(Index: Integer): T;
begin
{$IFDEF THREADSAFE}
Modified: trunk/jcl/source/common/JclBinaryTrees.pas
===================================================================
--- trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/common/JclBinaryTrees.pas 2007-11-13 17:10:17 UTC (rev 2215)
@@ -93,6 +93,9 @@
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIntfIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfTree }
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
@@ -147,6 +150,9 @@
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclAnsiStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrTree }
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
@@ -201,6 +207,9 @@
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclWideStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrTree }
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
@@ -262,6 +271,9 @@
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclTree }
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
@@ -316,6 +328,9 @@
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator<T>;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclTree<T> }
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);
@@ -419,6 +434,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(const AInterface: IInterface);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: IInterface read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclIntfCollection; Start: TJclIntfBinaryNode; AValid: Boolean);
end;
@@ -509,6 +528,26 @@
raise EJclOperationNotSupportedError.Create;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TIntfItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid then
+ FCursor := GetNextCursor
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TIntfItr.Next: IInterface;
begin
{$IFDEF THREADSAFE}
@@ -822,6 +861,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: AnsiString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: AnsiString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclAnsiStrCollection; Start: TJclAnsiStrBinaryNode; AValid: Boolean);
end;
@@ -912,6 +955,26 @@
raise EJclOperationNotSupportedError.Create;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TAnsiStrItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid then
+ FCursor := GetNextCursor
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TAnsiStrItr.Next: AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -1225,6 +1288,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: WideString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: WideString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclWideStrCollection; Start: TJclWideStrBinaryNode; AValid: Boolean);
end;
@@ -1315,6 +1382,26 @@
raise EJclOperationNotSupportedError.Create;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TWideStrItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid then
+ FCursor := GetNextCursor
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TWideStrItr.Next: WideString;
begin
{$IFDEF THREADSAFE}
@@ -1628,6 +1715,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(AObject: TObject);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: TObject read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclCollection; Start: TJclBinaryNode; AValid: Boolean);
end;
@@ -1718,6 +1809,26 @@
raise EJclOperationNotSupportedError.Create;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid then
+ FCursor := GetNextCursor
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr.Next: TObject;
begin
{$IFDEF THREADSAFE}
@@ -2032,6 +2143,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetItem(const AItem: T);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: T read GetItem;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclCollection<T>; Start: TJclBinaryNode<T>; AValid: Boolean);
end;
@@ -2122,6 +2237,26 @@
raise EJclOperationNotSupportedError.Create;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr<T>.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid then
+ FCursor := GetNextCursor
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr<T>.Next: T;
begin
{$IFDEF THREADSAFE}
@@ -2756,6 +2891,13 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclIntfBinaryTree.GetEnumerator: IJclIntfIterator;
+begin
+ Result := First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclIntfBinaryTree.GetTraverseOrder: TJclTraverseOrder;
begin
Result := FTraverseOrder;
@@ -3432,6 +3574,13 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclAnsiStrBinaryTree.GetEnumerator: IJclAnsiStrIterator;
+begin
+ Result := First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclAnsiStrBinaryTree.GetTraverseOrder: TJclTraverseOrder;
begin
Result := FTraverseOrder;
@@ -4108,6 +4257,13 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclWideStrBinaryTree.GetEnumerator: IJclWideStrIterator;
+begin
+ Result := First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclWideStrBinaryTree.GetTraverseOrder: TJclTraverseOrder;
begin
Result := FTraverseOrder;
@@ -4784,6 +4940,13 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclBinaryTree.GetEnumerator: IJclIterator;
+begin
+ Result := First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclBinaryTree.GetTraverseOrder: TJclTraverseOrder;
begin
Result := FTraverseOrder;
@@ -5456,6 +5619,13 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclBinaryTree<T>.GetEnumerator: IJclIterator<T>;
+begin
+ Result := First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclBinaryTree<T>.GetTraverseOrder: TJclTraverseOrder;
begin
Result := FTraverseOrder;
Modified: trunk/jcl/source/common/JclContainerIntf.pas
===================================================================
--- trunk/jcl/source/common/JclContainerIntf.pas 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/common/JclContainerIntf.pas 2007-11-13 17:10:17 UTC (rev 2215)
@@ -341,6 +341,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(const AInterface: IInterface);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: IInterface read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
IJclAnsiStrIterator = interface(IJclAbstractIterator)
@@ -356,6 +360,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: AnsiString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: AnsiString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
IJclWideStrIterator = interface(IJclAbstractIterator)
@@ -371,6 +379,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: WideString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: WideString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
{$IFDEF CONTAINER_ANSISTR}
@@ -393,6 +405,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(AObject: TObject);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: TObject read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
{$IFDEF SUPPORTS_GENERICS}
@@ -409,8 +425,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetItem(const AItem: T);
-
- property Item: T read GetItem write SetItem;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: T read GetItem;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
{$ENDIF SUPPORTS_GENERICS}
@@ -429,6 +447,9 @@
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIntfIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
IJclAnsiStrCollection = interface(IJclAnsiStrFlatContainer)
@@ -446,6 +467,9 @@
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclAnsiStrIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
IJclWideStrCollection = interface(IJclWideStrFlatContainer)
@@ -463,6 +487,9 @@
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclWideStrIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
{$IFDEF CONTAINER_ANSISTR}
@@ -487,6 +514,9 @@
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
{$IFDEF SUPPORTS_GENERICS}
@@ -505,6 +535,9 @@
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator<T>;
+ {$ENDIF SUPPORTS_FOR_IN}
end;
{$ENDIF SUPPORTS_GENERICS}
Modified: trunk/jcl/source/common/JclHashSets.pas
===================================================================
--- trunk/jcl/source/common/JclHashSets.pas 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/common/JclHashSets.pas 2007-11-13 17:10:17 UTC (rev 2215)
@@ -101,6 +101,9 @@
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIntfIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfSet }
procedure Intersect(const ACollection: IJclIntfCollection);
procedure Subtract(const ACollection: IJclIntfCollection);
@@ -153,6 +156,9 @@
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclAnsiStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrSet }
procedure Intersect(const ACollection: IJclAnsiStrCollection);
procedure Subtract(const ACollection: IJclAnsiStrCollection);
@@ -211,6 +217,9 @@
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclWideStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrSet }
procedure Intersect(const ACollection: IJclWideStrCollection);
procedure Subtract(const ACollection: IJclWideStrCollection);
@@ -276,6 +285,9 @@
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclSet }
procedure Intersect(const ACollection: IJclCollection);
procedure Subtract(const ACollection: IJclCollection);
@@ -333,6 +345,9 @@
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator<T>;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclSet<T> }
procedure Intersect(const ACollection: IJclCollection<T>);
procedure Subtract(const ACollection: IJclCollection<T>);
@@ -589,6 +604,13 @@
Result := FMap.Duplicates;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclIntfHashSet.GetEnumerator: IJclIntfIterator;
+begin
+ Result := FMap.KeySet.First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclIntfHashSet.GetRemoveSingleElement: Boolean;
begin
Result := FMap.RemoveSingleElement;
@@ -885,6 +907,13 @@
Result := FMap.Duplicates;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclAnsiStrHashSet.GetEnumerator: IJclAnsiStrIterator;
+begin
+ Result := FMap.KeySet.First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclAnsiStrHashSet.GetRemoveSingleElement: Boolean;
begin
Result := FMap.RemoveSingleElement;
@@ -1176,7 +1205,6 @@
Result := FMap.KeySet.First;
end;
-
function TJclWideStrHashSet.GetAutoPackParameter: Integer;
begin
Result := (FMap as IJclPackable).GetAutoPackParameter;
@@ -1202,6 +1230,12 @@
Result := FMap.Duplicates;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclWideStrHashSet.GetEnumerator: IJclWideStrIterator;
+begin
+ Result := FMap.KeySet.First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
function TJclWideStrHashSet.GetRemoveSingleElement: Boolean;
begin
@@ -1524,6 +1558,13 @@
Result := FMap.Duplicates;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclHashSet.GetEnumerator: IJclIterator;
+begin
+ Result := FMap.KeySet.First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclHashSet.GetOwnsObjects: Boolean;
begin
Result := (FMap as IJclKeyOwner).GetOwnsKeys;
@@ -1821,6 +1862,13 @@
Result := FMap.Duplicates;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclHashSet<T>.GetEnumerator: IJclIterator<T>;
+begin
+ Result := FMap.KeySet.First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclHashSet<T>.GetOwnsItems: Boolean;
begin
Result := (FMap as IJclPairOwner<T, TRefUnique>).GetOwnsKeys;
Modified: trunk/jcl/source/common/JclLinkedLists.pas
===================================================================
--- trunk/jcl/source/common/JclLinkedLists.pas 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/common/JclLinkedLists.pas 2007-11-13 17:10:17 UTC (rev 2215)
@@ -84,6 +84,9 @@
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIntfIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfList }
function Insert(Index: Integer; const AInterface: IInterface): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclIntfCollection): Boolean;
@@ -131,6 +134,9 @@
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclAnsiStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrList }
function Insert(Index: Integer; const AString: AnsiString): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclAnsiStrCollection): Boolean;
@@ -178,6 +184,9 @@
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclWideStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrList }
function Insert(Index: Integer; const AString: WideString): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclWideStrCollection): Boolean;
@@ -232,6 +241,9 @@
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclList }
function Insert(Index: Integer; AObject: TObject): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclCollection): Boolean;
@@ -280,6 +292,9 @@
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator<T>;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclList<T> }
function Insert(Index: Integer; const AItem: T): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclCollection<T>): Boolean;
@@ -385,6 +400,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(const AInterface: IInterface);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: IInterface read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
public
@@ -515,6 +534,26 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TIntfItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid and (FCursor <> nil) then
+ FCursor := FCursor.Next
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TIntfItr.Next: IInterface;
begin
{$IFDEF THREADSAFE}
@@ -638,6 +677,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: AnsiString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: AnsiString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
public
@@ -768,6 +811,26 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TAnsiStrItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid and (FCursor <> nil) then
+ FCursor := FCursor.Next
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TAnsiStrItr.Next: AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -891,6 +954,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: WideString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: WideString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
public
@@ -1021,6 +1088,26 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TWideStrItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid and (FCursor <> nil) then
+ FCursor := FCursor.Next
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TWideStrItr.Next: WideString;
begin
{$IFDEF THREADSAFE}
@@ -1144,6 +1231,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(AObject: TObject);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: TObject read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
public
@@ -1274,6 +1365,26 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid and (FCursor <> nil) then
+ FCursor := FCursor.Next
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr.Next: TObject;
begin
{$IFDEF THREADSAFE}
@@ -1399,6 +1510,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetItem(const AItem: T);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: T read GetItem;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
public
@@ -1529,6 +1644,26 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr<T>.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid and (FCursor <> nil) then
+ FCursor := FCursor.Next
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr<T>.Next: T;
begin
{$IFDEF THREADSAFE}
@@ -1930,6 +2065,13 @@
Result := TIntfItr.Create(Self, FStart, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclIntfLinkedList.GetEnumerator: IJclIntfIterator;
+begin
+ Result := TIntfItr.Create(Self, FStart, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclIntfLinkedList.GetObject(Index: Integer): IInterface;
var
Current: TJclIntfLinkedListItem;
@@ -2705,6 +2847,13 @@
Result := TAnsiStrItr.Create(Self, FStart, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclAnsiStrLinkedList.GetEnumerator: IJclAnsiStrIterator;
+begin
+ Result := TAnsiStrItr.Create(Self, FStart, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclAnsiStrLinkedList.GetString(Index: Integer): AnsiString;
var
Current: TJclAnsiStrLinkedListItem;
@@ -3480,6 +3629,13 @@
Result := TWideStrItr.Create(Self, FStart, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclWideStrLinkedList.GetEnumerator: IJclWideStrIterator;
+begin
+ Result := TWideStrItr.Create(Self, FStart, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclWideStrLinkedList.GetString(Index: Integer): WideString;
var
Current: TJclWideStrLinkedListItem;
@@ -4255,6 +4411,13 @@
Result := TItr.Create(Self, FStart, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclLinkedList.GetEnumerator: IJclIterator;
+begin
+ Result := TItr.Create(Self, FStart, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclLinkedList.GetObject(Index: Integer): TObject;
var
Current: TJclLinkedListItem;
@@ -5027,6 +5190,13 @@
Result := TItr<T>.Create(Self, FStart, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclLinkedList<T>.GetEnumerator: IJclIterator<T>;
+begin
+ Result := TItr<T>.Create(Self, FStart, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclLinkedList<T>.GetItem(Index: Integer): T;
var
Current: TJclLinkedListItem<T>;
Modified: trunk/jcl/source/common/JclVectors.pas
===================================================================
--- trunk/jcl/source/common/JclVectors.pas 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/common/JclVectors.pas 2007-11-13 17:10:17 UTC (rev 2215)
@@ -83,6 +83,9 @@
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIntfIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfList }
function Insert(Index: Integer; const AInterface: IInterface): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclIntfCollection): Boolean;
@@ -125,6 +128,9 @@
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclAnsiStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclAnsiStrList }
function Insert(Index: Integer; const AString: AnsiString): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclAnsiStrCollection): Boolean;
@@ -167,6 +173,9 @@
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; override;
function Size: Integer; override;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclWideStrIterator; override;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclWideStrList }
function Insert(Index: Integer; const AString: WideString): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclWideStrCollection): Boolean;
@@ -216,6 +225,9 @@
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclList }
function Insert(Index: Integer; AObject: TObject): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclCollection): Boolean;
@@ -260,6 +272,9 @@
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: IJclIterator<T>;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclList<T> }
function Insert(Index: Integer; const AItem: T): Boolean;
function InsertAll(Index: Integer; const ACollection: IJclCollection<T>): Boolean;
@@ -362,6 +377,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(const AInterface: IInterface);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: IInterface read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclIntfList; ACursor: Integer; AValid: Boolean);
end;
@@ -424,6 +443,17 @@
Result := FOwnList.Insert(FCursor, AInterface);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TIntfItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TIntfItr.Next: IInterface;
begin
if Valid then
@@ -497,6 +527,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: AnsiString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: AnsiString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclAnsiStrList; ACursor: Integer; AValid: Boolean);
end;
@@ -559,6 +593,17 @@
Result := FOwnList.Insert(FCursor, AString);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TAnsiStrItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TAnsiStrItr.Next: AnsiString;
begin
if Valid then
@@ -632,6 +677,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetString(const AString: WideString);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: WideString read GetString;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclWideStrList; ACursor: Integer; AValid: Boolean);
end;
@@ -694,6 +743,17 @@
Result := FOwnList.Insert(FCursor, AString);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TWideStrItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TWideStrItr.Next: WideString;
begin
if Valid then
@@ -767,6 +827,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetObject(AObject: TObject);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: TObject read GetObject;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclList; ACursor: Integer; AValid: Boolean);
end;
@@ -829,6 +893,17 @@
Result := FOwnList.Insert(FCursor, AObject);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr.Next: TObject;
begin
if Valid then
@@ -904,6 +979,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SetItem(const AItem: T);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: T read GetItem;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: IJclList<T>; ACursor: Integer; AValid: Boolean);
end;
@@ -966,6 +1045,17 @@
Result := FOwnList.Insert(FCursor, AItem);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TItr<T>.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TItr<T>.Next: T;
begin
if Valid then
@@ -1222,6 +1312,13 @@
Result := TIntfItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclIntfVector.GetEnumerator: IJclIntfIterator;
+begin
+ Result := TIntfItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclIntfVector.GetObject(Index: Integer): IInterface;
begin
{$IFDEF THREADSAFE}
@@ -1716,6 +1813,13 @@
Result := TAnsiStrItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclAnsiStrVector.GetEnumerator: IJclAnsiStrIterator;
+begin
+ Result := TAnsiStrItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclAnsiStrVector.GetString(Index: Integer): AnsiString;
begin
{$IFDEF THREADSAFE}
@@ -2210,6 +2314,13 @@
Result := TWideStrItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclWideStrVector.GetEnumerator: IJclWideStrIterator;
+begin
+ Result := TWideStrItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclWideStrVector.GetString(Index: Integer): WideString;
begin
{$IFDEF THREADSAFE}
@@ -2704,6 +2815,13 @@
Result := TItr.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclVector.GetEnumerator: IJclIterator;
+begin
+ Result := TItr.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclVector.GetObject(Index: Integer): TObject;
begin
{$IFDEF THREADSAFE}
@@ -3195,6 +3313,13 @@
Result := TItr<T>.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function TJclVector<T>.GetEnumerator: IJclIterator<T>;
+begin
+ Result := TItr<T>.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function TJclVector<T>.GetItem(Index: Integer): T;
begin
{$IFDEF THREADSAFE}
Modified: trunk/jcl/source/prototypes/containers/JclArrayLists.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-13 17:10:17 UTC (rev 2215)
@@ -26,6 +26,9 @@
function RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function Size: Integer;COLLECTIONFLAGS
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: ITRINTERFACENAME;COLLECTIONFLAGS
+ {$ENDIF SUPPORTS_FOR_IN}
{ LISTINTERFACENAME }
function Insert(Index: Integer; PARAMETERDECLARATION): Boolean;
function InsertAll(Index: Integer; const ACollection: COLLECTIONINTERFACENAME): Boolean;
@@ -67,6 +70,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SETTERNAME(PARAMETERDECLARATION);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: TYPENAME read GETTERNAME;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const AOwnList: LISTINTERFACENAME; ACursor: Integer; AValid: Boolean);
end;
@@ -129,6 +136,17 @@
Result := FOwnList.Insert(FCursor, PARAMETERNAME);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function SELFCLASSNAME.Next: TYPENAME;
begin
if Valid then
@@ -431,6 +449,13 @@
Result := ITRCLASSNAME.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.GetEnumerator: ITRINTERFACENAME;
+begin
+ Result := ITRCLASSNAME.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function SELFCLASSNAME.GETTERNAME(Index: Integer): TYPENAME;
begin
{$IFDEF THREADSAFE}
Modified: trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2007-11-13 17:10:17 UTC (rev 2215)
@@ -39,6 +39,9 @@
function RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function Size: Integer;COLLECTIONFLAGS
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: ITRINTERFACENAME;COLLECTIONFLAGS
+ {$ENDIF SUPPORTS_FOR_IN}
{ TREEINTERFACENAME }
function GetTraverseOrder: TJclTraverseOrder;
procedure SetTraverseOrder(Value: TJclTraverseOrder);PROTECTEDADDITIONAL
@@ -72,6 +75,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SETTERNAME(PARAMETERDECLARATION);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: PARAMETERTYPE read GETTERNAME;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: COLLECTIONINTERFACENAME; Start: NODETYPENAME; AValid: Boolean);
end;
@@ -162,6 +169,26 @@
raise EJclOperationNotSupportedError.Create;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function BASEITRCLASSNAME.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid then
+ FCursor := GetNextCursor
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function BASEITRCLASSNAME.Next: PARAMETERTYPE;
begin
{$IFDEF THREADSAFE}
@@ -790,6 +817,13 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.GetEnumerator: ITRINTERFACENAME;
+begin
+ Result := First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function SELFCLASSNAME.GetTraverseOrder: TJclTraverseOrder;
begin
Result := FTraverseOrder;
Modified: trunk/jcl/source/prototypes/containers/JclHashSets.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclHashSets.imp 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/prototypes/containers/JclHashSets.imp 2007-11-13 17:10:17 UTC (rev 2215)
@@ -39,6 +39,9 @@
function RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function Size: Integer;COLLECTIONFLAGS
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: ITRINTERFACENAME;COLLECTIONFLAGS
+ {$ENDIF SUPPORTS_FOR_IN}
{ SETINTERFACENAME }
procedure Intersect(const ACollection: COLLECTIONINTERFACENAME);
procedure Subtract(const ACollection: COLLECTIONINTERFACENAME);
@@ -204,6 +207,13 @@
Result := FMap.Duplicates;
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.GetEnumerator: ITRINTERFACENAME;
+begin
+ Result := FMap.KeySet.First;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
{$JPPEXPANDMACRO GETOWNSITEMS}
function SELFCLASSNAME.GetRemoveSingleElement: Boolean;
begin
Modified: trunk/jcl/source/prototypes/containers/JclLinkedLists.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2007-11-13 17:10:17 UTC (rev 2215)
@@ -29,6 +29,9 @@
function RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function Size: Integer;COLLECTIONFLAGS
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: ITRINTERFACENAME;COLLECTIONFLAGS
+ {$ENDIF SUPPORTS_FOR_IN}
{ LISTINTERFACENAME }
function Insert(Index: Integer; PARAMETERDECLARATION): Boolean;
function InsertAll(Index: Integer; const ACollection: COLLECTIONINTERFACENAME): Boolean;
@@ -70,6 +73,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SETTERNAME(PARAMETERDECLARATION);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: DATATYPENAME read GETTERNAME;
+ {$ENDIF SUPPORTS_FOR_IN}
{ IJclIntfCloneable }
function IJclIntfCloneable.Clone = IntfClone;
public
@@ -200,6 +207,26 @@
{$ENDIF THREADSAFE}
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.MoveNext: Boolean;
+begin
+ {$IFDEF THREADSAFE}
+ ReadLock;
+ try
+ {$ENDIF THREADSAFE}
+ if Valid and (FCursor <> nil) then
+ FCursor := FCursor.Next
+ else
+ Valid := True;
+ Result := FCursor <> nil;
+ {$IFDEF THREADSAFE}
+ finally
+ ReadUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function SELFCLASSNAME.Next: DATATYPENAME;
begin
{$IFDEF THREADSAFE}
@@ -595,6 +622,13 @@
Result := ITRCLASSNAME.Create(Self, FStart, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.GetEnumerator: ITRINTERFACENAME;
+begin
+ Result := ITRCLASSNAME.Create(Self, FStart, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function SELFCLASSNAME.GETTERNAME(Index: Integer): DATATYPENAME;
var
Current: ITEMCLASSNAME;
Modified: trunk/jcl/source/prototypes/containers/JclVectors.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-13 13:29:56 UTC (rev 2214)
+++ trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-13 17:10:17 UTC (rev 2215)
@@ -26,6 +26,9 @@
function RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function Size: Integer;COLLECTIONFLAGS
+ {$IFDEF SUPPORTS_FOR_IN}
+ function GetEnumerator: ITRINTERFACENAME;COLLECTIONFLAGS
+ {$ENDIF SUPPORTS_FOR_IN}
{ LISTINTERFACENAME }
function Insert(Index: Integer; PARAMETERDECLARATION): Boolean;
function InsertAll(Index: Integer; const ACollection: COLLECTIONINTERFACENAME): Boolean;
@@ -67,6 +70,10 @@
function PreviousIndex: Integer;
procedure Remove;
procedure SETTERNAME(PARAMETERDECLARATION);
+ {$IFDEF SUPPORTS_FOR_IN}
+ function MoveNext: Boolean;
+ property Current: DATATYPENAME read GETTERNAME;
+ {$ENDIF SUPPORTS_FOR_IN}
public
constructor Create(const OwnList: LISTINTERFACENAME; ACursor: Integer; AValid: Boolean);
end;
@@ -129,6 +136,17 @@
Result := FOwnList.Insert(FCursor, PARAMETERNAME);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.MoveNext: Boolean;
+begin
+ if Valid then
+ Inc(FCursor)
+ else
+ Valid := True;
+ Result := FCursor < FOwnList.Size;
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function SELFCLASSNAME.Next: DATATYPENAME;
begin
if Valid then
@@ -379,6 +397,13 @@
Result := ITRCLASSNAME.Create(Self, 0, False);
end;
+{$IFDEF SUPPORTS_FOR_IN}
+function SELFCLASSNAME.GetEnumerator: ITRINTERFACENAME;
+begin
+ Result := ITRCLASSNAME.Create(Self, 0, False);
+end;
+{$ENDIF SUPPORTS_FOR_IN}
+
function SELFCLASSNAME.GETTERNAME(Index: Integer): DATATYPENAME;
begin
{$IFDEF THREADSAFE}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-13 13:30:04
|
Revision: 2214
http://jcl.svn.sourceforge.net/jcl/?rev=2214&view=rev
Author: outchy
Date: 2007-11-13 05:29:56 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
renaming IJcl*List.Remove to IJcl*List.Delete
Modified Paths:
--------------
trunk/jcl/examples/common/containers/lists/MyObjectList.pas
trunk/jcl/source/common/JclArrayLists.pas
trunk/jcl/source/common/JclContainerIntf.pas
trunk/jcl/source/common/JclLinkedLists.pas
trunk/jcl/source/common/JclVectors.pas
trunk/jcl/source/prototypes/containers/JclArrayLists.imp
trunk/jcl/source/prototypes/containers/JclLinkedLists.imp
trunk/jcl/source/prototypes/containers/JclVectors.imp
Modified: trunk/jcl/examples/common/containers/lists/MyObjectList.pas
===================================================================
--- trunk/jcl/examples/common/containers/lists/MyObjectList.pas 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/examples/common/containers/lists/MyObjectList.pas 2007-11-13 13:29:56 UTC (rev 2214)
@@ -37,7 +37,7 @@
function GetObject(Index: Integer): TMyObject;
function IndexOf(AObject: TMyObject): Integer;
function LastIndexOf(AObject: TMyObject): Integer;
- function Remove(Index: Integer): TMyObject; overload;
+ function Delete(Index: Integer): TMyObject; overload;
procedure SetObject(Index: Integer; AObject: TMyObject);
function SubList(First, Count: Integer): IJclList;
end;
@@ -65,7 +65,7 @@
function GetObject(Index: Integer): TMyObject;
function IndexOf(AObject: TMyObject): Integer;
function LastIndexOf(AObject: TMyObject): Integer;
- function Remove(Index: Integer): TMyObject; overload;
+ function Delete(Index: Integer): TMyObject; overload;
procedure SetObject(Index: Integer; AObject: TMyObject);
function IMyObjectList.SubList = SubList;
end;
@@ -119,9 +119,9 @@
Result := inherited Remove(AObject);
end;
-function TMyObjectList.Remove(Index: Integer): TMyObject;
+function TMyObjectList.Delete(Index: Integer): TMyObject;
begin
- Result := TMyObject(inherited Remove(Index));
+ Result := TMyObject(inherited Delete(Index));
end;
procedure TMyObjectList.SetObject(Index: Integer; AObject: TMyObject);
Modified: trunk/jcl/source/common/JclArrayLists.pas
===================================================================
--- trunk/jcl/source/common/JclArrayLists.pas 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/source/common/JclArrayLists.pas 2007-11-13 13:29:56 UTC (rev 2214)
@@ -76,7 +76,7 @@
function First: IJclIntfIterator;
function IsEmpty: Boolean;
function Last: IJclIntfIterator;
- function Remove(const AInterface: IInterface): Boolean; overload;
+ function Remove(const AInterface: IInterface): Boolean;
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
@@ -86,7 +86,7 @@
function GetObject(Index: Integer): IInterface;
function IndexOf(const AInterface: IInterface): Integer;
function LastIndexOf(const AInterface: IInterface): Integer;
- function Remove(Index: Integer): IInterface; overload;
+ function Delete(Index: Integer): IInterface; overload;
procedure SetObject(Index: Integer; const AInterface: IInterface);
function SubList(First, Count: Integer): IJclIntfList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -118,7 +118,7 @@
function First: IJclAnsiStrIterator; override;
function IsEmpty: Boolean; override;
function Last: IJclAnsiStrIterator; override;
- function Remove(const AString: AnsiString): Boolean; overload; override;
+ function Remove(const AString: AnsiString): Boolean; override;
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function Size: Integer; override;
@@ -128,7 +128,7 @@
function GetString(Index: Integer): AnsiString;
function IndexOf(const AString: AnsiString): Integer;
function LastIndexOf(const AString: AnsiString): Integer;
- function Remove(Index: Integer): AnsiString; overload;
+ function Delete(Index: Integer): AnsiString; overload;
procedure SetString(Index: Integer; const AString: AnsiString);
function SubList(First, Count: Integer): IJclAnsiStrList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -160,7 +160,7 @@
function First: IJclWideStrIterator; override;
function IsEmpty: Boolean; override;
function Last: IJclWideStrIterator; override;
- function Remove(const AString: WideString): Boolean; overload; override;
+ function Remove(const AString: WideString): Boolean; override;
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; override;
function Size: Integer; override;
@@ -170,7 +170,7 @@
function GetString(Index: Integer): WideString;
function IndexOf(const AString: WideString): Integer;
function LastIndexOf(const AString: WideString): Integer;
- function Remove(Index: Integer): WideString; overload;
+ function Delete(Index: Integer): WideString; overload;
procedure SetString(Index: Integer; const AString: WideString);
function SubList(First, Count: Integer): IJclWideStrList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -209,7 +209,7 @@
function First: IJclIterator;
function IsEmpty: Boolean;
function Last: IJclIterator;
- function Remove(AObject: TObject): Boolean; overload;
+ function Remove(AObject: TObject): Boolean;
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
@@ -219,7 +219,7 @@
function GetObject(Index: Integer): TObject;
function IndexOf(AObject: TObject): Integer;
function LastIndexOf(AObject: TObject): Integer;
- function Remove(Index: Integer): TObject; overload;
+ function Delete(Index: Integer): TObject; overload;
procedure SetObject(Index: Integer; AObject: TObject);
function SubList(First, Count: Integer): IJclList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -252,7 +252,7 @@
function First: IJclIterator<T>;
function IsEmpty: Boolean;
function Last: IJclIterator<T>;
- function Remove(const AItem: T): Boolean; overload;
+ function Remove(const AItem: T): Boolean;
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
@@ -262,7 +262,7 @@
function GetItem(Index: Integer): T;
function IndexOf(const AItem: T): Integer;
function LastIndexOf(const AItem: T): Integer;
- function Remove(Index: Integer): T; overload;
+ function Delete(Index: Integer): T; overload;
procedure SetItem(Index: Integer; const AItem: T);
function SubList(First, Count: Integer): IJclList<T>;
public
@@ -464,7 +464,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TIntfItr.SetObject(const AInterface: IInterface);
@@ -598,7 +598,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TAnsiStrItr.SetString(const AString: AnsiString);
@@ -732,7 +732,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TWideStrItr.SetString(const AString: WideString);
@@ -866,7 +866,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TItr.SetObject(AObject: TObject);
@@ -1002,7 +1002,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TItr<T>.SetItem(const AItem: T);
@@ -1220,6 +1220,26 @@
AssignPropertiesTo(Result);
end;
+function TJclIntfArrayList.Delete(Index: Integer): IInterface;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeObject(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclIntfArrayList.Equals(const ACollection: IJclIntfCollection): Boolean;
var
I: Integer;
@@ -1419,26 +1439,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclIntfArrayList.Remove(Index: Integer): IInterface;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclIntfArrayList.RemoveAll(const ACollection: IJclIntfCollection): Boolean;
var
It: IJclIntfIterator;
@@ -1475,7 +1475,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(FElementData[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -1531,7 +1531,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -1774,6 +1774,26 @@
AssignPropertiesTo(Result);
end;
+function TJclAnsiStrArrayList.Delete(Index: Integer): AnsiString;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeString(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclAnsiStrArrayList.Equals(const ACollection: IJclAnsiStrCollection): Boolean;
var
I: Integer;
@@ -1973,26 +1993,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclAnsiStrArrayList.Remove(Index: Integer): AnsiString;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeString(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclAnsiStrArrayList.RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean;
var
It: IJclAnsiStrIterator;
@@ -2029,7 +2029,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(FElementData[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2085,7 +2085,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2328,6 +2328,26 @@
AssignPropertiesTo(Result);
end;
+function TJclWideStrArrayList.Delete(Index: Integer): WideString;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeString(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclWideStrArrayList.Equals(const ACollection: IJclWideStrCollection): Boolean;
var
I: Integer;
@@ -2527,26 +2547,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclWideStrArrayList.Remove(Index: Integer): WideString;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeString(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclWideStrArrayList.RemoveAll(const ACollection: IJclWideStrCollection): Boolean;
var
It: IJclWideStrIterator;
@@ -2583,7 +2583,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(FElementData[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2639,7 +2639,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2882,6 +2882,26 @@
AssignPropertiesTo(Result);
end;
+function TJclArrayList.Delete(Index: Integer): TObject;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeObject(FElementData[Index]);
+ if Index < (FSize - 1) then
+ JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclArrayList.Equals(const ACollection: IJclCollection): Boolean;
var
I: Integer;
@@ -3081,26 +3101,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclArrayList.Remove(Index: Integer): TObject;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FElementData[Index]);
- if Index < (FSize - 1) then
- JclBase.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclArrayList.RemoveAll(const ACollection: IJclCollection): Boolean;
var
It: IJclIterator;
@@ -3137,7 +3137,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(FElementData[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3193,7 +3193,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3432,6 +3432,26 @@
end;
+function TJclArrayList<T>.Delete(Index: Integer): T;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeItem(FElementData[Index]);
+ if Index < (FSize - 1) then
+ TJclBase<T>.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclArrayList<T>.Equals(const ACollection: IJclCollection<T>): Boolean;
var
I: Integer;
@@ -3631,26 +3651,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclArrayList<T>.Remove(Index: Integer): T;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeItem(FElementData[Index]);
- if Index < (FSize - 1) then
- TJclBase<T>.MoveArray(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclArrayList<T>.RemoveAll(const ACollection: IJclCollection<T>): Boolean;
var
It: IJclIterator<T>;
@@ -3687,7 +3687,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(FElementData[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3743,7 +3743,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/common/JclContainerIntf.pas
===================================================================
--- trunk/jcl/source/common/JclContainerIntf.pas 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/source/common/JclContainerIntf.pas 2007-11-13 13:29:56 UTC (rev 2214)
@@ -515,7 +515,7 @@
function GetObject(Index: Integer): IInterface;
function IndexOf(const AInterface: IInterface): Integer;
function LastIndexOf(const AInterface: IInterface): Integer;
- function Remove(Index: Integer): IInterface; overload;
+ function Delete(Index: Integer): IInterface;
procedure SetObject(Index: Integer; const AInterface: IInterface);
function SubList(First, Count: Integer): IJclIntfList;
@@ -529,7 +529,7 @@
function GetString(Index: Integer): AnsiString;
function IndexOf(const AString: AnsiString): Integer;
function LastIndexOf(const AString: AnsiString): Integer;
- function Remove(Index: Integer): AnsiString; overload;
+ function Delete(Index: Integer): AnsiString;
procedure SetString(Index: Integer; const AString: AnsiString);
function SubList(First, Count: Integer): IJclAnsiStrList;
//Daniele Teti
@@ -543,7 +543,7 @@
function GetString(Index: Integer): WideString;
function IndexOf(const AString: WideString): Integer;
function LastIndexOf(const AString: WideString): Integer;
- function Remove(Index: Integer): WideString; overload;
+ function Delete(Index: Integer): WideString;
procedure SetString(Index: Integer; const AString: WideString);
function SubList(First, Count: Integer): IJclWideStrList;
//Daniele Teti
@@ -564,7 +564,7 @@
function GetObject(Index: Integer): TObject;
function IndexOf(AObject: TObject): Integer;
function LastIndexOf(AObject: TObject): Integer;
- function Remove(Index: Integer): TObject; overload;
+ function Delete(Index: Integer): TObject;
procedure SetObject(Index: Integer; AObject: TObject);
function SubList(First, Count: Integer): IJclList;
//Daniele Teti
@@ -579,7 +579,7 @@
function GetItem(Index: Integer): T;
function IndexOf(const AItem: T): Integer;
function LastIndexOf(const AItem: T): Integer;
- function Remove(Index: Integer): T; overload;
+ function Delete(Index: Integer): T;
procedure SetItem(Index: Integer; const AItem: T);
function SubList(First, Count: Integer): IJclList<T>;
//Daniele Teti
Modified: trunk/jcl/source/common/JclLinkedLists.pas
===================================================================
--- trunk/jcl/source/common/JclLinkedLists.pas 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/source/common/JclLinkedLists.pas 2007-11-13 13:29:56 UTC (rev 2214)
@@ -80,7 +80,7 @@
function First: IJclIntfIterator;
function IsEmpty: Boolean;
function Last: IJclIntfIterator;
- function Remove(const AInterface: IInterface): Boolean; overload;
+ function Remove(const AInterface: IInterface): Boolean;
function RemoveAll(const ACollection: IJclIntfCollection): Boolean;
function RetainAll(const ACollection: IJclIntfCollection): Boolean;
function Size: Integer;
@@ -90,7 +90,7 @@
function GetObject(Index: Integer): IInterface;
function IndexOf(const AInterface: IInterface): Integer;
function LastIndexOf(const AInterface: IInterface): Integer;
- function Remove(Index: Integer): IInterface; overload;
+ function Delete(Index: Integer): IInterface; overload;
procedure SetObject(Index: Integer; const AInterface: IInterface);
function SubList(First, Count: Integer): IJclIntfList;
{ IJclIntfCloneable }
@@ -127,7 +127,7 @@
function First: IJclAnsiStrIterator; override;
function IsEmpty: Boolean; override;
function Last: IJclAnsiStrIterator; override;
- function Remove(const AString: AnsiString): Boolean; overload; override;
+ function Remove(const AString: AnsiString): Boolean; override;
function RemoveAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclAnsiStrCollection): Boolean; override;
function Size: Integer; override;
@@ -137,7 +137,7 @@
function GetString(Index: Integer): AnsiString;
function IndexOf(const AString: AnsiString): Integer;
function LastIndexOf(const AString: AnsiString): Integer;
- function Remove(Index: Integer): AnsiString; overload;
+ function Delete(Index: Integer): AnsiString; overload;
procedure SetString(Index: Integer; const AString: AnsiString);
function SubList(First, Count: Integer): IJclAnsiStrList;
{ IJclIntfCloneable }
@@ -174,7 +174,7 @@
function First: IJclWideStrIterator; override;
function IsEmpty: Boolean; override;
function Last: IJclWideStrIterator; override;
- function Remove(const AString: WideString): Boolean; overload; override;
+ function Remove(const AString: WideString): Boolean; override;
function RemoveAll(const ACollection: IJclWideStrCollection): Boolean; override;
function RetainAll(const ACollection: IJclWideStrCollection): Boolean; override;
function Size: Integer; override;
@@ -184,7 +184,7 @@
function GetString(Index: Integer): WideString;
function IndexOf(const AString: WideString): Integer;
function LastIndexOf(const AString: WideString): Integer;
- function Remove(Index: Integer): WideString; overload;
+ function Delete(Index: Integer): WideString; overload;
procedure SetString(Index: Integer; const AString: WideString);
function SubList(First, Count: Integer): IJclWideStrList;
{ IJclIntfCloneable }
@@ -228,7 +228,7 @@
function First: IJclIterator;
function IsEmpty: Boolean;
function Last: IJclIterator;
- function Remove(AObject: TObject): Boolean; overload;
+ function Remove(AObject: TObject): Boolean;
function RemoveAll(const ACollection: IJclCollection): Boolean;
function RetainAll(const ACollection: IJclCollection): Boolean;
function Size: Integer;
@@ -238,7 +238,7 @@
function GetObject(Index: Integer): TObject;
function IndexOf(AObject: TObject): Integer;
function LastIndexOf(AObject: TObject): Integer;
- function Remove(Index: Integer): TObject; overload;
+ function Delete(Index: Integer): TObject; overload;
procedure SetObject(Index: Integer; AObject: TObject);
function SubList(First, Count: Integer): IJclList;
{ IJclIntfCloneable }
@@ -276,7 +276,7 @@
function First: IJclIterator<T>;
function IsEmpty: Boolean;
function Last: IJclIterator<T>;
- function Remove(const AItem: T): Boolean; overload;
+ function Remove(const AItem: T): Boolean;
function RemoveAll(const ACollection: IJclCollection<T>): Boolean;
function RetainAll(const ACollection: IJclCollection<T>): Boolean;
function Size: Integer;
@@ -286,7 +286,7 @@
function GetItem(Index: Integer): T;
function IndexOf(const AItem: T): Integer;
function LastIndexOf(const AItem: T): Integer;
- function Remove(Index: Integer): T; overload;
+ function Delete(Index: Integer): T; overload;
procedure SetItem(Index: Integer; const AItem: T);
function SubList(First, Count: Integer): IJclList<T>;
{ IJclIntfCloneable }
@@ -1854,6 +1854,48 @@
AssignPropertiesTo(Result);
end;
+function TJclIntfLinkedList.Delete(Index: Integer): IInterface;
+var
+ Current: TJclIntfLinkedListItem;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Current := FStart;
+ while Current <> nil do
+ begin
+ if Index = 0 then
+ begin
+ if Current.Previous <> nil then
+ Current.Previous.Next := Current.Next
+ else
+ FStart := Current.Next;
+ if Current.Next <> nil then
+ Current.Next.Previous := Current.Previous
+ else
+ FEnd := Current.Previous;
+ Result := FreeObject(Current.Value);
+ Current.Free;
+ Dec(FSize);
+ Break;
+ end;
+ Dec(Index);
+ Current := Current.Next;
+ end;
+ end
+ else
+ raise EJclOutOfBoundsError.Create;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclIntfLinkedList.Equals(const ACollection: IJclIntfCollection): Boolean;
var
It, ItSelf: IJclIntfIterator;
@@ -2197,48 +2239,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclIntfLinkedList.Remove(Index: Integer): IInterface;
-var
- Current: TJclIntfLinkedListItem;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- Result := nil;
- if (Index >= 0) and (Index < FSize) then
- begin
- Current := FStart;
- while Current <> nil do
- begin
- if Index = 0 then
- begin
- if Current.Previous <> nil then
- Current.Previous.Next := Current.Next
- else
- FStart := Current.Next;
- if Current.Next <> nil then
- Current.Next.Previous := Current.Previous
- else
- FEnd := Current.Previous;
- Result := FreeObject(Current.Value);
- Current.Free;
- Dec(FSize);
- Break;
- end;
- Dec(Index);
- Current := Current.Next;
- end;
- end
- else
- raise EJclOutOfBoundsError.Create;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclIntfLinkedList.Remove(const AInterface: IInterface): Boolean;
var
Current: TJclIntfLinkedListItem;
@@ -2363,7 +2363,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2629,6 +2629,48 @@
AssignPropertiesTo(Result);
end;
+function TJclAnsiStrLinkedList.Delete(Index: Integer): AnsiString;
+var
+ Current: TJclAnsiStrLinkedListItem;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Current := FStart;
+ while Current <> nil do
+ begin
+ if Index = 0 then
+ begin
+ if Current.Previous <> nil then
+ Current.Previous.Next := Current.Next
+ else
+ FStart := Current.Next;
+ if Current.Next <> nil then
+ Current.Next.Previous := Current.Previous
+ else
+ FEnd := Current.Previous;
+ Result := FreeString(Current.Value);
+ Current.Free;
+ Dec(FSize);
+ Break;
+ end;
+ Dec(Index);
+ Current := Current.Next;
+ end;
+ end
+ else
+ raise EJclOutOfBoundsError.Create;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclAnsiStrLinkedList.Equals(const ACollection: IJclAnsiStrCollection): Boolean;
var
It, ItSelf: IJclAnsiStrIterator;
@@ -2972,48 +3014,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclAnsiStrLinkedList.Remove(Index: Integer): AnsiString;
-var
- Current: TJclAnsiStrLinkedListItem;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- Result := '';
- if (Index >= 0) and (Index < FSize) then
- begin
- Current := FStart;
- while Current <> nil do
- begin
- if Index = 0 then
- begin
- if Current.Previous <> nil then
- Current.Previous.Next := Current.Next
- else
- FStart := Current.Next;
- if Current.Next <> nil then
- Current.Next.Previous := Current.Previous
- else
- FEnd := Current.Previous;
- Result := FreeString(Current.Value);
- Current.Free;
- Dec(FSize);
- Break;
- end;
- Dec(Index);
- Current := Current.Next;
- end;
- end
- else
- raise EJclOutOfBoundsError.Create;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclAnsiStrLinkedList.Remove(const AString: AnsiString): Boolean;
var
Current: TJclAnsiStrLinkedListItem;
@@ -3138,7 +3138,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3404,6 +3404,48 @@
AssignPropertiesTo(Result);
end;
+function TJclWideStrLinkedList.Delete(Index: Integer): WideString;
+var
+ Current: TJclWideStrLinkedListItem;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := '';
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Current := FStart;
+ while Current <> nil do
+ begin
+ if Index = 0 then
+ begin
+ if Current.Previous <> nil then
+ Current.Previous.Next := Current.Next
+ else
+ FStart := Current.Next;
+ if Current.Next <> nil then
+ Current.Next.Previous := Current.Previous
+ else
+ FEnd := Current.Previous;
+ Result := FreeString(Current.Value);
+ Current.Free;
+ Dec(FSize);
+ Break;
+ end;
+ Dec(Index);
+ Current := Current.Next;
+ end;
+ end
+ else
+ raise EJclOutOfBoundsError.Create;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclWideStrLinkedList.Equals(const ACollection: IJclWideStrCollection): Boolean;
var
It, ItSelf: IJclWideStrIterator;
@@ -3747,48 +3789,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclWideStrLinkedList.Remove(Index: Integer): WideString;
-var
- Current: TJclWideStrLinkedListItem;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- Result := '';
- if (Index >= 0) and (Index < FSize) then
- begin
- Current := FStart;
- while Current <> nil do
- begin
- if Index = 0 then
- begin
- if Current.Previous <> nil then
- Current.Previous.Next := Current.Next
- else
- FStart := Current.Next;
- if Current.Next <> nil then
- Current.Next.Previous := Current.Previous
- else
- FEnd := Current.Previous;
- Result := FreeString(Current.Value);
- Current.Free;
- Dec(FSize);
- Break;
- end;
- Dec(Index);
- Current := Current.Next;
- end;
- end
- else
- raise EJclOutOfBoundsError.Create;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclWideStrLinkedList.Remove(const AString: WideString): Boolean;
var
Current: TJclWideStrLinkedListItem;
@@ -3913,7 +3913,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -4179,6 +4179,48 @@
AssignPropertiesTo(Result);
end;
+function TJclLinkedList.Delete(Index: Integer): TObject;
+var
+ Current: TJclLinkedListItem;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := nil;
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Current := FStart;
+ while Current <> nil do
+ begin
+ if Index = 0 then
+ begin
+ if Current.Previous <> nil then
+ Current.Previous.Next := Current.Next
+ else
+ FStart := Current.Next;
+ if Current.Next <> nil then
+ Current.Next.Previous := Current.Previous
+ else
+ FEnd := Current.Previous;
+ Result := FreeObject(Current.Value);
+ Current.Free;
+ Dec(FSize);
+ Break;
+ end;
+ Dec(Index);
+ Current := Current.Next;
+ end;
+ end
+ else
+ raise EJclOutOfBoundsError.Create;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclLinkedList.Equals(const ACollection: IJclCollection): Boolean;
var
It, ItSelf: IJclIterator;
@@ -4522,48 +4564,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclLinkedList.Remove(Index: Integer): TObject;
-var
- Current: TJclLinkedListItem;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- Result := nil;
- if (Index >= 0) and (Index < FSize) then
- begin
- Current := FStart;
- while Current <> nil do
- begin
- if Index = 0 then
- begin
- if Current.Previous <> nil then
- Current.Previous.Next := Current.Next
- else
- FStart := Current.Next;
- if Current.Next <> nil then
- Current.Next.Previous := Current.Previous
- else
- FEnd := Current.Previous;
- Result := FreeObject(Current.Value);
- Current.Free;
- Dec(FSize);
- Break;
- end;
- Dec(Index);
- Current := Current.Next;
- end;
- end
- else
- raise EJclOutOfBoundsError.Create;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclLinkedList.Remove(AObject: TObject): Boolean;
var
Current: TJclLinkedListItem;
@@ -4688,7 +4688,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -4951,6 +4951,48 @@
end;
+function TJclLinkedList<T>.Delete(Index: Integer): T;
+var
+ Current: TJclLinkedListItem<T>;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := Default(T);
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Current := FStart;
+ while Current <> nil do
+ begin
+ if Index = 0 then
+ begin
+ if Current.Previous <> nil then
+ Current.Previous.Next := Current.Next
+ else
+ FStart := Current.Next;
+ if Current.Next <> nil then
+ Current.Next.Previous := Current.Previous
+ else
+ FEnd := Current.Previous;
+ Result := FreeItem(Current.Value);
+ Current.Free;
+ Dec(FSize);
+ Break;
+ end;
+ Dec(Index);
+ Current := Current.Next;
+ end;
+ end
+ else
+ raise EJclOutOfBoundsError.Create;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclLinkedList<T>.Equals(const ACollection: IJclCollection<T>): Boolean;
var
It, ItSelf: IJclIterator<T>;
@@ -5294,48 +5336,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclLinkedList<T>.Remove(Index: Integer): T;
-var
- Current: TJclLinkedListItem<T>;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- Result := Default(T);
- if (Index >= 0) and (Index < FSize) then
- begin
- Current := FStart;
- while Current <> nil do
- begin
- if Index = 0 then
- begin
- if Current.Previous <> nil then
- Current.Previous.Next := Current.Next
- else
- FStart := Current.Next;
- if Current.Next <> nil then
- Current.Next.Previous := Current.Previous
- else
- FEnd := Current.Previous;
- Result := FreeItem(Current.Value);
- Current.Free;
- Dec(FSize);
- Break;
- end;
- Dec(Index);
- Current := Current.Next;
- end;
- end
- else
- raise EJclOutOfBoundsError.Create;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclLinkedList<T>.Remove(const AItem: T): Boolean;
var
Current: TJclLinkedListItem<T>;
@@ -5460,7 +5460,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/common/JclVectors.pas
===================================================================
--- trunk/jcl/source/common/JclVectors.pas 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/source/common/JclVectors.pas 2007-11-13 13:29:56 UTC (rev 2214)
@@ -89,7 +89,7 @@
function GetObject(Index: Integer): IInterface;
function IndexOf(const AInterface: IInterface): Integer;
function LastIndexOf(const AInterface: IInterface): Integer;
- function Remove(Index: Integer): IInterface; overload;
+ function Delete(Index: Integer): IInterface; overload;
procedure SetObject(Index: Integer; const AInterface: IInterface);
function SubList(First, Count: Integer): IJclIntfList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -131,7 +131,7 @@
function GetString(Index: Integer): AnsiString;
function IndexOf(const AString: AnsiString): Integer;
function LastIndexOf(const AString: AnsiString): Integer;
- function Remove(Index: Integer): AnsiString; overload;
+ function Delete(Index: Integer): AnsiString; overload;
procedure SetString(Index: Integer; const AString: AnsiString);
function SubList(First, Count: Integer): IJclAnsiStrList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -173,7 +173,7 @@
function GetString(Index: Integer): WideString;
function IndexOf(const AString: WideString): Integer;
function LastIndexOf(const AString: WideString): Integer;
- function Remove(Index: Integer): WideString; overload;
+ function Delete(Index: Integer): WideString; overload;
procedure SetString(Index: Integer; const AString: WideString);
function SubList(First, Count: Integer): IJclWideStrList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -222,7 +222,7 @@
function GetObject(Index: Integer): TObject;
function IndexOf(AObject: TObject): Integer;
function LastIndexOf(AObject: TObject): Integer;
- function Remove(Index: Integer): TObject; overload;
+ function Delete(Index: Integer): TObject; overload;
procedure SetObject(Index: Integer; AObject: TObject);
function SubList(First, Count: Integer): IJclList;
function CreateEmptyContainer: TJclAbstractContainerBase; override;
@@ -266,7 +266,7 @@
function GetItem(Index: Integer): T;
function IndexOf(const AItem: T): Integer;
function LastIndexOf(const AItem: T): Integer;
- function Remove(Index: Integer): T; overload;
+ function Delete(Index: Integer): T; overload;
procedure SetItem(Index: Integer; const AItem: T);
function SubList(First, Count: Integer): IJclList<T>;
public
@@ -462,7 +462,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TIntfItr.SetObject(const AInterface: IInterface);
@@ -597,7 +597,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TAnsiStrItr.SetString(const AString: AnsiString);
@@ -732,7 +732,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TWideStrItr.SetString(const AString: WideString);
@@ -867,7 +867,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TItr.SetObject(AObject: TObject);
@@ -1004,7 +1004,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure TItr<T>.SetItem(const AItem: T);
@@ -1169,6 +1169,25 @@
AssignPropertiesTo(Result);
end;
+function TJclIntfVector.Delete(Index: Integer): IInterface;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeObject(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclIntfVector.Equals(const ACollection: IJclIntfCollection): Boolean;
var
I: Integer;
@@ -1340,25 +1359,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclIntfVector.Remove(Index: Integer): IInterface;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclIntfVector.Remove(const AInterface: IInterface): Boolean;
var
I: Integer;
@@ -1421,7 +1421,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(Items[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -1474,7 +1474,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -1663,6 +1663,25 @@
AssignPropertiesTo(Result);
end;
+function TJclAnsiStrVector.Delete(Index: Integer): AnsiString;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeString(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclAnsiStrVector.Equals(const ACollection: IJclAnsiStrCollection): Boolean;
var
I: Integer;
@@ -1834,25 +1853,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclAnsiStrVector.Remove(Index: Integer): AnsiString;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeString(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclAnsiStrVector.Remove(const AString: AnsiString): Boolean;
var
I: Integer;
@@ -1915,7 +1915,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(Items[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -1968,7 +1968,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2157,6 +2157,25 @@
AssignPropertiesTo(Result);
end;
+function TJclWideStrVector.Delete(Index: Integer): WideString;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeString(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclWideStrVector.Equals(const ACollection: IJclWideStrCollection): Boolean;
var
I: Integer;
@@ -2328,25 +2347,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclWideStrVector.Remove(Index: Integer): WideString;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeString(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclWideStrVector.Remove(const AString: WideString): Boolean;
var
I: Integer;
@@ -2409,7 +2409,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(Items[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2462,7 +2462,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2651,6 +2651,25 @@
AssignPropertiesTo(Result);
end;
+function TJclVector.Delete(Index: Integer): TObject;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeObject(FItems[Index]);
+ JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclVector.Equals(const ACollection: IJclCollection): Boolean;
var
I: Integer;
@@ -2822,25 +2841,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclVector.Remove(Index: Integer): TObject;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeObject(FItems[Index]);
- JclBase.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclVector.Remove(AObject: TObject): Boolean;
var
I: Integer;
@@ -2903,7 +2903,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(Items[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -2956,7 +2956,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3142,6 +3142,25 @@
end;
+function TJclVector<T>.Delete(Index: Integer): T;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := FreeItem(FItems[Index]);
+ TJclBase<T>.MoveArray(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function TJclVector<T>.Equals(const ACollection: IJclCollection<T>): Boolean;
var
I: Integer;
@@ -3313,25 +3332,6 @@
{$ENDIF THREADSAFE}
end;
-function TJclVector<T>.Remove(Index: Integer): T;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := FreeItem(FItems[Index]);
- TJclBase<T>.MoveArray(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function TJclVector<T>.Remove(const AItem: T): Boolean;
var
I: Integer;
@@ -3394,7 +3394,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(Items[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -3447,7 +3447,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/prototypes/containers/JclArrayLists.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2007-11-13 13:29:56 UTC (rev 2214)
@@ -22,7 +22,7 @@
function First: ITRINTERFACENAME;COLLECTIONFLAGS
function IsEmpty: Boolean;COLLECTIONFLAGS
function Last: ITRINTERFACENAME;COLLECTIONFLAGS
- function Remove(PARAMETERDECLARATION): Boolean; overload;COLLECTIONFLAGS
+ function Remove(PARAMETERDECLARATION): Boolean;COLLECTIONFLAGS
function RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function Size: Integer;COLLECTIONFLAGS
@@ -32,7 +32,7 @@
function GETTERNAME(Index: Integer): TYPENAME;
function IndexOf(PARAMETERDECLARATION): Integer;
function LastIndexOf(PARAMETERDECLARATION): Integer;
- function Remove(Index: Integer): TYPENAME; overload;
+ function Delete(Index: Integer): TYPENAME; overload;
procedure SETTERNAME(Index: Integer; PARAMETERDECLARATION);
function SubList(First, Count: Integer): LISTINTERFACENAME;PROTECTEDADDITIONAL
public
@@ -167,7 +167,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure SELFCLASSNAME.SETTERNAME(PARAMETERDECLARATION);
@@ -380,6 +380,26 @@
end;
{$JPPEXPANDMACRO CREATEEMPTYCONTAINER}
+function SELFCLASSNAME.Delete(Index: Integer): TYPENAME;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := RELEASERNAME(FElementData[Index]);
+ if Index < (FSize - 1) then
+ MOVEARRAY(FElementData, Index + 1, Index, FSize - Index - 1);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function SELFCLASSNAME.Equals(const ACollection: COLLECTIONINTERFACENAME): Boolean;
var
I: Integer;
@@ -579,26 +599,6 @@
{$ENDIF THREADSAFE}
end;
-function SELFCLASSNAME.Remove(Index: Integer): TYPENAME;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := RELEASERNAME(FElementData[Index]);
- if Index < (FSize - 1) then
- MOVEARRAY(FElementData, Index + 1, Index, FSize - Index - 1);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function SELFCLASSNAME.RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;
var
It: ITRINTERFACENAME;
@@ -635,7 +635,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(FElementData[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -691,7 +691,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/prototypes/containers/JclLinkedLists.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2007-11-13 13:29:56 UTC (rev 2214)
@@ -25,7 +25,7 @@
function First: ITRINTERFACENAME;COLLECTIONFLAGS
function IsEmpty: Boolean;COLLECTIONFLAGS
function Last: ITRINTERFACENAME;COLLECTIONFLAGS
- function Remove(PARAMETERDECLARATION): Boolean; overload;COLLECTIONFLAGS
+ function Remove(PARAMETERDECLARATION): Boolean;COLLECTIONFLAGS
function RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean;COLLECTIONFLAGS
function Size: Integer;COLLECTIONFLAGS
@@ -35,7 +35,7 @@
function GETTERNAME(Index: Integer): DATATYPENAME;
function IndexOf(PARAMETERDECLARATION): Integer;
function LastIndexOf(PARAMETERDECLARATION): Integer;
- function Remove(Index: Integer): DATATYPENAME; overload;
+ function Delete(Index: Integer): DATATYPENAME; overload;
procedure SETTERNAME(Index: Integer; PARAMETERDECLARATION);
function SubList(First, Count: Integer): LISTINTERFACENAME;
{ IJclIntfCloneable }
@@ -519,6 +519,48 @@
end;
{$JPPEXPANDMACRO CREATEEMPTYCONTAINER}
+function SELFCLASSNAME.Delete(Index: Integer): DATATYPENAME;
+var
+ Current: ITEMCLASSNAME;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ Result := DEFAULTVALUE;
+ if (Index >= 0) and (Index < FSize) then
+ begin
+ Current := FStart;
+ while Current <> nil do
+ begin
+ if Index = 0 then
+ begin
+ if Current.Previous <> nil then
+ Current.Previous.Next := Current.Next
+ else
+ FStart := Current.Next;
+ if Current.Next <> nil then
+ Current.Next.Previous := Current.Previous
+ else
+ FEnd := Current.Previous;
+ Result := RELEASERNAME(Current.Value);
+ Current.Free;
+ Dec(FSize);
+ Break;
+ end;
+ Dec(Index);
+ Current := Current.Next;
+ end;
+ end
+ else
+ raise EJclOutOfBoundsError.Create;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function SELFCLASSNAME.Equals(const ACollection: COLLECTIONINTERFACENAME): Boolean;
var
It, ItSelf: ITRINTERFACENAME;
@@ -862,48 +904,6 @@
{$ENDIF THREADSAFE}
end;
-function SELFCLASSNAME.Remove(Index: Integer): DATATYPENAME;
-var
- Current: ITEMCLASSNAME;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- Result := DEFAULTVALUE;
- if (Index >= 0) and (Index < FSize) then
- begin
- Current := FStart;
- while Current <> nil do
- begin
- if Index = 0 then
- begin
- if Current.Previous <> nil then
- Current.Previous.Next := Current.Next
- else
- FStart := Current.Next;
- if Current.Next <> nil then
- Current.Next.Previous := Current.Previous
- else
- FEnd := Current.Previous;
- Result := RELEASERNAME(Current.Value);
- Current.Free;
- Dec(FSize);
- Break;
- end;
- Dec(Index);
- Current := Current.Next;
- end;
- end
- else
- raise EJclOutOfBoundsError.Create;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function SELFCLASSNAME.Remove(PARAMETERDECLARATION): Boolean;
var
Current: ITEMCLASSNAME;
@@ -1028,7 +1028,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
Modified: trunk/jcl/source/prototypes/containers/JclVectors.imp
===================================================================
--- trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-13 13:17:59 UTC (rev 2213)
+++ trunk/jcl/source/prototypes/containers/JclVectors.imp 2007-11-13 13:29:56 UTC (rev 2214)
@@ -32,7 +32,7 @@
function GETTERNAME(Index: Integer): DATATYPENAME;
function IndexOf(PARAMETERDECLARATION): Integer;
function LastIndexOf(PARAMETERDECLARATION): Integer;
- function Remove(Index: Integer): DATATYPENAME; overload;
+ function Delete(Index: Integer): DATATYPENAME; overload;
procedure SETTERNAME(Index: Integer; PARAMETERDECLARATION);
function SubList(First, Count: Integer): LISTINTERFACENAME;PROTECTEDADDITIONAL
public
@@ -167,7 +167,7 @@
begin
CheckValid;
Valid := False;
- FOwnList.Remove(FCursor);
+ FOwnList.Delete(FCursor);
end;
procedure SELFCLASSNAME.SETTERNAME(PARAMETERDECLARATION);
@@ -326,6 +326,25 @@
end;
{$JPPEXPANDMACRO CREATEEMPTYCONTAINER}
+function SELFCLASSNAME.Delete(Index: Integer): DATATYPENAME;
+begin
+ {$IFDEF THREADSAFE}
+ WriteLock;
+ try
+ {$ENDIF THREADSAFE}
+ if (Index < 0) or (Index >= FSize) then
+ raise EJclOutOfBoundsError.Create;
+ Result := RELEASERNAME(FItems[Index]);
+ MOVEARRAY(FItems, Index + 1, Index, FSize - Index);
+ Dec(FSize);
+ AutoPack;
+ {$IFDEF THREADSAFE}
+ finally
+ WriteUnlock;
+ end;
+ {$ENDIF THREADSAFE}
+end;
+
function SELFCLASSNAME.Equals(const ACollection: COLLECTIONINTERFACENAME): Boolean;
var
I: Integer;
@@ -497,25 +516,6 @@
{$ENDIF THREADSAFE}
end;
-function SELFCLASSNAME.Remove(Index: Integer): DATATYPENAME;
-begin
- {$IFDEF THREADSAFE}
- WriteLock;
- try
- {$ENDIF THREADSAFE}
- if (Index < 0) or (Index >= FSize) then
- raise EJclOutOfBoundsError.Create;
- Result := RELEASERNAME(FItems[Index]);
- MOVEARRAY(FItems, Index + 1, Index, FSize - Index);
- Dec(FSize);
- AutoPack;
- {$IFDEF THREADSAFE}
- finally
- WriteUnlock;
- end;
- {$ENDIF THREADSAFE}
-end;
-
function SELFCLASSNAME.Remove(PARAMETERDECLARATION): Boolean;
var
I: Integer;
@@ -578,7 +578,7 @@
Result := True;
for I := FSize - 1 downto 0 do
if not ACollection.Contains(Items[I]) then
- Remove(I);
+ Delete(I);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
@@ -631,7 +631,7 @@
end;
end;
if not ReplaceItem then
- Remove(Index);
+ Delete(Index);
{$IFDEF THREADSAFE}
finally
WriteUnlock;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ou...@us...> - 2007-11-13 13:18:01
|
Revision: 2213
http://jcl.svn.sourceforge.net/jcl/?rev=2213&view=rev
Author: outchy
Date: 2007-11-13 05:17:59 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
mantis 4292 some errors and warnings while compiling examples (side effect of rev 2207)
Revision Links:
--------------
http://jcl.svn.sourceforge.net/jcl/?rev=2207&view=rev
Modified Paths:
--------------
trunk/jcl/experts/debug/dialog/ExceptDlg.Delphi32.pas
trunk/jcl/experts/debug/dialog/ExceptDlg.pas
trunk/jcl/experts/debug/dialog/ExceptDlgMail.pas
Modified: trunk/jcl/experts/debug/dialog/ExceptDlg.Delphi32.pas
===================================================================
--- trunk/jcl/experts/debug/dialog/ExceptDlg.Delphi32.pas 2007-11-11 15:50:03 UTC (rev 2212)
+++ trunk/jcl/experts/debug/dialog/ExceptDlg.Delphi32.pas 2007-11-13 13:17:59 UTC (rev 2213)
@@ -355,27 +355,36 @@
DetailsMemo.Lines.Add(Format(RsOSVersion, [GetWindowsVersionString, NtProductTypeString,
Win32MajorVersion, Win32MinorVersion, Win32BuildNumber, Win32CSDVersion]));
GetCpuInfo(CpuInfo);
- with CpuInfo do
- begin
- ProcessorDetails := Format(RsProcessor, [Manufacturer, CpuName,
- RoundFrequency(FrequencyInfo.NormFreq)]);
- if not IsFDIVOK then
- ProcessorDetails := ProcessorDetails + ' [FDIV Bug]';
- if ExMMX then
- ProcessorDetails := ProcessorDetails + ' MMXex'
- else if MMX then
- ProcessorDetails := ProcessorDetails + ' MMX';
- if SSE > 0 then
- ProcessorDetails := Format('%s SSE%d', [ProcessorDetails, SSE]);
- if Ex3DNow then
- ProcessorDetails := ProcessorDetails + ' 3DNow!ex'
- else if _3DNow then
- ProcessorDetails := ProcessorDetails + ' 3DNow!';
- if Is64Bits then
- ProcessorDetails := ProcessorDetails + ' 64 bits';
- if DEPCapable then
- ProcessorDetails := ProcessorDetails + ' DEP';
- end;
+ ProcessorDetails := Format(RsProcessor, [CpuInfo.Manufacturer, CpuInfo.CpuName,
+ RoundFrequency(CpuInfo.FrequencyInfo.NormFreq)]);
+ if not CpuInfo.IsFDIVOK then
+ ProcessorDetails := ProcessorDetails + ' [FDIV Bug]';
+ if CpuInfo.ExMMX then
+ ProcessorDetails := ProcessorDetails + ' MMXex';
+ if CpuInfo.MMX then
+ ProcessorDetails := ProcessorDetails + ' MMX';
+ if sse in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE';
+ if sse2 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE2';
+ if sse3 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE3';
+ if ssse3 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSSE3';
+ if sse4A in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE4A';
+ if sse4B in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE4B';
+ if sse5 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE';
+ if CpuInfo.Ex3DNow then
+ ProcessorDetails := ProcessorDetails + ' 3DNow!ex';
+ if CpuInfo._3DNow then
+ ProcessorDetails := ProcessorDetails + ' 3DNow!';
+ if CpuInfo.Is64Bits then
+ ProcessorDetails := ProcessorDetails + ' 64 bits';
+ if CpuInfo.DEPCapable then
+ ProcessorDetails := ProcessorDetails + ' DEP';
DetailsMemo.Lines.Add(ProcessorDetails);
DetailsMemo.Lines.Add(Format(RsMemory, [GetTotalPhysicalMemory div 1024 div 1024,
GetFreePhysicalMemory div 1024 div 1024]));
Modified: trunk/jcl/experts/debug/dialog/ExceptDlg.pas
===================================================================
--- trunk/jcl/experts/debug/dialog/ExceptDlg.pas 2007-11-11 15:50:03 UTC (rev 2212)
+++ trunk/jcl/experts/debug/dialog/ExceptDlg.pas 2007-11-13 13:17:59 UTC (rev 2213)
@@ -299,27 +299,36 @@
DetailsMemo.Lines.Add(Format(RsOSVersion, [GetWindowsVersionString, NtProductTypeString,
Win32MajorVersion, Win32MinorVersion, Win32BuildNumber, Win32CSDVersion]));
GetCpuInfo(CpuInfo);
- with CpuInfo do
- begin
- ProcessorDetails := Format(RsProcessor, [Manufacturer, CpuName,
- RoundFrequency(FrequencyInfo.NormFreq)]);
- if not IsFDIVOK then
- ProcessorDetails := ProcessorDetails + ' [FDIV Bug]';
- if ExMMX then
- ProcessorDetails := ProcessorDetails + ' MMXex'
- else if MMX then
- ProcessorDetails := ProcessorDetails + ' MMX';
- if SSE > 0 then
- ProcessorDetails := Format('%s SSE%d', [ProcessorDetails, SSE]);
- if Ex3DNow then
- ProcessorDetails := ProcessorDetails + ' 3DNow!ex'
- else if _3DNow then
- ProcessorDetails := ProcessorDetails + ' 3DNow!';
- if Is64Bits then
- ProcessorDetails := ProcessorDetails + ' 64 bits';
- if DEPCapable then
- ProcessorDetails := ProcessorDetails + ' DEP';
- end;
+ ProcessorDetails := Format(RsProcessor, [CpuInfo.Manufacturer, CpuInfo.CpuName,
+ RoundFrequency(CpuInfo.FrequencyInfo.NormFreq)]);
+ if not CpuInfo.IsFDIVOK then
+ ProcessorDetails := ProcessorDetails + ' [FDIV Bug]';
+ if CpuInfo.ExMMX then
+ ProcessorDetails := ProcessorDetails + ' MMXex';
+ if CpuInfo.MMX then
+ ProcessorDetails := ProcessorDetails + ' MMX';
+ if sse in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE';
+ if sse2 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE2';
+ if sse3 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE3';
+ if ssse3 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSSE3';
+ if sse4A in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE4A';
+ if sse4B in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE4B';
+ if sse5 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE';
+ if CpuInfo.Ex3DNow then
+ ProcessorDetails := ProcessorDetails + ' 3DNow!ex';
+ if CpuInfo._3DNow then
+ ProcessorDetails := ProcessorDetails + ' 3DNow!';
+ if CpuInfo.Is64Bits then
+ ProcessorDetails := ProcessorDetails + ' 64 bits';
+ if CpuInfo.DEPCapable then
+ ProcessorDetails := ProcessorDetails + ' DEP';
DetailsMemo.Lines.Add(ProcessorDetails);
DetailsMemo.Lines.Add(Format(RsMemory, [GetTotalPhysicalMemory div 1024 div 1024,
GetFreePhysicalMemory div 1024 div 1024]));
Modified: trunk/jcl/experts/debug/dialog/ExceptDlgMail.pas
===================================================================
--- trunk/jcl/experts/debug/dialog/ExceptDlgMail.pas 2007-11-11 15:50:03 UTC (rev 2212)
+++ trunk/jcl/experts/debug/dialog/ExceptDlgMail.pas 2007-11-13 13:17:59 UTC (rev 2213)
@@ -319,27 +319,36 @@
DetailsMemo.Lines.Add(Format(RsOSVersion, [GetWindowsVersionString, NtProductTypeString,
Win32MajorVersion, Win32MinorVersion, Win32BuildNumber, Win32CSDVersion]));
GetCpuInfo(CpuInfo);
- with CpuInfo do
- begin
- ProcessorDetails := Format(RsProcessor, [Manufacturer, CpuName,
- RoundFrequency(FrequencyInfo.NormFreq)]);
- if not IsFDIVOK then
- ProcessorDetails := ProcessorDetails + ' [FDIV Bug]';
- if ExMMX then
- ProcessorDetails := ProcessorDetails + ' MMXex'
- else if MMX then
- ProcessorDetails := ProcessorDetails + ' MMX';
- if SSE > 0 then
- ProcessorDetails := Format('%s SSE%d', [ProcessorDetails, SSE]);
- if Ex3DNow then
- ProcessorDetails := ProcessorDetails + ' 3DNow!ex'
- else if _3DNow then
- ProcessorDetails := ProcessorDetails + ' 3DNow!';
- if Is64Bits then
- ProcessorDetails := ProcessorDetails + ' 64 bits';
- if DEPCapable then
- ProcessorDetails := ProcessorDetails + ' DEP';
- end;
+ ProcessorDetails := Format(RsProcessor, [CpuInfo.Manufacturer, CpuInfo.CpuName,
+ RoundFrequency(CpuInfo.FrequencyInfo.NormFreq)]);
+ if not CpuInfo.IsFDIVOK then
+ ProcessorDetails := ProcessorDetails + ' [FDIV Bug]';
+ if CpuInfo.ExMMX then
+ ProcessorDetails := ProcessorDetails + ' MMXex';
+ if CpuInfo.MMX then
+ ProcessorDetails := ProcessorDetails + ' MMX';
+ if sse in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE';
+ if sse2 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE2';
+ if sse3 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE3';
+ if ssse3 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSSE3';
+ if sse4A in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE4A';
+ if sse4B in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE4B';
+ if sse5 in CpuInfo.SSE then
+ ProcessorDetails := ProcessorDetails + ' SSE';
+ if CpuInfo.Ex3DNow then
+ ProcessorDetails := ProcessorDetails + ' 3DNow!ex';
+ if CpuInfo._3DNow then
+ ProcessorDetails := ProcessorDetails + ' 3DNow!';
+ if CpuInfo.Is64Bits then
+ ProcessorDetails := ProcessorDetails + ' 64 bits';
+ if CpuInfo.DEPCapable then
+ ProcessorDetails := ProcessorDetails + ' DEP';
DetailsMemo.Lines.Add(ProcessorDetails);
DetailsMemo.Lines.Add(Format(RsMemory, [GetTotalPhysicalMemory div 1024 div 1024,
GetFreePhysicalMemory div 1024 div 1024]));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|