aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'typesystem.cpp')
-rw-r--r--typesystem.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/typesystem.cpp b/typesystem.cpp
index b407f2e0b..3c09524a3 100644
--- a/typesystem.cpp
+++ b/typesystem.cpp
@@ -2001,6 +2001,22 @@ QString ContainerTypeEntry::typeName() const
}
}
+static bool strLess(const char* a, const char* b)
+{
+ return ::strcmp(a, b) < 0;
+}
+
+bool TypeEntry::isCppPrimitive() const
+{
+ if (m_name.contains(' '))
+ return true;
+ // Keep this sorted!!
+ static const char* cppTypes[] = { "bool", "char", "double", "float", "int", "long", "short", "wchar_t"};
+ const int N = sizeof(cppTypes)/sizeof(char*);
+
+ const char** res = qBinaryFind(&cppTypes[0], &cppTypes[N], m_name.toAscii().constData(), strLess);
+ return res != &cppTypes[N];
+}
/*
static void injectCode(ComplexTypeEntry *e,