|
@@ -1053,6 +1053,11 @@ begin
|
|
|
FFreeObjects := True;
|
|
|
end;
|
|
|
|
|
|
+function TFPObjectList.IndexOf(AObject: TObject): Integer;
|
|
|
+begin
|
|
|
+ Result := FList.IndexOf(Pointer(AObject));
|
|
|
+end;
|
|
|
+
|
|
|
function TFPObjectList.GetCount: integer;
|
|
|
begin
|
|
|
Result := FList.Count;
|
|
@@ -1125,11 +1130,6 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
-function TFPObjectList.IndexOf(AObject: TObject): Integer;
|
|
|
-begin
|
|
|
- Result := FList.IndexOf(Pointer(AObject));
|
|
|
-end;
|
|
|
-
|
|
|
function TFPObjectList.FindInstanceOf(AClass: TClass; AExact: Boolean; AStartAt : Integer): Integer;
|
|
|
var
|
|
|
I : Integer;
|
|
@@ -1764,72 +1764,6 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-{*****************************************************************************
|
|
|
- TFPHashObject
|
|
|
-*****************************************************************************}
|
|
|
-
|
|
|
-procedure TFPHashObject.InternalChangeOwner(HashObjectList:TFPHashObjectList;const s:TSymStr);
|
|
|
-var
|
|
|
- Index : integer;
|
|
|
-begin
|
|
|
- FOwner:=HashObjectList;
|
|
|
- Index:=HashObjectList.Add(s,Self);
|
|
|
- FStrIndex:=HashObjectList.List.List^[Index].StrIndex;
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-constructor TFPHashObject.CreateNotOwned;
|
|
|
-begin
|
|
|
- FStrIndex:=-1;
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-constructor TFPHashObject.Create(HashObjectList:TFPHashObjectList;const s:TSymStr);
|
|
|
-begin
|
|
|
- InternalChangeOwner(HashObjectList,s);
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-procedure TFPHashObject.ChangeOwner(HashObjectList:TFPHashObjectList);
|
|
|
-begin
|
|
|
- InternalChangeOwner(HashObjectList,PSymStr(@FOwner.List.Strs[FStrIndex])^);
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-procedure TFPHashObject.ChangeOwnerAndName(HashObjectList:TFPHashObjectList;const s:TSymStr);
|
|
|
-begin
|
|
|
- InternalChangeOwner(HashObjectList,s);
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-procedure TFPHashObject.Rename(const ANewName:TSymStr);
|
|
|
-var
|
|
|
- Index : integer;
|
|
|
-begin
|
|
|
- Index:=FOwner.Rename(PSymStr(@FOwner.List.Strs[FStrIndex])^,ANewName);
|
|
|
- if Index<>-1 then
|
|
|
- FStrIndex:=FOwner.List.List^[Index].StrIndex;
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-function TFPHashObject.GetName:TSymStr;
|
|
|
-begin
|
|
|
- if FOwner<>nil then
|
|
|
- Result:=PSymStr(@FOwner.List.Strs[FStrIndex])^
|
|
|
- else
|
|
|
- Result:='';
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-function TFPHashObject.GetHash:Longword;
|
|
|
-begin
|
|
|
- if FOwner<>nil then
|
|
|
- Result:=FPHash(PSymStr(@FOwner.List.Strs[FStrIndex])^)
|
|
|
- else
|
|
|
- Result:=$ffffffff;
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
{*****************************************************************************
|
|
|
TFPHashObjectList (Copied from rtl/objpas/classes/lists.inc)
|
|
|
*****************************************************************************}
|
|
@@ -1862,6 +1796,11 @@ begin
|
|
|
FHashList.Clear;
|
|
|
end;
|
|
|
|
|
|
+function TFPHashObjectList.IndexOf(AObject: TObject): Integer;
|
|
|
+begin
|
|
|
+ Result := FHashList.IndexOf(Pointer(AObject));
|
|
|
+end;
|
|
|
+
|
|
|
function TFPHashObjectList.GetCount: integer;
|
|
|
begin
|
|
|
Result := FHashList.Count;
|
|
@@ -1944,12 +1883,6 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
-function TFPHashObjectList.IndexOf(AObject: TObject): Integer;
|
|
|
-begin
|
|
|
- Result := FHashList.IndexOf(Pointer(AObject));
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
function TFPHashObjectList.Find(const s:TSymStr): TObject;
|
|
|
begin
|
|
|
result:=TObject(FHashList.Find(s));
|
|
@@ -2031,6 +1964,72 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
+{*****************************************************************************
|
|
|
+ TFPHashObject
|
|
|
+*****************************************************************************}
|
|
|
+
|
|
|
+procedure TFPHashObject.InternalChangeOwner(HashObjectList:TFPHashObjectList;const s:TSymStr);
|
|
|
+var
|
|
|
+ Index : integer;
|
|
|
+begin
|
|
|
+ FOwner:=HashObjectList;
|
|
|
+ Index:=HashObjectList.Add(s,Self);
|
|
|
+ FStrIndex:=HashObjectList.List.List^[Index].StrIndex;
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+constructor TFPHashObject.CreateNotOwned;
|
|
|
+begin
|
|
|
+ FStrIndex:=-1;
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+constructor TFPHashObject.Create(HashObjectList:TFPHashObjectList;const s:TSymStr);
|
|
|
+begin
|
|
|
+ InternalChangeOwner(HashObjectList,s);
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+procedure TFPHashObject.ChangeOwner(HashObjectList:TFPHashObjectList);
|
|
|
+begin
|
|
|
+ InternalChangeOwner(HashObjectList,PSymStr(@FOwner.List.Strs[FStrIndex])^);
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+procedure TFPHashObject.ChangeOwnerAndName(HashObjectList:TFPHashObjectList;const s:TSymStr);
|
|
|
+begin
|
|
|
+ InternalChangeOwner(HashObjectList,s);
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+procedure TFPHashObject.Rename(const ANewName:TSymStr);
|
|
|
+var
|
|
|
+ Index : integer;
|
|
|
+begin
|
|
|
+ Index:=FOwner.Rename(PSymStr(@FOwner.List.Strs[FStrIndex])^,ANewName);
|
|
|
+ if Index<>-1 then
|
|
|
+ FStrIndex:=FOwner.List.List^[Index].StrIndex;
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+function TFPHashObject.GetName:TSymStr;
|
|
|
+begin
|
|
|
+ if FOwner<>nil then
|
|
|
+ Result:=PSymStr(@FOwner.List.Strs[FStrIndex])^
|
|
|
+ else
|
|
|
+ Result:='';
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+function TFPHashObject.GetHash:Longword;
|
|
|
+begin
|
|
|
+ if FOwner<>nil then
|
|
|
+ Result:=FPHash(PSymStr(@FOwner.List.Strs[FStrIndex])^)
|
|
|
+ else
|
|
|
+ Result:=$ffffffff;
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
{****************************************************************************
|
|
|
TLinkedListItem
|
|
|
****************************************************************************}
|