mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:29:24 +02:00
rtl: raise EContructException in TCharacter constructor (compatible to delphi behavior)
git-svn-id: trunk@19189 -
This commit is contained in:
parent
8af1fa3e57
commit
98f6ec4a05
@ -52,6 +52,8 @@ type
|
|||||||
|
|
||||||
TCharacter = class sealed
|
TCharacter = class sealed
|
||||||
public
|
public
|
||||||
|
constructor Create;
|
||||||
|
|
||||||
class function ConvertFromUtf32(AChar : UCS4Char) : UnicodeString; static;
|
class function ConvertFromUtf32(AChar : UCS4Char) : UnicodeString; static;
|
||||||
class function ConvertToUtf32(const AString : UnicodeString; AIndex : Integer) : UCS4Char; overload; static;
|
class function ConvertToUtf32(const AString : UnicodeString; AIndex : Integer) : UCS4Char; overload; static;
|
||||||
class function ConvertToUtf32(const AString : UnicodeString; AIndex : Integer; out ACharLength : Integer) : UCS4Char; overload; static;
|
class function ConvertToUtf32(const AString : UnicodeString; AIndex : Integer; out ACharLength : Integer) : UCS4Char; overload; static;
|
||||||
@ -184,6 +186,11 @@ end;
|
|||||||
|
|
||||||
{ TCharacter }
|
{ TCharacter }
|
||||||
|
|
||||||
|
constructor TCharacter.Create;
|
||||||
|
begin
|
||||||
|
raise ENoConstructException.CreateFmt(SClassCantBeConstructed, [ClassName]);
|
||||||
|
end;
|
||||||
|
|
||||||
class function TCharacter.ConvertFromUtf32(AChar : UCS4Char) : UnicodeString; static;
|
class function TCharacter.ConvertFromUtf32(AChar : UCS4Char) : UnicodeString; static;
|
||||||
begin
|
begin
|
||||||
if AChar < UCS4_HALF_BASE then
|
if AChar < UCS4_HALF_BASE then
|
||||||
|
@ -294,6 +294,7 @@ ResourceString
|
|||||||
SLowSurrogateOutOfRange = 'Low surrogate $%x out of range [$DC00 - $DFFF]';
|
SLowSurrogateOutOfRange = 'Low surrogate $%x out of range [$DC00 - $DFFF]';
|
||||||
SInvalidUTF32Char = 'Invalid UTF32 character $%x. Valid UTF32 character must be in range [$0 - $10FFFF] except surrogate range [$D800-$DFFF]';
|
SInvalidUTF32Char = 'Invalid UTF32 character $%x. Valid UTF32 character must be in range [$0 - $10FFFF] except surrogate range [$D800-$DFFF]';
|
||||||
SInvalidHighSurrogate = 'Invalid high surrogate at index %d. High surrogate must be followed by a low surrogate pair';
|
SInvalidHighSurrogate = 'Invalid high surrogate at index %d. High surrogate must be followed by a low surrogate pair';
|
||||||
|
SClassCantBeConstructed = 'Class %s can not be constructed';
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
Keysim Names
|
Keysim Names
|
||||||
|
@ -202,6 +202,8 @@ type
|
|||||||
EArgumentException = class(Exception);
|
EArgumentException = class(Exception);
|
||||||
EArgumentOutOfRangeException = class(EArgumentException);
|
EArgumentOutOfRangeException = class(EArgumentException);
|
||||||
|
|
||||||
|
ENoConstructException = class(Exception);
|
||||||
|
|
||||||
{ Exception handling routines }
|
{ Exception handling routines }
|
||||||
function ExceptObject: TObject;
|
function ExceptObject: TObject;
|
||||||
function ExceptAddr: Pointer;
|
function ExceptAddr: Pointer;
|
||||||
|
Loading…
Reference in New Issue
Block a user