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>
This commit is contained in:
parent
2e8a48c1cd
commit
bcc93850fc
@ -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();
|
||||
|
@ -155,10 +155,11 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
static Interface parseInterface(const QString &xml);
|
||||
static Interfaces parseInterfaces(const QString &xml);
|
||||
static Interface parseInterface(const QString &xml, DiagnosticsReporter *reporter = nullptr);
|
||||
static Interfaces parseInterfaces(const QString &xml, DiagnosticsReporter *reporter = nullptr);
|
||||
static Object parseObject(const QString &xml, const QString &service = QString(),
|
||||
const QString &path = QString());
|
||||
const QString &path = QString(),
|
||||
DiagnosticsReporter *reporter = nullptr);
|
||||
|
||||
private:
|
||||
QDBusIntrospection();
|
||||
|
Loading…
Reference in New Issue
Block a user