summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusintrospection.cpp
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2023-06-30 17:02:37 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2023-07-06 21:51:18 +0200
commitbcc93850fc73689bdd796b19f98cca525636a0fd (patch)
treef3ac413c1ff593a371608cbefeccd733e2f6e93c /src/dbus/qdbusintrospection.cpp
parent2e8a48c1cdc8547ec47f097a41dd53c641715b77 (diff)
QDBusIntrospection: Pass diagnostics reporter to parser
This would allow to emit parser-related diagnostics from tools like qdbusxml2cpp. Also such tools could stop processing if there were parse errors. Task-number: QTBUG-2597 Change-Id: I573296bb57613d5a443b8c4dbe645b7e82f65adc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusintrospection.cpp')
-rw-r--r--src/dbus/qdbusintrospection.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/dbus/qdbusintrospection.cpp b/src/dbus/qdbusintrospection.cpp
index 3f8766636f..484d901ad7 100644
--- a/src/dbus/qdbusintrospection.cpp
+++ b/src/dbus/qdbusintrospection.cpp
@@ -297,11 +297,11 @@ QT_BEGIN_NAMESPACE
If there are multiple interfaces in this XML data, it is undefined which one will be
returned.
*/
-QDBusIntrospection::Interface
-QDBusIntrospection::parseInterface(const QString &xml)
+QDBusIntrospection::Interface QDBusIntrospection::parseInterface(const QString &xml,
+ DiagnosticsReporter *reporter)
{
// be lazy
- Interfaces ifs = parseInterfaces(xml);
+ Interfaces ifs = parseInterfaces(xml, reporter);
if (ifs.isEmpty())
return Interface();
@@ -315,11 +315,11 @@ QDBusIntrospection::parseInterface(const QString &xml)
If the first element tag in this document fragment is \<node\>, the interfaces parsed will
be those found as child elements of the \<node\> tag.
*/
-QDBusIntrospection::Interfaces
-QDBusIntrospection::parseInterfaces(const QString &xml)
+QDBusIntrospection::Interfaces QDBusIntrospection::parseInterfaces(const QString &xml,
+ DiagnosticsReporter *reporter)
{
QString null;
- QDBusXmlParser parser(null, null, xml);
+ QDBusXmlParser parser(null, null, xml, reporter);
return parser.interfaces();
}
@@ -334,10 +334,12 @@ QDBusIntrospection::parseInterfaces(const QString &xml)
This function does not parse the interfaces contained in the node, nor sub-object's contents.
It will only list their names.
*/
-QDBusIntrospection::Object
-QDBusIntrospection::parseObject(const QString &xml, const QString &service, const QString &path)
+QDBusIntrospection::Object QDBusIntrospection::parseObject(const QString &xml,
+ const QString &service,
+ const QString &path,
+ DiagnosticsReporter *reporter)
{
- QDBusXmlParser parser(service, path, xml);
+ QDBusXmlParser parser(service, path, xml, reporter);
QSharedDataPointer<QDBusIntrospection::Object> retval = parser.object();
if (!retval)
return QDBusIntrospection::Object();