diff options
author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2023-06-30 17:02:37 +0200 |
---|---|---|
committer | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2023-07-06 21:51:15 +0200 |
commit | 2e8a48c1cdc8547ec47f097a41dd53c641715b77 (patch) | |
tree | a02f7aaaf06318600e5d96f7f52b2a5f948ef1e0 /src/dbus/qdbusintrospection_p.h | |
parent | d625b9bc47c05a83e2fd52e70ba0ee26b20bdb26 (diff) |
QDBusIntrospection: Add Annotation struct
Add a structure for annotation data containing
name, value and location information. This is done
to be able to emit diagnostics related to annotations
that include source location.
Task-number: QTBUG-2597
Change-Id: Ie990bcd0a16752b5f44f4314f8d730dd1b1a30b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusintrospection_p.h')
-rw-r--r-- | src/dbus/qdbusintrospection_p.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/dbus/qdbusintrospection_p.h b/src/dbus/qdbusintrospection_p.h index 209d1386ae..38a7d5cc66 100644 --- a/src/dbus/qdbusintrospection_p.h +++ b/src/dbus/qdbusintrospection_p.h @@ -38,9 +38,10 @@ public: struct Interface; struct Object; struct ObjectTree; + struct Annotation; // typedefs - typedef QMap<QString, QString> Annotations; + typedef QMap<QString, Annotation> Annotations; typedef QList<Argument> Arguments; typedef QMultiMap<QString, Method> Methods; typedef QMultiMap<QString, Signal> Signals; @@ -116,6 +117,18 @@ public: annotations == other.annotations && type == other.type; } }; + struct Annotation + { + SourceLocation location; + QString name; + QString value; + + inline bool operator==(const Annotation &other) const + { + return name == other.name && value == other.value; + } + }; + struct Interface: public QSharedData { SourceLocation location; |