aboutsummaryrefslogtreecommitdiffstats
path: root/generator.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-07-21 15:32:19 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-07-28 17:40:58 -0300
commit43cb18d6e9367933c1b8c7c17a461ebd45d7d645 (patch)
tree946f87fd85d442056fc46c140158f1e92adefec5 /generator.h
parent652f60b9e0850505696fa43a45ea312a619244e7 (diff)
Added a method to find the minimal constructor for types, plus some convenience methods.
The minimal constructor method tries to build the minimal constructor possible for a given type or class. Checking if a type is an Object Type is a very common task, as is asking if an AbstractMetaType is a pointer to another type. So I added these convenience methods.
Diffstat (limited to 'generator.h')
-rw-r--r--generator.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/generator.h b/generator.h
index 0ebe1b55b..d74839779 100644
--- a/generator.h
+++ b/generator.h
@@ -225,6 +225,23 @@ public:
/// Convenience function for implicitConversions(const TypeEntry* type).
AbstractMetaFunctionList implicitConversions(const AbstractMetaType* metaType) const;
+ /// Check if type is a pointer.
+ static bool isPointer(const AbstractMetaType* type);
+
+ /// Tells if the type or class is an Object (or QObject) Type.
+ static bool isObjectType(const TypeEntry* type);
+ static bool isObjectType(const ComplexTypeEntry* type);
+ static bool isObjectType(const AbstractMetaType* metaType);
+ static bool isObjectType(const AbstractMetaClass* metaClass);
+
+ /**
+ * Tries to build a minimal constructor for the type.
+ * It will check first for a user defined default constructor.
+ * Returns a null string if it fails.
+ */
+ QString minimalConstructor(const TypeEntry* type) const;
+ QString minimalConstructor(const AbstractMetaType* type) const;
+ QString minimalConstructor(const AbstractMetaClass* metaClass) const;
protected:
/**
* Returns the file name used to write the binding code of an AbstractMetaClass.