Check whether a property is stored.
Source position: typinfo.pp line 1204
function IsStoredProp( |
Instance: TObject; |
PropInfo: PPropInfo |
):Boolean; |
Instance: TObject; |
const PropName: string |
):Boolean; |
IsStoredProp returns True if the Stored modifier evaluates to True for the property described by PropInfo or with name PropName for object Instance. It returns False otherwise. If the function returns True, this indicates that the property should be written when streaming the object Instance.
If there was no stored modifier in the declaration of the property, True will be returned.
No checking is done whether Instance is non-nil, or whether PropInfo describes a valid property of Instance. Specifying an invalid property name in PropName will result in an EPropertyError exception.
|
Check whether a published property exists. |
|
|
Check the type of a published property. |
program example11; { This program demonstrates the IsStoredProp function } {$mode objfpc} uses rttiobj,typinfo; Var O : TMyTestObject; PI : PPropInfo; begin O:=TMyTestObject.Create; Writeln('Stored tests : '); Write('IsStoredProp(O,StoredIntegerConstFalse) : '); Writeln(IsStoredProp(O,'StoredIntegerConstFalse')); Write('IsStoredProp(O,StoredIntegerConstTrue) : '); Writeln(IsStoredProp(O,'StoredIntegerConstTrue')); Write('IsStoredProp(O,StoredIntegerMethod) : '); Writeln(IsStoredProp(O,'StoredIntegerMethod')); Write('IsStoredProp(O,StoredIntegerVirtualMethod) : '); Writeln(IsStoredProp(O,'StoredIntegerVirtualMethod')); O.Free; end.