44 typedef QMap<QString, Annotation> Annotations;
45 typedef QList<Argument> Arguments;
46 typedef QMultiMap<QString, Method> Methods;
47 typedef QMultiMap<QString, Signal> Signals;
48 typedef QMap<QString, Property> Properties;
49 typedef QMap<QString, QSharedDataPointer<Interface> > Interfaces;
50 typedef QMap<QString, QSharedDataPointer<ObjectTree> > Objects;
58 qint64 lineNumber = 1;
59 qint64 columnNumber = 0;
62 class Q_DBUS_EXPORT DiagnosticsReporter
64 Q_DISABLE_COPY_MOVE(DiagnosticsReporter)
66 DiagnosticsReporter() =
default;
67 virtual ~DiagnosticsReporter();
68 virtual void warning(
const SourceLocation &location,
const char *msg, ...)
69 Q_ATTRIBUTE_FORMAT_PRINTF(3, 4) = 0;
70 virtual void error(
const SourceLocation &location,
const char *msg, ...)
71 Q_ATTRIBUTE_FORMAT_PRINTF(3, 4) = 0;
76 SourceLocation location;
80 inline bool operator==(
const Annotation &other)
const
82 return name == other.name && value == other.value;
88 SourceLocation location;
92 inline bool operator==(
const Argument& other)
const
93 {
return name == other.name && type == other.type; }
98 SourceLocation location;
101 Arguments outputArgs;
102 Annotations annotations;
104 inline bool operator==(
const Method& other)
const
105 {
return name == other.name && annotations == other.annotations &&
106 inputArgs == other.inputArgs && outputArgs == other.outputArgs; }
111 SourceLocation location;
113 Arguments outputArgs;
114 Annotations annotations;
116 inline bool operator==(
const Signal& other)
const
117 {
return name == other.name && annotations == other.annotations &&
118 outputArgs == other.outputArgs; }
123 enum Access { Read, Write, ReadWrite };
124 SourceLocation location;
128 Annotations annotations;
130 inline bool operator==(
const Property& other)
const
131 {
return access == other.access && name == other.name &&
132 annotations == other.annotations && type == other.type; }
135 struct Interface:
public QSharedData
137 SourceLocation location;
139 QString introspection;
141 Annotations annotations;
144 Properties properties;
146 inline bool operator==(
const Interface &other)
const
147 {
return !name.isEmpty() && name == other.name; }
150 struct Object:
public QSharedData
152 SourceLocation location;
156 QStringList interfaces;
157 QStringList childObjects;
161 static Interface parseInterface(
const QString &xml, DiagnosticsReporter *reporter =
nullptr);
162 static Interfaces parseInterfaces(
const QString &xml, DiagnosticsReporter *reporter =
nullptr);
163 static Object parseObject(
const QString &xml,
const QString &service = QString(),
164 const QString &path = QString(),
165 DiagnosticsReporter *reporter =
nullptr);
168 QDBusIntrospection();