summaryrefslogtreecommitdiffstats
path: root/libshiboken/typeresolver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libshiboken/typeresolver.cpp')
-rw-r--r--libshiboken/typeresolver.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/libshiboken/typeresolver.cpp b/libshiboken/typeresolver.cpp
index a88634a1..d2e042ba 100644
--- a/libshiboken/typeresolver.cpp
+++ b/libshiboken/typeresolver.cpp
@@ -126,3 +126,25 @@ PyTypeObject* TypeResolver::pythonType()
{
return m_d->pyType;
}
+
+TypeResolver::Type TypeResolver::getType(const char* name)
+{
+ std::string typeName(name);
+ int len = typeName.size() - 1;
+ if (len > 1) {
+ if (typeName[len] == '*')
+ typeName.erase(len, 1);
+
+ TypeResolver *resolver = TypeResolver::get(typeName.c_str());
+ if (resolver)
+ return TypeResolver::ValueType;
+
+ typeName += '*';
+ resolver = TypeResolver::get(typeName.c_str());
+ if (resolver)
+ return TypeResolver::ObjectType;
+ }
+
+ return TypeResolver::UnknownType;
+}
+