aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/xmlutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/ApiExtractor/xmlutils.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/xmlutils.cpp45
1 files changed, 12 insertions, 33 deletions
diff --git a/sources/shiboken6/ApiExtractor/xmlutils.cpp b/sources/shiboken6/ApiExtractor/xmlutils.cpp
index 6edca2fa5..ccacd4ce7 100644
--- a/sources/shiboken6/ApiExtractor/xmlutils.cpp
+++ b/sources/shiboken6/ApiExtractor/xmlutils.cpp
@@ -1,35 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "xmlutils.h"
#include "xmlutils_libxslt.h"
+#include "qtcompat.h"
+
+using namespace Qt::StringLiterals;
+
XQuery::XQuery() = default;
XQuery::~XQuery() = default;
@@ -37,18 +16,18 @@ XQuery::~XQuery() = default;
QString XQuery::evaluate(QString xPathExpression, QString *errorMessage)
{
// XQuery can't have invalid XML characters
- xPathExpression.replace(QLatin1Char('&'), QLatin1String("&"));
- xPathExpression.replace(QLatin1Char('<'), QLatin1String("&lt;"));
+ xPathExpression.replace(u'&', u"&amp;"_s);
+ xPathExpression.replace(u'<', u"&lt;"_s);
return doEvaluate(xPathExpression, errorMessage);
}
-QSharedPointer<XQuery> XQuery::create(const QString &focus, QString *errorMessage)
+std::shared_ptr<XQuery> XQuery::create(const QString &focus, QString *errorMessage)
{
#if defined(HAVE_LIBXSLT)
return libXml_createXQuery(focus, errorMessage);
#else
- *errorMessage = QLatin1String(__FUNCTION__) + QLatin1String(" is not implemented.");
- return QSharedPointer<XQuery>();
+ *errorMessage = QLatin1StringView(__FUNCTION__) + u" is not implemented."_s;
+ return std::shared_ptr<XQuery>();
#endif
}
@@ -57,7 +36,7 @@ QString xsl_transform(const QString &xml, const QString &xsl, QString *errorMess
#if defined(HAVE_LIBXSLT)
return libXslt_transform(xml, xsl, errorMessage);
#else
- *errorMessage = QLatin1String(__FUNCTION__) + QLatin1String(" is not implemented.");
+ *errorMessage = QLatin1StringView(__FUNCTION__) + u" is not implemented."_s;
return xml;
#endif
}