From 5b43d582a0ddc389a704866a7ab519ec75c8a0fe Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 10 Oct 2023 12:52:12 +0200 Subject: [PATCH] LazLogger: dbghex for unsigned --- components/lazutils/LazLoggerImpl.inc | 17 +++++++++++++++++ components/lazutils/LazLoggerIntf.inc | 1 + 2 files changed, 18 insertions(+) diff --git a/components/lazutils/LazLoggerImpl.inc b/components/lazutils/LazLoggerImpl.inc index 70f8f3ad16..7445ab8fa5 100644 --- a/components/lazutils/LazLoggerImpl.inc +++ b/components/lazutils/LazLoggerImpl.inc @@ -509,6 +509,23 @@ begin {$ENDIF} end; +function dbghex(i: qword): string; +{$IFnDEF USED_BY_LAZLOGGER_DUMMY} +const + Hex = '0123456789ABCDEF'; +{$ENDIF} +begin + {$IFnDEF USED_BY_LAZLOGGER_DUMMY} + Result:=''; + repeat + Result:=Hex[(i mod 16)+1]+Result; + i:=i div 16; + until i=0; + {$ELSE} + Result := ''; + {$ENDIF} +end; + function DbgSTime(): string; begin {$IFnDEF USED_BY_LAZLOGGER_DUMMY} diff --git a/components/lazutils/LazLoggerIntf.inc b/components/lazutils/LazLoggerIntf.inc index a94dd4640d..eb384ad645 100644 --- a/components/lazutils/LazLoggerIntf.inc +++ b/components/lazutils/LazLoggerIntf.inc @@ -109,6 +109,7 @@ function DbgSName(const p: TObject): string; overload; function DbgSName(const p: TClass): string; overload; function dbgObjMem(AnObject: TObject): string; overload; function dbghex(i: Int64): string; overload; +function dbghex(i: qword): string; overload; function DbgSTime(): string;