mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 02:40:26 +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
|
||||
public
|
||||
constructor Create;
|
||||
|
||||
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; out ACharLength : Integer) : UCS4Char; overload; static;
|
||||
@ -184,6 +186,11 @@ end;
|
||||
|
||||
{ TCharacter }
|
||||
|
||||
constructor TCharacter.Create;
|
||||
begin
|
||||
raise ENoConstructException.CreateFmt(SClassCantBeConstructed, [ClassName]);
|
||||
end;
|
||||
|
||||
class function TCharacter.ConvertFromUtf32(AChar : UCS4Char) : UnicodeString; static;
|
||||
begin
|
||||
if AChar < UCS4_HALF_BASE then
|
||||
|
@ -294,6 +294,7 @@ ResourceString
|
||||
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]';
|
||||
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
|
||||
|
@ -202,6 +202,8 @@ type
|
||||
EArgumentException = class(Exception);
|
||||
EArgumentOutOfRangeException = class(EArgumentException);
|
||||
|
||||
ENoConstructException = class(Exception);
|
||||
|
||||
{ Exception handling routines }
|
||||
function ExceptObject: TObject;
|
||||
function ExceptAddr: Pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user