diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-01-15 12:12:21 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-01-15 20:12:25 -0300 |
commit | 4587abd19af6be7148dbe7891f909652e40a9aa2 (patch) | |
tree | 45570eece013e6984b6ad745e40cd11874c21a0a | |
parent | d2c94d6d62458419d54a698e67c8b123808ff09d (diff) |
Added ShibokenGenerator::shouldDereferenceAbstractMetaTypePointer method.
It checks if a meta type should be dereferenced by the Python method
wrapper passing it to C++.
ShibokenGenerator::shouldDereferenceArgumentPointer now calls the new
method.
-rw-r--r-- | shibokengenerator.cpp | 10 | ||||
-rw-r--r-- | shibokengenerator.h | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp index de879fd56..46036bf04 100644 --- a/shibokengenerator.cpp +++ b/shibokengenerator.cpp @@ -517,9 +517,13 @@ bool ShibokenGenerator::isPyInt(const AbstractMetaType* type) bool ShibokenGenerator::shouldDereferenceArgumentPointer(const AbstractMetaArgument* arg) { - const AbstractMetaType* argType = arg->type(); - const TypeEntry* type = argType->typeEntry(); - return (type->isValue() || type->isObject()) && (argType->isValue() || argType->isReference()); + return shouldDereferenceAbstractMetaTypePointer(arg->type()); +} + +bool ShibokenGenerator::shouldDereferenceAbstractMetaTypePointer(const AbstractMetaType* metaType) +{ + const TypeEntry* type = metaType->typeEntry(); + return (type->isValue() || type->isObject()) && (metaType->isValue() || metaType->isReference()); } static QString checkFunctionName(QString baseName, bool genericNumberType, bool checkExact) diff --git a/shibokengenerator.h b/shibokengenerator.h index cc403bd5f..794f63589 100644 --- a/shibokengenerator.h +++ b/shibokengenerator.h @@ -207,9 +207,10 @@ public: static bool isNumber(const AbstractMetaType* type); static bool isPyInt(const TypeEntry* type); static bool isPyInt(const AbstractMetaType* type); - /// Checks if an argument type should be dereferenced by the Python method wrapper - /// before calling the C++ method. + /// Checks if an argument type should be dereferenced by the Python method wrapper before calling the C++ method. static bool shouldDereferenceArgumentPointer(const AbstractMetaArgument* arg); + /// Checks if a meta type should be dereferenced by the Python method wrapper passing it to C++. + static bool shouldDereferenceAbstractMetaTypePointer(const AbstractMetaType* metaType); QString cpythonBaseName(const AbstractMetaClass* metaClass); QString cpythonBaseName(const TypeEntry* type); |