mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-05 05:27:47 +02:00
rtl: added rttit StrictVsibility
This commit is contained in:
parent
55a3898b8c
commit
729b61c87e
@ -158,6 +158,7 @@ type
|
||||
function GetMemberTypeInfo: TTypeMember;
|
||||
function GetName: String; override;
|
||||
function GetParent: TRttiType;
|
||||
function GetStrictVisibility: Boolean; virtual;
|
||||
function GetVisibility: TMemberVisibility; virtual;
|
||||
function LoadCustomAttributes: TCustomAttributeArray; override;
|
||||
public
|
||||
@ -166,6 +167,7 @@ type
|
||||
property MemberTypeInfo: TTypeMember read GetMemberTypeInfo;
|
||||
property Parent: TRttiType read GetParent;
|
||||
property Visibility: TMemberVisibility read GetVisibility;
|
||||
property StrictVisibility: Boolean Read GetStrictVisibility;
|
||||
end;
|
||||
|
||||
{ TRttiDataMember }
|
||||
@ -1752,7 +1754,7 @@ end;
|
||||
|
||||
{ TRttiMember }
|
||||
|
||||
function TRttiMember.GetName: string;
|
||||
function TRttiMember.GetName: String;
|
||||
begin
|
||||
Result := MemberTypeInfo.Name;
|
||||
end;
|
||||
@ -1762,12 +1764,19 @@ begin
|
||||
Result := TRttiType(inherited Parent);
|
||||
end;
|
||||
|
||||
function TRttiMember.GetStrictVisibility: Boolean;
|
||||
begin
|
||||
Result:=MemberTypeInfo.Visibility in [tmvStrictPrivate,tmvStrictProtected];
|
||||
end;
|
||||
|
||||
function TRttiMember.GetVisibility: TMemberVisibility;
|
||||
begin
|
||||
if MemberTypeInfo.Visibility=tmvPublishedPublic then
|
||||
Result:=mvPublic
|
||||
else
|
||||
Result:=TMemberVisibility(ord(MemberTypeInfo.Visibility));
|
||||
case MemberTypeInfo.Visibility of
|
||||
tmvPrivate, tmvStrictPrivate: Result:=mvPrivate;
|
||||
tmvProtected, tmvStrictProtected: Result:=mvProtected;
|
||||
tmvPublic, tmvPublishedPublic: Result:=mvPublic;
|
||||
else Result:=mvPublished;
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TRttiMember.Create(AParent: TRttiType; ATypeInfo: TTypeMember);
|
||||
|
@ -201,11 +201,13 @@ type
|
||||
TTypeMemberKinds = set of TTypeMemberKind;
|
||||
|
||||
TTypeMemberVisibility = (
|
||||
tmvPrivate, // 0
|
||||
tmvProtected, // 1
|
||||
tmvPublic, // 2
|
||||
tmvPublished, // 3
|
||||
tmvPublishedPublic// 4, public for extended RTTI, published for basic RTTI, vcPublished was missing in the RTTI directive
|
||||
tmvPrivate, // 0
|
||||
tmvProtected, // 1
|
||||
tmvPublic, // 2
|
||||
tmvPublished, // 3
|
||||
tmvPublishedPublic,// 4, public for extended RTTI, published for basic RTTI, vcPublished was missing in the RTTI directive
|
||||
tmvStrictPrivate, // 5
|
||||
tmvStrictProtected // 6
|
||||
);
|
||||
TTypeMemberVisibilities = set of TTypeMemberVisibility;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user