aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-16 11:05:32 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:18 -0300
commitd151c052d5113fbe1e8d1b921dff3b45105e94ab (patch)
tree4b4245ceed20990602ceb48981ae65b53a8c9821 /typesystem.cpp
parent15b355dca205090adf9fe338f02963f945263d98 (diff)
Added setTargetLangPackage and targetLangPackage methods to PrimitiveTypeEntry.sb-0.10.6
Updated tests. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r--typesystem.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/typesystem.cpp b/typesystem.cpp
index 8d52e7aaa..b99cf2fc7 100644
--- a/typesystem.cpp
+++ b/typesystem.cpp
@@ -568,6 +568,7 @@ bool Handler::startElement(const QString &, const QString &n,
type->setCodeGeneration(m_generate);
type->setTargetLangName(targetLangName);
type->setTargetLangApiName(targetLangApiName);
+ type->setTargetLangPackage(m_defaultPackage);
type->setDefaultConstructor(defaultConstructor);
bool preferred;
@@ -1725,6 +1726,20 @@ PrimitiveTypeEntry* PrimitiveTypeEntry::basicAliasedTypeEntry() const
return m_aliasedTypeEntry;
}
+typedef QHash<const PrimitiveTypeEntry*, QString> PrimitiveTypeEntryTargetLangPackageMap;
+Q_GLOBAL_STATIC(PrimitiveTypeEntryTargetLangPackageMap, primitiveTypeEntryTargetLangPackages);
+
+void PrimitiveTypeEntry::setTargetLangPackage(const QString& package)
+{
+ primitiveTypeEntryTargetLangPackages()->insert(this, package);
+}
+QString PrimitiveTypeEntry::targetLangPackage() const
+{
+ if (!primitiveTypeEntryTargetLangPackages()->contains(this))
+ return this->::TypeEntry::targetLangPackage();
+ return primitiveTypeEntryTargetLangPackages()->value(this);
+}
+
CodeSnipList TypeEntry::codeSnips() const
{
return m_codeSnips;
@@ -1742,13 +1757,11 @@ QString Modification::accessModifierString() const
FunctionModificationList ComplexTypeEntry::functionModifications(const QString &signature) const
{
FunctionModificationList lst;
- TypeDatabase *td = TypeDatabase::instance();
for (int i = 0; i < m_functionMods.count(); ++i) {
const FunctionModification &mod = m_functionMods.at(i);
if (mod.signature == signature)
lst << mod;
}
-
return lst;
}