summaryrefslogtreecommitdiff
path: root/lib/delphi/src/Thrift.Utils.pas
diff options
context:
space:
mode:
Diffstat (limited to 'lib/delphi/src/Thrift.Utils.pas')
-rw-r--r--lib/delphi/src/Thrift.Utils.pas12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/delphi/src/Thrift.Utils.pas b/lib/delphi/src/Thrift.Utils.pas
index bc9b4605b..bfd020e2a 100644
--- a/lib/delphi/src/Thrift.Utils.pas
+++ b/lib/delphi/src/Thrift.Utils.pas
@@ -313,6 +313,7 @@ begin
pType := PTypeInfo(TypeInfo(T));
if Assigned(pType) then begin
case pType^.Kind of
+
tkInterface : begin
pIntf := PInterface(@value);
if Supports( pIntf^, ISupportsToString, stos) then begin
@@ -320,6 +321,17 @@ begin
Exit;
end;
end;
+
+ tkEnumeration : begin
+ case SizeOf(value) of
+ 1 : begin result := EnumUtils<T>.ToString( PShortInt(@value)^); Exit; end;
+ 2 : begin result := EnumUtils<T>.ToString( PSmallInt(@value)^); Exit; end;
+ 4 : begin result := EnumUtils<T>.ToString( PLongInt(@value)^); Exit; end;
+ else
+ ASSERT(FALSE); // in theory, this should not happen
+ end;
+ end;
+
end;
end;