aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-15 17:45:41 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-06-17 17:44:56 -0300
commit2d7c878bc764d34f4a7649f8adc69f54ebd6eae9 (patch)
tree7f309b469ee652c3fbd87cf4445b5d1e29fd2ac0 /shibokengenerator.cpp
parentc41a765a198af87f59857f251f695d5e2dbca3c3 (diff)
Added method fullPythonFunctionName(func) to ShibokenGenerator.
It accepts an AbstractMetaFunction and returns the full name in Python, including the module namespace. E.g.: "sample.SimpleFile.exists"
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r--shibokengenerator.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index 4a2cc7b98..accc14109 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -212,6 +212,23 @@ QString ShibokenGenerator::wrapperName(const AbstractMetaClass* metaClass)
}
}
+QString ShibokenGenerator::fullPythonFunctionName(const AbstractMetaFunction* func)
+{
+ QString funcName;
+ if (func->isOperatorOverload())
+ funcName = ShibokenGenerator::pythonOperatorFunctionName(func);
+ else
+ funcName = func->name();
+ if (func->ownerClass()) {
+ QString fullName = func->ownerClass()->fullName();
+ if (func->isConstructor())
+ funcName = fullName;
+ else
+ funcName.prepend(fullName + '.');
+ }
+ return funcName;
+}
+
QString ShibokenGenerator::protectedEnumSurrogateName(const AbstractMetaEnum* metaEnum)
{
return metaEnum->fullName().replace(".", "_") + "_Surrogate";