aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-07 16:18:58 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:04 -0300
commit644d7b74d18a5838a7f26de02bd0aa9a212de85c (patch)
treeed946d547d5dc0a6e6893ab22efb412d0ab35716 /typesystem.cpp
parent99d400c0ca0f139714448bc8ab3796495d8b316d (diff)
Added the "default-constructor" attribute to the "primitive-type" tag.
The default-constructor attribute specifies a way to build an instance of a class declared as primitive type using default arguments. Documentation and a test were also added. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r--typesystem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/typesystem.cpp b/typesystem.cpp
index d5f127476..6049ea060 100644
--- a/typesystem.cpp
+++ b/typesystem.cpp
@@ -361,6 +361,7 @@ bool Handler::startElement(const QString &, const QString &n,
attributes["target-lang-api-name"] = QString();
attributes["preferred-conversion"] = "yes";
attributes["preferred-target-lang-type"] = "yes";
+ attributes["default-constructor"] = QString();
break;
case StackElement::ContainerTypeEntry:
attributes["type"] = QString();
@@ -434,6 +435,7 @@ bool Handler::startElement(const QString &, const QString &n,
QString targetLangApiName = attributes["target-lang-api-name"];
QString preferredConversion = attributes["preferred-conversion"].toLower();
QString preferredTargetLangType = attributes["preferred-target-lang-type"].toLower();
+ QString defaultConstructor = attributes["default-constructor"];
if (targetLangName.isEmpty())
targetLangName = name;
@@ -444,6 +446,7 @@ bool Handler::startElement(const QString &, const QString &n,
type->setCodeGeneration(m_generate);
type->setTargetLangName(targetLangName);
type->setTargetLangApiName(targetLangApiName);
+ type->setDefaultConstructor(defaultConstructor);
bool preferred;
preferred = convertBoolean(preferredConversion, "preferred-conversion", true);