mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-19 19:13:22 +08:00
[0.3.x] added : numVariant.isInteger method
git-svn-id: https://pykd.svn.codeplex.com/svn@89228 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
a244ea3f3a
commit
d9dcaf3007
@ -477,6 +477,7 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
.def( "__int__", &NumVariantAdaptor::int_ )
|
||||
.def( "__index__", &NumVariantAdaptor::long_ )
|
||||
.def( "__hash__", &NumVariantAdaptor::long_ )
|
||||
.def( "isInteger", &NumVariantAdaptor::isInteger )
|
||||
;
|
||||
|
||||
NumVariantAdaptor::registerNumConvertion();
|
||||
@ -649,6 +650,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
.add_static_property( "Char", &BaseTypesEnum::getChar )
|
||||
.add_static_property( "WChar", &BaseTypesEnum::getWChar )
|
||||
.add_static_property( "VoidPtr", &BaseTypesEnum::getVoidPtr )
|
||||
.add_static_property( "Float", &BaseTypesEnum::getFloat )
|
||||
.add_static_property( "Double", &BaseTypesEnum::getDouble )
|
||||
;
|
||||
|
||||
|
||||
|
@ -225,6 +225,8 @@ struct BaseTypesEnum {
|
||||
static kdlib::TypeInfoPtr getChar() { return pykd::getTypeInfoByName(L"Char"); }
|
||||
static kdlib::TypeInfoPtr getWChar() { return pykd::getTypeInfoByName(L"WChar"); }
|
||||
static kdlib::TypeInfoPtr getVoidPtr() { return pykd::getTypeInfoByName(L"Void*"); }
|
||||
static kdlib::TypeInfoPtr getFloat() { return pykd::getTypeInfoByName(L"Float"); }
|
||||
static kdlib::TypeInfoPtr getDouble() { return pykd::getTypeInfoByName(L"Double"); }
|
||||
};
|
||||
|
||||
} // end namespace pykd
|
||||
|
@ -226,6 +226,11 @@ public:
|
||||
return v.asHex();
|
||||
}
|
||||
|
||||
static bool isInteger(kdlib::NumBehavior& var) {
|
||||
kdlib::NumVariant v = var;
|
||||
return v.isInteger();
|
||||
}
|
||||
|
||||
static void registerNumConvertion() {
|
||||
python::converter::registry::push_back( &numConvertible, &numConstruct<long>, python::type_id<long>() );
|
||||
python::converter::registry::push_back( &numConvertible, &numConstruct<unsigned long>, python::type_id<unsigned long>() );
|
||||
|
Loading…
Reference in New Issue
Block a user