aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetatype.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-14 15:49:28 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-14 18:55:27 +0000
commit44e40c9aba1bd6f7568cb52827a8a990d0eed78d (patch)
tree7e83e8175f45c9e4f8f58929be79ce3697707210 /sources/shiboken6/ApiExtractor/abstractmetatype.cpp
parenta6dd968379935452462b5785e937c37b3561425f (diff)
shiboken6: Start on a cleanup of the generator code
Start moving some C++ check functions from the generators to MetaLang*. Change-Id: I84c4ba9967b489ddf01c5cdf8919a128b76fd29c Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetatype.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetatype.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp
index 362ae22ef..d3cfec46b 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp
@@ -677,6 +677,32 @@ AbstractMetaType AbstractMetaType::createVoid()
return *metaType.data();
}
+// Query functions for generators
+bool AbstractMetaType::isObjectType() const
+{
+ return d->m_typeEntry->isObject();
+}
+
+bool AbstractMetaType::isPointer() const
+{
+ return !d->m_indirections.isEmpty()
+ || isNativePointer() || isValuePointer();
+}
+
+bool AbstractMetaType::isCString() const
+{
+ return isNativePointer()
+ && d->m_indirections.size() == 1
+ && name() == QLatin1String("char");
+}
+
+bool AbstractMetaType::isVoidPointer() const
+{
+ return isNativePointer()
+ && d->m_indirections.size() == 1
+ && name() == QLatin1String("void");
+}
+
#ifndef QT_NO_DEBUG_STREAM
void AbstractMetaType::formatDebug(QDebug &debug) const
{