mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 12:17:11 +01:00
+ Added overloaded settostring which starts from typinfo, not propinfo
git-svn-id: trunk@491 -
This commit is contained in:
parent
c6ad403a04
commit
2ec3e6db01
@ -271,6 +271,7 @@ Procedure SetVariantProp(Instance: TObject; PropInfo : PPropInfo; const Value: V
|
|||||||
// Auxiliary routines, which may be useful
|
// Auxiliary routines, which may be useful
|
||||||
Function GetEnumName(TypeInfo : PTypeInfo;Value : Integer) : string;
|
Function GetEnumName(TypeInfo : PTypeInfo;Value : Integer) : string;
|
||||||
Function GetEnumValue(TypeInfo : PTypeInfo;const Name : string) : Integer;
|
Function GetEnumValue(TypeInfo : PTypeInfo;const Name : string) : Integer;
|
||||||
|
function SetToString(TypeInfo: PTypeInfo; Value: Integer; Brackets: Boolean) : String;
|
||||||
function SetToString(PropInfo: PPropInfo; Value: Integer; Brackets: Boolean) : String;
|
function SetToString(PropInfo: PPropInfo; Value: Integer; Brackets: Boolean) : String;
|
||||||
function SetToString(PropInfo: PPropInfo; Value: Integer) : String;
|
function SetToString(PropInfo: PPropInfo; Value: Integer) : String;
|
||||||
function StringToSet(PropInfo: PPropInfo; const Value: string): Integer;
|
function StringToSet(PropInfo: PPropInfo; const Value: string): Integer;
|
||||||
@ -357,12 +358,18 @@ end;
|
|||||||
|
|
||||||
Function SetToString(PropInfo: PPropInfo; Value: Integer; Brackets: Boolean) : String;
|
Function SetToString(PropInfo: PPropInfo; Value: Integer; Brackets: Boolean) : String;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=SetToString(PropInfo^.PropType,Value,Brackets);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function SetToString(TypeInfo: PTypeInfo; Value: Integer; Brackets: Boolean) : String;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
PTI : PTypeInfo;
|
PTI : PTypeInfo;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
PTI:=GetTypeData(PropInfo^.PropType)^.CompType;
|
PTI:=GetTypeData(TypeInfo)^.CompType;
|
||||||
Result:='';
|
Result:='';
|
||||||
For I:=0 to SizeOf(Integer)*8-1 do
|
For I:=0 to SizeOf(Integer)*8-1 do
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user