Browse Source

+ added QWord overloads for IntToHex, hexStr, OctStr, binStr

git-svn-id: trunk@8332 -
Jonas Maebe 18 years ago
parent
commit
a57f9e0672
4 changed files with 26 additions and 0 deletions
  1. 18 0
      rtl/inc/sstrings.inc
  2. 3 0
      rtl/inc/systemh.inc
  3. 4 0
      rtl/objpas/sysutils/sysstr.inc
  4. 1 0
      rtl/objpas/sysutils/sysstrh.inc

+ 18 - 0
rtl/inc/sstrings.inc

@@ -314,6 +314,24 @@ begin
 end;
 
 
+Function  hexStr(Val:qword;cnt:byte):shortstring;
+begin
+  hexStr:=hexStr(int64(Val),cnt);
+end;
+
+
+Function  OctStr(Val:qword;cnt:byte):shortstring;
+begin
+  OctStr:=OctStr(int64(Val),cnt);
+end;
+
+
+Function  binStr(Val:qword;cnt:byte):shortstring;
+begin
+  binStr:=binStr(int64(Val),cnt);
+end;
+
+
 function hexstr(val : pointer) : shortstring;
 var
   i : longint;

+ 3 - 0
rtl/inc/systemh.inc

@@ -564,6 +564,9 @@ Function  binStr(Val:Longint;cnt:byte):shortstring;
 Function  hexStr(Val:int64;cnt:byte):shortstring;
 Function  OctStr(Val:int64;cnt:byte):shortstring;
 Function  binStr(Val:int64;cnt:byte):shortstring;
+Function  hexStr(Val:qword;cnt:byte):shortstring;
+Function  OctStr(Val:qword;cnt:byte):shortstring;
+Function  binStr(Val:qword;cnt:byte):shortstring;
 Function  hexStr(Val:Pointer):shortstring;
 
 { Char functions }

+ 4 - 0
rtl/objpas/sysutils/sysstr.inc

@@ -752,6 +752,10 @@ begin
  end;
 end ;
 
+function IntToHex(Value: QWord; Digits: integer): string;
+begin
+  result:=IntToHex(Int64(Value),Digits);
+end;
 
 function TryStrToInt(const s: string; var i : integer) : boolean;
 var Error : word;

+ 1 - 0
rtl/objpas/sysutils/sysstrh.inc

@@ -107,6 +107,7 @@ function IntToStr(Value: Int64): string;
 function IntToStr(Value: QWord): string;
 function IntToHex(Value: integer; Digits: integer): string;
 function IntToHex(Value: Int64; Digits: integer): string;
+function IntToHex(Value: QWord; Digits: integer): string;
 function StrToInt(const s: string): integer;
 function TryStrToInt(const s: string; var i : integer) : boolean;
 function StrToInt64(const s: string): int64;