aboutsummaryrefslogtreecommitdiffstats
path: root/generator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-10-03 11:36:52 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-10-03 11:36:52 -0300
commit44138ada64eb6f9175ea7bb8c05e38f9079fbf8b (patch)
tree3b97e0a7d97f0f23ad965e01879b656cf4478167 /generator.cpp
parentc0d2e563a1aeaf8b32e947248bb5453edd7d2263 (diff)
Added a couple of convenience methods to Generator: isCString and isVoidPointer.
Diffstat (limited to 'generator.cpp')
-rw-r--r--generator.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/generator.cpp b/generator.cpp
index 71964b41e..60ff21d36 100644
--- a/generator.cpp
+++ b/generator.cpp
@@ -384,6 +384,20 @@ bool Generator::isPointer(const AbstractMetaType* type)
|| type->isValuePointer();
}
+bool Generator::isCString(const AbstractMetaType* type)
+{
+ return type->isNativePointer()
+ && type->indirections() == 1
+ && type->name() == "char";
+}
+
+bool Generator::isVoidPointer(const AbstractMetaType* type)
+{
+ return type->isNativePointer()
+ && type->indirections() == 1
+ && type->name() == "void";
+}
+
QString Generator::minimalConstructor(const AbstractMetaType* type) const
{
if (!type || (type->isReference() && Generator::isObjectType(type)))