Browse Source

* Add get routines for unicode and widestring

Michaël Van Canneyt 1 year ago
parent
commit
d1f06d45b9
1 changed files with 12 additions and 0 deletions
  1. 12 0
      packages/rtl-objpas/tests/tests.rtti.util.pas

+ 12 - 0
packages/rtl-objpas/tests/tests.rtti.util.pas

@@ -48,6 +48,8 @@ function GetInstValue(aValue: TObject): TValue;
 function GetPointerValue(aValue: Pointer): TValue;
 function GetIntValue(aValue: SizeInt): TValue;
 function GetAnsiString(const aValue: AnsiString): TValue;
+function GetUnicodeString(const aValue: UnicodeString): TValue;
+function GetWideString(const aValue: WideString): TValue;
 function GetShortString(const aValue: ShortString): TValue;
 function GetSingleValue(aValue: Single): TValue;
 function GetDoubleValue(aValue: Double): TValue;
@@ -284,6 +286,16 @@ begin
   Result := TValue.{$ifdef fpc}specialize{$endif}From<AnsiString>(aValue);
 end;
 
+function GetUnicodeString(const aValue: UnicodeString): TValue;
+begin
+  Result := TValue.{$ifdef fpc}specialize{$endif}From<UnicodeString>(aValue);
+end;
+
+function GetWideString(const aValue: WideString): TValue;
+begin
+  Result := TValue.{$ifdef fpc}specialize{$endif}From<WideString>(aValue);
+end;
+
 function GetShortString(const aValue: ShortString): TValue;
 begin
   Result := TValue.{$ifdef fpc}specialize{$endif}From<ShortString>(aValue);