[0.3.x] add: typeInfo.getClassParent, name of class methods

git-svn-id: https://pykd.svn.codeplex.com/svn@86408 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2013-11-14 10:23:52 +00:00 committed by Mikhail I. Izmestev
parent 93ad5090da
commit 260f9f8685
2 changed files with 8 additions and 0 deletions

View File

@ -516,6 +516,8 @@ BOOST_PYTHON_MODULE( pykd )
"Return flag: type is constant" ) "Return flag: type is constant" )
.def( "getCallingConvention", &kdlib::TypeInfo::getCallingConvention, .def( "getCallingConvention", &kdlib::TypeInfo::getCallingConvention,
"Returns an indicator of a methods calling convention: callingConvention" ) "Returns an indicator of a methods calling convention: callingConvention" )
.def( "getClassParent", &kdlib::TypeInfo::getClassParent,
"Return class parent" )
.def( "__str__", &kdlib::TypeInfo::str, .def( "__str__", &kdlib::TypeInfo::str,
"Return type as a printable string" ) "Return type as a printable string" )
.def( "__getattr__", TypeInfoAdapter::getElementByName ) .def( "__getattr__", TypeInfoAdapter::getElementByName )

View File

@ -263,6 +263,12 @@ class TypeInfoTest( unittest.TestCase ):
functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref() functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref()
self.assertEqual(functype.name(), "Void(__cdecl)(Int4B, Float)") self.assertEqual(functype.name(), "Void(__cdecl)(Int4B, Float)")
functype = target.module.typedVar( "MethodPtr" ).type().deref()
self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::)()")
def testFunctionPtrName(self): def testFunctionPtrName(self):
funcptrtype = target.module.typedVar( "CdeclFuncPtr" ).type() funcptrtype = target.module.typedVar( "CdeclFuncPtr" ).type()
self.assertEqual(funcptrtype.name(), "Void(__cdecl*)(Int4B, Float)") self.assertEqual(funcptrtype.name(), "Void(__cdecl*)(Int4B, Float)")
functype = target.module.typedVar( "MethodPtr" ).type().deref()
self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::*)()")