mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 04:59:26 +02:00
* Implement CompatibleConversionType and CompatibleConversionType for ConvUtils unit bug #39770
This commit is contained in:
parent
7886233b0e
commit
167f434e84
@ -73,6 +73,8 @@ procedure GetConvFamilies(out AFamilies: TConvFamilyArray);
|
||||
procedure GetConvTypes(const AFamily: TConvFamily; out ATypes: TConvTypeArray);
|
||||
|
||||
function ConvTypeToFamily(const AType: TConvType): TConvFamily;
|
||||
function CompatibleConversionType(const AType: TConvType; const AFamily: TConvFamily): Boolean;
|
||||
function CompatibleConversionTypes(const AFrom, ATo: TConvType): Boolean;
|
||||
|
||||
Type
|
||||
TConvTypeInfo = Class(Tobject)
|
||||
@ -262,6 +264,19 @@ begin
|
||||
result:=TheUnits[AType].Fam;
|
||||
end;
|
||||
|
||||
function CompatibleConversionType(const AType: TConvType;
|
||||
const AFamily: TConvFamily): Boolean;
|
||||
|
||||
begin
|
||||
result:=ConvTypeToFamily(AType)=AFamily;
|
||||
end;
|
||||
|
||||
function CompatibleConversionTypes(const AFrom, ATo: TConvType): Boolean;
|
||||
|
||||
begin
|
||||
result:=ConvTypeToFamily(AFrom)=ConvTypeToFamily(ATo);
|
||||
end;
|
||||
|
||||
Function RegisterConversionFamily(Const S:String):TConvFamily;
|
||||
|
||||
var i,l : Longint;
|
||||
|
Loading…
Reference in New Issue
Block a user