aboutsummaryrefslogtreecommitdiffstats
path: root/generator/shibokengenerator.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-05 13:55:56 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:17:08 -0300
commit50aef1dd4836b5019c60d31c54501ebcd37f72cd (patch)
tree3e9f41435c3ee0da5fdb5ee32b5b9900ad5a5259 /generator/shibokengenerator.h
parent08f29f0d8f456eb1f994b05c21fd04468c95329c (diff)
Improved guessCPythonCheckFunction method to produce an AbstractMetaType for known types.
This is in opposition of simply returning a string with a custom type check. The details are in the docstring in ShibokenGenerator header. Also added a new modification test and refactored here and there in the sample binding type system.
Diffstat (limited to 'generator/shibokengenerator.h')
-rw-r--r--generator/shibokengenerator.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/generator/shibokengenerator.h b/generator/shibokengenerator.h
index 674bbeab2..729dc0bc0 100644
--- a/generator/shibokengenerator.h
+++ b/generator/shibokengenerator.h
@@ -296,7 +296,17 @@ public:
QString cpythonTypeNameExt(const TypeEntry* type);
QString cpythonCheckFunction(const TypeEntry* type, bool genericNumberType = false);
QString cpythonCheckFunction(const AbstractMetaType* metaType, bool genericNumberType = false);
- QString guessCPythonCheckFunction(const QString& type);
+ /**
+ * Receives the argument \p type and tries to find the appropriate AbstractMetaType for it
+ * or a custom type check.
+ * \param type A string representing the type to be discovered.
+ * \param metaType A pointer to an AbstractMetaType pointer, to where write a new meta type object
+ * if one is produced from the \p type string. This object must be deallocated by
+ * the caller. It will set the target variable to NULL, is \p type is a Python type.
+ * \return A custom check if \p type is a custom type, or an empty string if \p metaType
+ * receives an existing type object.
+ */
+ QString guessCPythonCheckFunction(const QString& type, AbstractMetaType** metaType);
QString cpythonIsConvertibleFunction(const TypeEntry* type, bool genericNumberType = false, bool checkExact = false);
QString cpythonIsConvertibleFunction(const AbstractMetaType* metaType, bool genericNumberType = false);
QString cpythonIsConvertibleFunction(const AbstractMetaArgument* metaArg, bool genericNumberType = false)