aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetabuilder.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-02-26 20:21:11 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-02-26 20:24:28 -0300
commit3f6b0576c90960d4474623987ccac2877a34869c (patch)
tree956d6a4848dbec230714cbdf8aad3b0e68524fde /abstractmetabuilder.h
parenteaec9c4a8ace3a91fccb12492d445fc939cb8bf5 (diff)
Added method AbstractMetaBuilder::fixReturnTypeOfConversionOperator(func).
The new method fixes the return type of conversion operators: they should return the target of the conversion as type and not the type of its owner class. fixReturnTypeOfConversionOperator is used in traverseFunctions. An unit test was added for this case. Note that this behaviour could be fixed in the parser. I dare you!
Diffstat (limited to 'abstractmetabuilder.h')
-rw-r--r--abstractmetabuilder.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/abstractmetabuilder.h b/abstractmetabuilder.h
index ca4593e1..dc38d3b1 100644
--- a/abstractmetabuilder.h
+++ b/abstractmetabuilder.h
@@ -112,6 +112,18 @@ public:
void registerHashFunction(FunctionModelItem functionItem);
void registerToStringCapability(FunctionModelItem functionItem);
+ /**
+ * A conversion operator function should not have its owner class as
+ * its return type, but unfortunately it does. This function fixes the
+ * return type of operator functions of this kind making the return type
+ * be the same as it is supposed to generate when used in C++.
+ * If the returned type is a wrapped C++ class, this method also adds the
+ * conversion operator to the collection of external conversions of the
+ * said class.
+ * \param metaFunction conversion operator function to be fixed.
+ */
+ void fixReturnTypeOfConversionOperator(AbstractMetaFunction* metaFunction);
+
void parseQ_Property(AbstractMetaClass *metaClass, const QStringList &declarations);
void setupEquals(AbstractMetaClass *metaClass);
void setupComparable(AbstractMetaClass *metaClass);