diff --git a/rtl/objpas/sysutils/sysstr.inc b/rtl/objpas/sysutils/sysstr.inc index 93e598fae3..53b74189d0 100644 --- a/rtl/objpas/sysutils/sysstr.inc +++ b/rtl/objpas/sysutils/sysstr.inc @@ -928,6 +928,11 @@ begin if Error <> 0 then raise EConvertError.createfmt(SInvalidInteger,[S]); end; +function StrToUInt64(const s: string): UInt64; +begin + result:=StrToQWord(s); +end; + function StrToDWord(const s: string): DWord; var Error: word; begin @@ -949,6 +954,11 @@ begin TryStrToQWord:=Error=0 end; +function TryStrToUInt64(const s: string; Out u: UInt64): boolean; +begin + result:=TryStrToQWord(s,u); +end; + { StrToIntDef converts the string S to an integer value, Default is returned in case S does not represent a valid integer value } @@ -989,6 +999,11 @@ begin if Error <> 0 then result := Default; end; +function StrToUInt64Def(const S: string; Default: UInt64): UInt64; +begin + result:=StrToQWordDef(S,Default); +end; + { LoadStr returns the string resource Ident. } function LoadStr(Ident: integer): string; diff --git a/rtl/objpas/sysutils/sysstrh.inc b/rtl/objpas/sysutils/sysstrh.inc index 401db8e880..369e80fe98 100644 --- a/rtl/objpas/sysutils/sysstrh.inc +++ b/rtl/objpas/sysutils/sysstrh.inc @@ -122,14 +122,17 @@ function StrToInt(const s: string): Longint; function StrToDWord(const s: string): DWord; function StrToInt64(const s: string): int64; function StrToQWord(const s: string): QWord; +function StrToUInt64(const s: string): UInt64; inline; function TryStrToInt(const s: string; Out i : Longint) : boolean; function TryStrToDWord(const s: string; Out D : DWord) : boolean; function TryStrToInt64(const s: string; Out i : int64) : boolean; function TryStrToQWord(const s: string; Out Q : QWord) : boolean; +function TryStrToUInt64(const s: string; Out u : UInt64) : boolean; inline; function StrToIntDef(const S: string; Default: Longint): Longint; function StrToDWordDef(const S: string; Default: DWord): DWord; function StrToInt64Def(const S: string; Default: int64): int64; function StrToQWordDef(const S: string; Default: QWord): QWord; +function StrToUInt64Def(const S: string; Default: UInt64): UInt64; inline; function LoadStr(Ident: integer): string; // function FmtLoadStr(Ident: integer; const Args: array of const): string; Function Format (Const Fmt : String; const Args : Array of const) : String;