MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / VCanCast

Method VCanCast

src/hx/cppia/CppiaClasses.cpp:1672–1702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1670 }
1671
1672 bool VCanCast(hx::Object *inPtr) HXCPP_OVERRIDE
1673 {
1674 if (!inPtr)
1675 return false;
1676
1677 hx::Class c = inPtr->__GetClass();
1678 if (!c.mPtr)
1679 return false;
1680
1681 if (info->isInterface)
1682 {
1683 // Can only be this cppia interface if it is a cppia class...
1684 CppiaClass *cppiaClass = dynamic_cast<CppiaClass *>(c.mPtr);
1685 if (!cppiaClass)
1686 return false;
1687 return cppiaClass->info->implementsInterface(info);
1688 }
1689
1690
1691 hx::Class_obj *classPtr = c.mPtr;
1692 while(classPtr)
1693 {
1694 if (classPtr==this)
1695 return true;
1696 if (info->isEnum)
1697 return false;
1698 classPtr = classPtr->GetSuper().mPtr;
1699 }
1700
1701 return false;
1702 }
1703
1704
1705 hx::Val __Field(const String &inName,hx::PropertyAccess inCallProp) HXCPP_OVERRIDE

Callers 1

isClassOfMethod · 0.80

Calls 3

implementsInterfaceMethod · 0.80
GetSuperMethod · 0.80
__GetClassMethod · 0.45

Tested by

no test coverage detected