diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-07-05 19:11:04 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:17 -0300 |
commit | 2cc6e2afa7b9845ccfc62b9dce72b498034e8de9 (patch) | |
tree | ae6f0d89c25cd95233010dfab80f3af74bf79de4 /typesystem.cpp | |
parent | 31df158c68385c300f6c9b7cb0fe06bb3a789300 (diff) |
Added revision attribute to type entries tags and flags-revision to enum-type tag.
These attributes will be useful to separate the wrapped API in revisions and ease
the task of producing ABI compatible bindings.
Diffstat (limited to 'typesystem.cpp')
-rw-r--r-- | typesystem.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/typesystem.cpp b/typesystem.cpp index 896374a8b..b653bd57b 100644 --- a/typesystem.cpp +++ b/typesystem.cpp @@ -409,6 +409,7 @@ bool Handler::startElement(const QString &, const QString &n, QHash<QString, QString> attributes; attributes["name"] = QString(); attributes["since"] = QString("0"); + attributes["revision"] = QString("0"); switch (element->type) { case StackElement::PrimitiveTypeEntry: @@ -423,6 +424,7 @@ bool Handler::startElement(const QString &, const QString &n, break; case StackElement::EnumTypeEntry: attributes["flags"] = QString(); + attributes["flags-revision"] = QString(); attributes["upper-bound"] = QString(); attributes["lower-bound"] = QString(); attributes["force-integer"] = "no"; @@ -526,6 +528,7 @@ bool Handler::startElement(const QString &, const QString &n, m_error = "no 'name' attribute specified"; return false; } + switch (element->type) { case StackElement::PrimitiveTypeEntry: { QString targetLangName = attributes["target-lang-name"]; @@ -619,6 +622,9 @@ bool Handler::startElement(const QString &, const QString &n, m_database->addFlagsType(ftype); m_database->addType(ftype); + + QString revision = attributes["flags-revision"].isEmpty() ? attributes["revision"] : attributes["flags-revision"]; + setTypeRevision(ftype, revision.toInt()); } } break; @@ -746,10 +752,12 @@ bool Handler::startElement(const QString &, const QString &n, Q_ASSERT(false); }; - if (element->entry) + if (element->entry) { m_database->addType(element->entry); - else + setTypeRevision(element->entry, attributes["revision"].toInt()); + } else { ReportHandler::warning(QString("Type: %1 was rejected by typesystem").arg(name)); + } } else if (element->type == StackElement::InjectDocumentation) { // check the XML tag attributes |