diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-02-12 18:18:50 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-02-12 18:35:24 -0200 |
commit | 21151a2f4dc03ef6d62efcfb4a0f1f9d3dcb5183 (patch) | |
tree | 07c45ee29ccf4a2bfb216c00611f2369887c00ca /shibokengenerator.cpp | |
parent | fa5740279daa22be3c424c8fab4468447b3cbcaf (diff) |
Do not export Sbk*Type variables.
To access Sbk*Type variables from other modules, you need to use the array provided via CObjects.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r-- | shibokengenerator.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp index f94155e9c..dfb2a7c92 100644 --- a/shibokengenerator.cpp +++ b/shibokengenerator.cpp @@ -460,6 +460,11 @@ QString ShibokenGenerator::cpythonTypeName(const TypeEntry* type) return cpythonBaseName(type) + "_Type"; } +QString ShibokenGenerator::cpythonTypeNameExt(const TypeEntry* type) +{ + return cppApiVariableName(type->targetLangPackage()) + '[' + getTypeIndexVariableName(type) + ']'; +} + QString ShibokenGenerator::cpythonOperatorFunctionName(const AbstractMetaFunction* func) { if (!func->isOperatorOverload()) @@ -1308,3 +1313,22 @@ bool ShibokenGenerator::usePySideExtensions() const return m_usePySideExtensions; } +QString ShibokenGenerator::cppApiVariableName(const QString& moduleName) const +{ + QString result = moduleName.isEmpty() ? ShibokenGenerator::packageName() : moduleName; + result.replace(".", "_"); + result.prepend("Sbk"); + result.append("Types"); + return result; +} + +QString ShibokenGenerator::getTypeIndexVariableName(const TypeEntry* metaType) +{ + QString res("SBK_"); + res += metaType->qualifiedCppName(); + res.replace("::", "_"); + res.replace("<", "_"); + res.replace(">", "_"); + res += "_IDX"; + return res.toUpper(); +} |