JCL Help:JclIsClassByName

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Is class operator replacement.


Pascal

 function JclIsClassByName(const AnObj: TObject; const AClass: TClass): Boolean;


Return Value

If AnObj's class is AClass or inherits from AClass the function returns True, otherwise it returns False.


Description

JclIsClassByName is an is class operator replacement. This implementation checks the class by it's name. JclIsClassByName checks the name of AnObj's class with the name of AClass. If they're not equal (case insensitive), the parent tree is checked. If an equal name is found, the entire path to the root is checked as well. Only if the path exactly matches AnObj is AClass is assumed to be True.


About

Unit

JclRTTI


Donator

Marcel Bestebroer


Notes

Although the names of all classes upto the root matches, it's not certain that AnObj actually is of AClass. To increase certainty, one should also check the unit name where the class is declared and possibly also it's InstanceSize.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page