|
@@ -78,7 +78,8 @@ type
|
|
function IsObjectInstance: boolean;
|
|
function IsObjectInstance: boolean;
|
|
function IsOrdinal: boolean;
|
|
function IsOrdinal: boolean;
|
|
function IsType(ATypeInfo: TTypeInfo): boolean;
|
|
function IsType(ATypeInfo: TTypeInfo): boolean;
|
|
- function ToString: String;
|
|
|
|
|
|
+ function ToString: String; overload;
|
|
|
|
+ function ToString(const AFormatSettings: TFormatSettings): String; overload;
|
|
function TryCast(ATypeInfo: TTypeInfo; out AResult: TValue; const EmptyAsAnyType: Boolean = True): Boolean;
|
|
function TryCast(ATypeInfo: TTypeInfo; out AResult: TValue; const EmptyAsAnyType: Boolean = True): Boolean;
|
|
|
|
|
|
procedure SetArrayElement(aIndex: SizeInt; const AValue: TValue);
|
|
procedure SetArrayElement(aIndex: SizeInt; const AValue: TValue);
|
|
@@ -1129,6 +1130,11 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
function TValue.ToString: String;
|
|
function TValue.ToString: String;
|
|
|
|
+begin
|
|
|
|
+ Result := ToString(FormatSettings);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TValue.ToString(const AFormatSettings: TFormatSettings): String;
|
|
begin
|
|
begin
|
|
if IsEmpty then
|
|
if IsEmpty then
|
|
Exit('(empty)');
|
|
Exit('(empty)');
|
|
@@ -1138,7 +1144,7 @@ begin
|
|
tkClass: Result := AsObject.ClassName;
|
|
tkClass: Result := AsObject.ClassName;
|
|
tkClassRef: Result := AsClass.ClassName;
|
|
tkClassRef: Result := AsClass.ClassName;
|
|
tkEnumeration: Result := GetEnumName(TTypeInfoEnum(TypeInfo), AsOrdinal);
|
|
tkEnumeration: Result := GetEnumName(TTypeInfoEnum(TypeInfo), AsOrdinal);
|
|
- tkFloat: Result := FloatToStr(AsExtended);
|
|
|
|
|
|
+ tkFloat: Result := FloatToStr(AsExtended, AFormatSettings);
|
|
tkInteger: Result := IntToStr(AsNativeInt);
|
|
tkInteger: Result := IntToStr(AsNativeInt);
|
|
tkString: Result := AsString;
|
|
tkString: Result := AsString;
|
|
else
|
|
else
|