|
@@ -185,6 +185,7 @@ type
|
|
procedure CastInterfaceToInterface(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
procedure CastInterfaceToInterface(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
procedure CastFromInterface(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
procedure CastFromInterface(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
// From Pointer
|
|
// From Pointer
|
|
|
|
+ procedure CastPointerToClass(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
procedure CastFromPointer(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
procedure CastFromPointer(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
// From set
|
|
// From set
|
|
procedure CastSetToSet(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
procedure CastSetToSet(out aRes: Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
@@ -3436,11 +3437,23 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+Procedure TValue.CastPointerToClass(out aRes : Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
|
|
+
|
|
|
|
+var
|
|
|
|
+ Tmp: Pointer;
|
|
|
|
+
|
|
|
|
+begin
|
|
|
|
+ Tmp:=AsPointer;
|
|
|
|
+ TValue.Make(@Tmp,aDestType,aDest);
|
|
|
|
+ aRes:=True;
|
|
|
|
+end;
|
|
|
|
+
|
|
Procedure TValue.CastFromPointer(out aRes : Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
Procedure TValue.CastFromPointer(out aRes : Boolean; out ADest: TValue; aDestType: PTypeInfo);
|
|
|
|
|
|
begin
|
|
begin
|
|
Case aDestType^.Kind of
|
|
Case aDestType^.Kind of
|
|
tkPointer, tkProcedure: CastAssign(aRes,aDest,aDestType);
|
|
tkPointer, tkProcedure: CastAssign(aRes,aDest,aDestType);
|
|
|
|
+ tkClass: CastPointerToClass(aRes,aDest,aDestType);
|
|
else
|
|
else
|
|
aRes:=False;
|
|
aRes:=False;
|
|
end;
|
|
end;
|