Browse Source

* implement TRttiFloatType.GetTypeSize()

git-svn-id: trunk@42717 -
svenbarth 6 years ago
parent
commit
8fdee2b3b1
1 changed files with 18 additions and 0 deletions
  1. 18 0
      packages/rtl-objpas/src/inc/rtti.pp

+ 18 - 0
packages/rtl-objpas/src/inc/rtti.pp

@@ -249,6 +249,8 @@ type
   TRttiFloatType = class(TRttiType)
   private
     function GetFloatType: TFloatType;
+  protected
+    function GetTypeSize: integer; override;
   public
     property FloatType: TFloatType read GetFloatType;
   end;
@@ -2648,6 +2650,22 @@ begin
   result := FTypeData^.FloatType;
 end;
 
+function TRttiFloatType.GetTypeSize: integer;
+begin
+  case FloatType of
+    ftSingle:
+      Result := SizeOf(Single);
+    ftDouble:
+      Result := SizeOf(Double);
+    ftExtended:
+      Result := SizeOf(Extended);
+    ftComp:
+      Result := SizeOf(Comp);
+    ftCurr:
+      Result := SizeOf(Currency);
+  end;
+end;
+
 { TRttiParameter }
 
 function TRttiParameter.ToString: String;