mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 08:50:44 +02:00
Fix for Mantis #30734: Implement Delphi-compatible functions StrToUInt64(), StrToUInt64Def and TryStrToUInt64 as inline forwarders to the existing respective QWord functions
git-svn-id: trunk@34710 -
This commit is contained in:
parent
4091010b9f
commit
63f0c7a2c3
@ -928,6 +928,11 @@ begin
|
|||||||
if Error <> 0 then raise EConvertError.createfmt(SInvalidInteger,[S]);
|
if Error <> 0 then raise EConvertError.createfmt(SInvalidInteger,[S]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function StrToUInt64(const s: string): UInt64;
|
||||||
|
begin
|
||||||
|
result:=StrToQWord(s);
|
||||||
|
end;
|
||||||
|
|
||||||
function StrToDWord(const s: string): DWord;
|
function StrToDWord(const s: string): DWord;
|
||||||
var Error: word;
|
var Error: word;
|
||||||
begin
|
begin
|
||||||
@ -949,6 +954,11 @@ begin
|
|||||||
TryStrToQWord:=Error=0
|
TryStrToQWord:=Error=0
|
||||||
end;
|
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,
|
{ StrToIntDef converts the string S to an integer value,
|
||||||
Default is returned in case S does not represent a valid 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;
|
if Error <> 0 then result := Default;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function StrToUInt64Def(const S: string; Default: UInt64): UInt64;
|
||||||
|
begin
|
||||||
|
result:=StrToQWordDef(S,Default);
|
||||||
|
end;
|
||||||
|
|
||||||
{ LoadStr returns the string resource Ident. }
|
{ LoadStr returns the string resource Ident. }
|
||||||
|
|
||||||
function LoadStr(Ident: integer): string;
|
function LoadStr(Ident: integer): string;
|
||||||
|
@ -122,14 +122,17 @@ function StrToInt(const s: string): Longint;
|
|||||||
function StrToDWord(const s: string): DWord;
|
function StrToDWord(const s: string): DWord;
|
||||||
function StrToInt64(const s: string): int64;
|
function StrToInt64(const s: string): int64;
|
||||||
function StrToQWord(const s: string): QWord;
|
function StrToQWord(const s: string): QWord;
|
||||||
|
function StrToUInt64(const s: string): UInt64; inline;
|
||||||
function TryStrToInt(const s: string; Out i : Longint) : boolean;
|
function TryStrToInt(const s: string; Out i : Longint) : boolean;
|
||||||
function TryStrToDWord(const s: string; Out D : DWord) : boolean;
|
function TryStrToDWord(const s: string; Out D : DWord) : boolean;
|
||||||
function TryStrToInt64(const s: string; Out i : int64) : boolean;
|
function TryStrToInt64(const s: string; Out i : int64) : boolean;
|
||||||
function TryStrToQWord(const s: string; Out Q : QWord) : 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 StrToIntDef(const S: string; Default: Longint): Longint;
|
||||||
function StrToDWordDef(const S: string; Default: DWord): DWord;
|
function StrToDWordDef(const S: string; Default: DWord): DWord;
|
||||||
function StrToInt64Def(const S: string; Default: int64): int64;
|
function StrToInt64Def(const S: string; Default: int64): int64;
|
||||||
function StrToQWordDef(const S: string; Default: QWord): QWord;
|
function StrToQWordDef(const S: string; Default: QWord): QWord;
|
||||||
|
function StrToUInt64Def(const S: string; Default: UInt64): UInt64; inline;
|
||||||
function LoadStr(Ident: integer): string;
|
function LoadStr(Ident: integer): string;
|
||||||
// function FmtLoadStr(Ident: integer; const Args: array of const): string;
|
// function FmtLoadStr(Ident: integer; const Args: array of const): string;
|
||||||
Function Format (Const Fmt : String; const Args : Array of const) : String;
|
Function Format (Const Fmt : String; const Args : Array of const) : String;
|
||||||
|
Loading…
Reference in New Issue
Block a user