summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generator.cpp14
-rw-r--r--generator.h5
2 files changed, 19 insertions, 0 deletions
diff --git a/generator.cpp b/generator.cpp
index 71964b4..60ff21d 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)))
diff --git a/generator.h b/generator.h
index 14b1fef..484327d 100644
--- a/generator.h
+++ b/generator.h
@@ -237,6 +237,11 @@ public:
static bool isObjectType(const AbstractMetaType* metaType);
static bool isObjectType(const AbstractMetaClass* metaClass);
+ /// Returns true if the type is a C string (const char*).
+ static bool isCString(const AbstractMetaType* type);
+ /// Returns true if the type is a void pointer.
+ static bool isVoidPointer(const AbstractMetaType* type);
+
/**
* Tries to build a minimal constructor for the type.
* It will check first for a user defined default constructor.