summaryrefslogtreecommitdiffstats
path: root/generator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-10-30 19:49:29 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-10-30 19:58:33 -0300
commit4545d7fc24b016d6456da40298a2cf4581e38ec1 (patch)
treeec0a8f8a18572be82d814fda55716d11478c2b19 /generator.cpp
parent2419238d2c1fe4b80e5b5e5767f70bc275aa08a0 (diff)
downloadgeneratorrunner-4545d7fc24b016d6456da40298a2cf4581e38ec1.tar.gz
generatorrunner-4545d7fc24b016d6456da40298a2cf4581e38ec1.tar.xz
generatorrunner-4545d7fc24b016d6456da40298a2cf4581e38ec1.zip
added Generator::implicitConversions(type) method that returns the constructors
for implicit conversions for the given type, which should be a value-type Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Diffstat (limited to 'generator.cpp')
-rw-r--r--generator.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/generator.cpp b/generator.cpp
index d2773bb..4366788 100644
--- a/generator.cpp
+++ b/generator.cpp
@@ -389,6 +389,22 @@ CodeSnipList Generator::getCodeSnips(const AbstractMetaFunction *func)
return result;
}
+AbstractMetaFunctionList Generator::implicitConversions(const TypeEntry* type) const
+{
+ AbstractMetaFunctionList implicits;
+ if (type->isValue()) {
+ const AbstractMetaClass* metaClass = classes().findClass(type->name());
+ if (metaClass)
+ implicits = metaClass->implicitConversions();
+ }
+ return implicits;
+}
+
+AbstractMetaFunctionList Generator::implicitConversions(const AbstractMetaType* metaType) const
+{
+ return implicitConversions(metaType->typeEntry());
+}
+
QString Generator::translateType(const AbstractMetaType *cType,
const AbstractMetaClass *context,
Options options) const