mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 19:11:03 +02:00
* Allow to read extended RTTI info
This commit is contained in:
parent
08cd7e9146
commit
4722e95a3f
@ -3281,6 +3281,67 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure readextendedrtti;
|
||||||
|
type
|
||||||
|
tvisopt=record
|
||||||
|
mask : trtti_visibility;
|
||||||
|
str : string[10];
|
||||||
|
end;
|
||||||
|
const
|
||||||
|
visopt : array[0..ord(high(trtti_visibility))] of tvisopt=(
|
||||||
|
(mask:rv_private; str:'Private'),
|
||||||
|
(mask:rv_protected; str:'Protected'),
|
||||||
|
(mask:rv_public; str:'Public'),
|
||||||
|
(mask:rv_published; str:'Published')
|
||||||
|
);
|
||||||
|
type
|
||||||
|
toptionopt=record
|
||||||
|
mask : trtti_option;
|
||||||
|
str : string[10];
|
||||||
|
end;
|
||||||
|
const
|
||||||
|
voptionopt : array[0..ord(high(trtti_option))] of toptionopt=(
|
||||||
|
(mask:ro_methods; str:'Methods'),
|
||||||
|
(mask:ro_fields; str:'Fields'),
|
||||||
|
(mask:ro_properties; str:'Properties')
|
||||||
|
);
|
||||||
|
var
|
||||||
|
clause: string;
|
||||||
|
visibilities: trtti_visibilities;
|
||||||
|
first: boolean;
|
||||||
|
i, ro: integer;
|
||||||
|
begin
|
||||||
|
clause:='';
|
||||||
|
case trtti_clause(ppufile.getbyte) of
|
||||||
|
rtc_none: clause:='None';
|
||||||
|
rtc_inherit: clause:='Inherit';
|
||||||
|
rtc_explicit: clause:='Explicit';
|
||||||
|
end;
|
||||||
|
writeln([space,' Clause : ',clause]);
|
||||||
|
|
||||||
|
for ro:=0 to high(voptionopt) do
|
||||||
|
begin
|
||||||
|
ppufile.getset(tppuset1(visibilities));
|
||||||
|
if visibilities<>[] then
|
||||||
|
begin
|
||||||
|
write([space,' ',voptionopt[ro].str,' : ']);
|
||||||
|
first:=true;
|
||||||
|
for i:=0 to high(visopt) do
|
||||||
|
if visopt[i].mask in visibilities then
|
||||||
|
begin
|
||||||
|
if first then
|
||||||
|
first:=false
|
||||||
|
else
|
||||||
|
write(', ');
|
||||||
|
write(visopt[i].str);
|
||||||
|
end;
|
||||||
|
if not first then
|
||||||
|
writeln;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure readprocimploptions(const space: string; out implprocoptions: timplprocoptions);
|
procedure readprocimploptions(const space: string; out implprocoptions: timplprocoptions);
|
||||||
type
|
type
|
||||||
tpiopt=record
|
tpiopt=record
|
||||||
@ -4456,6 +4517,8 @@ begin
|
|||||||
writeln([space,' Import lib/pkg : ',getstring]);
|
writeln([space,' Import lib/pkg : ',getstring]);
|
||||||
write ([space,' Options : ']);
|
write ([space,' Options : ']);
|
||||||
readobjectdefoptions(objdef);
|
readobjectdefoptions(objdef);
|
||||||
|
writeln([space,' Extended RTTI : ']);
|
||||||
|
readextendedrtti;
|
||||||
if (df_copied_def in defoptions) then
|
if (df_copied_def in defoptions) then
|
||||||
begin
|
begin
|
||||||
Include(TPpuRecordDef(def).Options, ooCopied);
|
Include(TPpuRecordDef(def).Options, ooCopied);
|
||||||
@ -4494,6 +4557,8 @@ begin
|
|||||||
writeln([space,' Import lib/pkg : ',getstring]);
|
writeln([space,' Import lib/pkg : ',getstring]);
|
||||||
write ([space,' Options : ']);
|
write ([space,' Options : ']);
|
||||||
readobjectdefoptions(objdef);
|
readobjectdefoptions(objdef);
|
||||||
|
writeln([space,' Extended RTTI : ']);
|
||||||
|
readextendedrtti;
|
||||||
otb:=getbyte;
|
otb:=getbyte;
|
||||||
write ([space,' Type : ']);
|
write ([space,' Type : ']);
|
||||||
case tobjecttyp(otb) of
|
case tobjecttyp(otb) of
|
||||||
|
Loading…
Reference in New Issue
Block a user