From 31302761f0cab83ad412797afe8f39a497b02531 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 2 Oct 2020 12:52:05 +0200 Subject: QmlCompiler: Rename QmlStreamWriter The names should start with a common prefix. Change-Id: Ib2cc247d459d78de5f0a8ea0be73b89429154475 Reviewed-by: Fabian Kosmale --- src/qmlcompiler/CMakeLists.txt | 2 +- src/qmlcompiler/qmlcompiler.pro | 4 +- src/qmlcompiler/qmlstreamwriter.cpp | 190 ------------------------------ src/qmlcompiler/qmlstreamwriter_p.h | 77 ------------ src/qmlcompiler/qqmljsstreamwriter.cpp | 190 ++++++++++++++++++++++++++++++ src/qmlcompiler/qqmljsstreamwriter_p.h | 77 ++++++++++++ src/qmltyperegistrar/.prev_CMakeLists.txt | 2 +- src/qmltyperegistrar/CMakeLists.txt | 2 +- src/qmltyperegistrar/qmltyperegistrar.pro | 4 +- src/qmltyperegistrar/qmltypescreator.h | 4 +- tools/qmlplugindump/.prev_CMakeLists.txt | 2 +- tools/qmlplugindump/CMakeLists.txt | 2 +- tools/qmlplugindump/main.cpp | 8 +- tools/qmlplugindump/qmlplugindump.pro | 4 +- 14 files changed, 284 insertions(+), 284 deletions(-) delete mode 100644 src/qmlcompiler/qmlstreamwriter.cpp delete mode 100644 src/qmlcompiler/qmlstreamwriter_p.h create mode 100644 src/qmlcompiler/qqmljsstreamwriter.cpp create mode 100644 src/qmlcompiler/qqmljsstreamwriter_p.h diff --git a/src/qmlcompiler/CMakeLists.txt b/src/qmlcompiler/CMakeLists.txt index e08189857d..9ff876595c 100644 --- a/src/qmlcompiler/CMakeLists.txt +++ b/src/qmlcompiler/CMakeLists.txt @@ -10,11 +10,11 @@ qt_add_module(QmlCompiler SOURCES qmljsimporter.cpp qmljsimporter_p.h qmljstypereader.cpp qmljstypereader_p.h - qmlstreamwriter.cpp qmlstreamwriter_p.h qqmljsimportedmembersvisitor.cpp qqmljsimportedmembersvisitor_p.h qqmljsmetatypes_p.h qqmljsresourcefilemapper.cpp qqmljsresourcefilemapper_p.h qqmljsscope.cpp qqmljsscope_p.h + qqmljsstreamwriter.cpp qqmljsstreamwriter_p.h typedescriptionreader.cpp typedescriptionreader_p.h PUBLIC_LIBRARIES Qt::CorePrivate diff --git a/src/qmlcompiler/qmlcompiler.pro b/src/qmlcompiler/qmlcompiler.pro index 1649855458..05fd39c98b 100644 --- a/src/qmlcompiler/qmlcompiler.pro +++ b/src/qmlcompiler/qmlcompiler.pro @@ -10,7 +10,7 @@ SOURCES = \ qmljstypereader.cpp \ qqmljsscope.cpp \ typedescriptionreader.cpp \ - qmlstreamwriter.cpp + qqmljsstreamwriter.cpp HEADERS = \ qqmljsresourcefilemapper_p.h \ @@ -20,6 +20,6 @@ HEADERS = \ qqmljsmetatypes_p.h \ qqmljsscope_p.h \ typedescriptionreader_p.h \ - qmlstreamwriter_p.h + qqmljsstreamwriter_p.h load(qt_module) diff --git a/src/qmlcompiler/qmlstreamwriter.cpp b/src/qmlcompiler/qmlstreamwriter.cpp deleted file mode 100644 index b5b9ee0d4a..0000000000 --- a/src/qmlcompiler/qmlstreamwriter.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $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$ -** -****************************************************************************/ - -#include "qmlstreamwriter_p.h" - -#include -#include - -QmlStreamWriter::QmlStreamWriter(QByteArray *array) - : m_indentDepth(0) - , m_pendingLineLength(0) - , m_maybeOneline(false) - , m_stream(new QBuffer(array)) -{ - m_stream->open(QIODevice::WriteOnly); -} - -void QmlStreamWriter::writeStartDocument() -{ -} - -void QmlStreamWriter::writeEndDocument() -{ -} - -void QmlStreamWriter::writeLibraryImport(const QString &uri, int majorVersion, int minorVersion, const QString &as) -{ - m_stream->write(QString::fromLatin1("import %1 %2.%3").arg(uri, QString::number(majorVersion), QString::number(minorVersion)).toUtf8()); - if (!as.isEmpty()) - m_stream->write(QString::fromLatin1(" as %1").arg(as).toUtf8()); - m_stream->write("\n"); -} - -void QmlStreamWriter::writeStartObject(const QString &component) -{ - flushPotentialLinesWithNewlines(); - writeIndent(); - m_stream->write(QString::fromLatin1("%1 {").arg(component).toUtf8()); - ++m_indentDepth; - m_maybeOneline = true; -} - -void QmlStreamWriter::writeEndObject() -{ - if (m_maybeOneline && !m_pendingLines.isEmpty()) { - --m_indentDepth; - for (int i = 0; i < m_pendingLines.size(); ++i) { - m_stream->write(" "); - m_stream->write(m_pendingLines.at(i).trimmed()); - if (i != m_pendingLines.size() - 1) - m_stream->write(";"); - } - m_stream->write(" }\n"); - m_pendingLines.clear(); - m_pendingLineLength = 0; - m_maybeOneline = false; - } else { - flushPotentialLinesWithNewlines(); - --m_indentDepth; - writeIndent(); - m_stream->write("}\n"); - } -} - -void QmlStreamWriter::writeScriptBinding(const QString &name, const QString &rhs) -{ - writePotentialLine(QString::fromLatin1("%1: %2").arg(name, rhs).toUtf8()); -} - -void QmlStreamWriter::writeBooleanBinding(const QString &name, bool value) -{ - writeScriptBinding(name, value ? QLatin1String("true") : QLatin1String("false")); -} - -void QmlStreamWriter::writeArrayBinding(const QString &name, const QStringList &elements) -{ - flushPotentialLinesWithNewlines(); - writeIndent(); - - // try to use a single line - QString singleLine; - singleLine += QString::fromLatin1("%1: [").arg(name); - for (int i = 0; i < elements.size(); ++i) { - singleLine += elements.at(i); - if (i != elements.size() - 1) - singleLine += QLatin1String(", "); - } - singleLine += QLatin1String("]\n"); - if (singleLine.size() + m_indentDepth * 4 < 80) { - m_stream->write(singleLine.toUtf8()); - return; - } - - // write multi-line - m_stream->write(QString::fromLatin1("%1: [\n").arg(name).toUtf8()); - ++m_indentDepth; - for (int i = 0; i < elements.size(); ++i) { - writeIndent(); - m_stream->write(elements.at(i).toUtf8()); - if (i != elements.size() - 1) { - m_stream->write(",\n"); - } else { - m_stream->write("\n"); - } - } - --m_indentDepth; - writeIndent(); - m_stream->write("]\n"); -} - -void QmlStreamWriter::write(const QString &data) -{ - flushPotentialLinesWithNewlines(); - m_stream->write(data.toUtf8()); -} - -void QmlStreamWriter::writeScriptObjectLiteralBinding(const QString &name, const QList > &keyValue) -{ - flushPotentialLinesWithNewlines(); - writeIndent(); - m_stream->write(QString::fromLatin1("%1: {\n").arg(name).toUtf8()); - ++m_indentDepth; - for (int i = 0; i < keyValue.size(); ++i) { - const QString key = keyValue.at(i).first; - const QString value = keyValue.at(i).second; - writeIndent(); - m_stream->write(QString::fromLatin1("%1: %2").arg(key, value).toUtf8()); - if (i != keyValue.size() - 1) { - m_stream->write(",\n"); - } else { - m_stream->write("\n"); - } - } - --m_indentDepth; - writeIndent(); - m_stream->write("}\n"); -} - -void QmlStreamWriter::writeIndent() -{ - m_stream->write(QByteArray(m_indentDepth * 4, ' ')); -} - -void QmlStreamWriter::writePotentialLine(const QByteArray &line) -{ - m_pendingLines.append(line); - m_pendingLineLength += line.size(); - if (m_pendingLineLength >= 80) { - flushPotentialLinesWithNewlines(); - } -} - -void QmlStreamWriter::flushPotentialLinesWithNewlines() -{ - if (m_maybeOneline) - m_stream->write("\n"); - for (const QByteArray &line : qAsConst(m_pendingLines)) { - writeIndent(); - m_stream->write(line); - m_stream->write("\n"); - } - m_pendingLines.clear(); - m_pendingLineLength = 0; - m_maybeOneline = false; -} diff --git a/src/qmlcompiler/qmlstreamwriter_p.h b/src/qmlcompiler/qmlstreamwriter_p.h deleted file mode 100644 index 260923feed..0000000000 --- a/src/qmlcompiler/qmlstreamwriter_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $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$ -** -****************************************************************************/ - -#ifndef QMLSTREAMWRITER_H -#define QMLSTREAMWRITER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. - -#include -#include -#include -#include -#include - -class QmlStreamWriter -{ -public: - QmlStreamWriter(QByteArray *array); - - void writeStartDocument(); - void writeEndDocument(); - void writeLibraryImport(const QString &uri, int majorVersion, int minorVersion, const QString &as = QString()); - //void writeFilesystemImport(const QString &file, const QString &as = QString()); - void writeStartObject(const QString &component); - void writeEndObject(); - void writeScriptBinding(const QString &name, const QString &rhs); - void writeScriptObjectLiteralBinding(const QString &name, const QList > &keyValue); - void writeArrayBinding(const QString &name, const QStringList &elements); - void write(const QString &data); - void writeBooleanBinding(const QString &name, bool value); - -private: - void writeIndent(); - void writePotentialLine(const QByteArray &line); - void flushPotentialLinesWithNewlines(); - - int m_indentDepth; - QList m_pendingLines; - int m_pendingLineLength; - bool m_maybeOneline; - QScopedPointer m_stream; -}; - -#endif // QMLSTREAMWRITER_H diff --git a/src/qmlcompiler/qqmljsstreamwriter.cpp b/src/qmlcompiler/qqmljsstreamwriter.cpp new file mode 100644 index 0000000000..eb11eaa2ae --- /dev/null +++ b/src/qmlcompiler/qqmljsstreamwriter.cpp @@ -0,0 +1,190 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $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$ +** +****************************************************************************/ + +#include "qqmljsstreamwriter_p.h" + +#include +#include + +QQmlJSStreamWriter::QQmlJSStreamWriter(QByteArray *array) + : m_indentDepth(0) + , m_pendingLineLength(0) + , m_maybeOneline(false) + , m_stream(new QBuffer(array)) +{ + m_stream->open(QIODevice::WriteOnly); +} + +void QQmlJSStreamWriter::writeStartDocument() +{ +} + +void QQmlJSStreamWriter::writeEndDocument() +{ +} + +void QQmlJSStreamWriter::writeLibraryImport(const QString &uri, int majorVersion, int minorVersion, const QString &as) +{ + m_stream->write(QString::fromLatin1("import %1 %2.%3").arg(uri, QString::number(majorVersion), QString::number(minorVersion)).toUtf8()); + if (!as.isEmpty()) + m_stream->write(QString::fromLatin1(" as %1").arg(as).toUtf8()); + m_stream->write("\n"); +} + +void QQmlJSStreamWriter::writeStartObject(const QString &component) +{ + flushPotentialLinesWithNewlines(); + writeIndent(); + m_stream->write(QString::fromLatin1("%1 {").arg(component).toUtf8()); + ++m_indentDepth; + m_maybeOneline = true; +} + +void QQmlJSStreamWriter::writeEndObject() +{ + if (m_maybeOneline && !m_pendingLines.isEmpty()) { + --m_indentDepth; + for (int i = 0; i < m_pendingLines.size(); ++i) { + m_stream->write(" "); + m_stream->write(m_pendingLines.at(i).trimmed()); + if (i != m_pendingLines.size() - 1) + m_stream->write(";"); + } + m_stream->write(" }\n"); + m_pendingLines.clear(); + m_pendingLineLength = 0; + m_maybeOneline = false; + } else { + flushPotentialLinesWithNewlines(); + --m_indentDepth; + writeIndent(); + m_stream->write("}\n"); + } +} + +void QQmlJSStreamWriter::writeScriptBinding(const QString &name, const QString &rhs) +{ + writePotentialLine(QString::fromLatin1("%1: %2").arg(name, rhs).toUtf8()); +} + +void QQmlJSStreamWriter::writeBooleanBinding(const QString &name, bool value) +{ + writeScriptBinding(name, value ? QLatin1String("true") : QLatin1String("false")); +} + +void QQmlJSStreamWriter::writeArrayBinding(const QString &name, const QStringList &elements) +{ + flushPotentialLinesWithNewlines(); + writeIndent(); + + // try to use a single line + QString singleLine; + singleLine += QString::fromLatin1("%1: [").arg(name); + for (int i = 0; i < elements.size(); ++i) { + singleLine += elements.at(i); + if (i != elements.size() - 1) + singleLine += QLatin1String(", "); + } + singleLine += QLatin1String("]\n"); + if (singleLine.size() + m_indentDepth * 4 < 80) { + m_stream->write(singleLine.toUtf8()); + return; + } + + // write multi-line + m_stream->write(QString::fromLatin1("%1: [\n").arg(name).toUtf8()); + ++m_indentDepth; + for (int i = 0; i < elements.size(); ++i) { + writeIndent(); + m_stream->write(elements.at(i).toUtf8()); + if (i != elements.size() - 1) { + m_stream->write(",\n"); + } else { + m_stream->write("\n"); + } + } + --m_indentDepth; + writeIndent(); + m_stream->write("]\n"); +} + +void QQmlJSStreamWriter::write(const QString &data) +{ + flushPotentialLinesWithNewlines(); + m_stream->write(data.toUtf8()); +} + +void QQmlJSStreamWriter::writeScriptObjectLiteralBinding(const QString &name, const QList > &keyValue) +{ + flushPotentialLinesWithNewlines(); + writeIndent(); + m_stream->write(QString::fromLatin1("%1: {\n").arg(name).toUtf8()); + ++m_indentDepth; + for (int i = 0; i < keyValue.size(); ++i) { + const QString key = keyValue.at(i).first; + const QString value = keyValue.at(i).second; + writeIndent(); + m_stream->write(QString::fromLatin1("%1: %2").arg(key, value).toUtf8()); + if (i != keyValue.size() - 1) { + m_stream->write(",\n"); + } else { + m_stream->write("\n"); + } + } + --m_indentDepth; + writeIndent(); + m_stream->write("}\n"); +} + +void QQmlJSStreamWriter::writeIndent() +{ + m_stream->write(QByteArray(m_indentDepth * 4, ' ')); +} + +void QQmlJSStreamWriter::writePotentialLine(const QByteArray &line) +{ + m_pendingLines.append(line); + m_pendingLineLength += line.size(); + if (m_pendingLineLength >= 80) { + flushPotentialLinesWithNewlines(); + } +} + +void QQmlJSStreamWriter::flushPotentialLinesWithNewlines() +{ + if (m_maybeOneline) + m_stream->write("\n"); + for (const QByteArray &line : qAsConst(m_pendingLines)) { + writeIndent(); + m_stream->write(line); + m_stream->write("\n"); + } + m_pendingLines.clear(); + m_pendingLineLength = 0; + m_maybeOneline = false; +} diff --git a/src/qmlcompiler/qqmljsstreamwriter_p.h b/src/qmlcompiler/qqmljsstreamwriter_p.h new file mode 100644 index 0000000000..b6a71775f0 --- /dev/null +++ b/src/qmlcompiler/qqmljsstreamwriter_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $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$ +** +****************************************************************************/ + +#ifndef QQMLJSSTREAMWRITER_P_H +#define QQMLJSSTREAMWRITER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#include +#include +#include +#include +#include + +class QQmlJSStreamWriter +{ +public: + QQmlJSStreamWriter(QByteArray *array); + + void writeStartDocument(); + void writeEndDocument(); + void writeLibraryImport(const QString &uri, int majorVersion, int minorVersion, const QString &as = QString()); + //void writeFilesystemImport(const QString &file, const QString &as = QString()); + void writeStartObject(const QString &component); + void writeEndObject(); + void writeScriptBinding(const QString &name, const QString &rhs); + void writeScriptObjectLiteralBinding(const QString &name, const QList > &keyValue); + void writeArrayBinding(const QString &name, const QStringList &elements); + void write(const QString &data); + void writeBooleanBinding(const QString &name, bool value); + +private: + void writeIndent(); + void writePotentialLine(const QByteArray &line); + void flushPotentialLinesWithNewlines(); + + int m_indentDepth; + QList m_pendingLines; + int m_pendingLineLength; + bool m_maybeOneline; + QScopedPointer m_stream; +}; + +#endif // QQMLJSSTREAMWRITER_P_H diff --git a/src/qmltyperegistrar/.prev_CMakeLists.txt b/src/qmltyperegistrar/.prev_CMakeLists.txt index 7c2bfe5de7..5d77e64c67 100644 --- a/src/qmltyperegistrar/.prev_CMakeLists.txt +++ b/src/qmltyperegistrar/.prev_CMakeLists.txt @@ -8,7 +8,7 @@ qt_get_tool_target_name(target_name qmltyperegistrar) qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Types Registrar" SOURCES - ../qmlcompiler/qmlstreamwriter.cpp ../qmlcompiler/qmlstreamwriter_p.h + ../qmlcompiler/qqmljsstreamwriter.cpp ../qmlcompiler/qqmljsstreamwriter_p.h qmltyperegistrar.cpp qmltypesclassdescription.cpp qmltypesclassdescription.h qmltypescreator.cpp qmltypescreator.h diff --git a/src/qmltyperegistrar/CMakeLists.txt b/src/qmltyperegistrar/CMakeLists.txt index 5f6568ac37..1269461c3a 100644 --- a/src/qmltyperegistrar/CMakeLists.txt +++ b/src/qmltyperegistrar/CMakeLists.txt @@ -9,7 +9,7 @@ qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Types Registrar" TOOLS_TARGET Qml # special case SOURCES - ../qmlcompiler/qmlstreamwriter.cpp ../qmlcompiler/qmlstreamwriter_p.h + ../qmlcompiler/qqmljsstreamwriter.cpp ../qmlcompiler/qqmljsstreamwriter_p.h qmltyperegistrar.cpp qmltypesclassdescription.cpp qmltypesclassdescription.h qmltypescreator.cpp qmltypescreator.h diff --git a/src/qmltyperegistrar/qmltyperegistrar.pro b/src/qmltyperegistrar/qmltyperegistrar.pro index eafaab6559..eaee9b6eb4 100644 --- a/src/qmltyperegistrar/qmltyperegistrar.pro +++ b/src/qmltyperegistrar/qmltyperegistrar.pro @@ -11,13 +11,13 @@ QMAKE_TARGET_DESCRIPTION = QML Types Registrar INCLUDEPATH += $$PWD/../qmlcompiler SOURCES += \ - ../qmlcompiler/qmlstreamwriter.cpp \ + ../qmlcompiler/qqmljsstreamwriter.cpp \ qmltyperegistrar.cpp \ qmltypesclassdescription.cpp \ qmltypescreator.cpp HEADERS += \ - ../qmlcompiler/qmlstreamwriter_p.h \ + ../qmlcompiler/qqmljsstreamwriter_p.h \ qmltypesclassdescription.h \ qmltypescreator.h diff --git a/src/qmltyperegistrar/qmltypescreator.h b/src/qmltyperegistrar/qmltypescreator.h index 9fc62f9a9e..2216a8a967 100644 --- a/src/qmltyperegistrar/qmltypescreator.h +++ b/src/qmltyperegistrar/qmltypescreator.h @@ -30,7 +30,7 @@ #define QMLTYPESCREATOR_H #include "qmltypesclassdescription.h" -#include "qmlstreamwriter_p.h" +#include "qqmljsstreamwriter_p.h" #include #include @@ -58,7 +58,7 @@ private: void writeComponents(); QByteArray m_output; - QmlStreamWriter m_qml; + QQmlJSStreamWriter m_qml; QVector m_ownTypes; QVector m_foreignTypes; QString m_module; diff --git a/tools/qmlplugindump/.prev_CMakeLists.txt b/tools/qmlplugindump/.prev_CMakeLists.txt index bf65d71c49..997f0ca446 100644 --- a/tools/qmlplugindump/.prev_CMakeLists.txt +++ b/tools/qmlplugindump/.prev_CMakeLists.txt @@ -8,7 +8,7 @@ qt_get_tool_target_name(target_name qmlplugindump) qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Plugin Metadata Dumper" SOURCES - ../../src/qmlcompiler/qmlstreamwriter.cpp ../../src/qmlcompiler/qmlstreamwriter_p.h + ../../src/qmlcompiler/qqmljsstreamwriter.cpp ../../src/qmlcompiler/qqmljsstreamwriter_p.h main.cpp qmltypereader.cpp qmltypereader.h INCLUDE_DIRECTORIES diff --git a/tools/qmlplugindump/CMakeLists.txt b/tools/qmlplugindump/CMakeLists.txt index d8fdaeee8c..111f7dda24 100644 --- a/tools/qmlplugindump/CMakeLists.txt +++ b/tools/qmlplugindump/CMakeLists.txt @@ -9,7 +9,7 @@ qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Plugin Metadata Dumper" TOOLS_TARGET Qml # special case SOURCES - ../../src/qmlcompiler/qmlstreamwriter.cpp ../../src/qmlcompiler/qmlstreamwriter_p.h + ../../src/qmlcompiler/qqmljsstreamwriter.cpp ../../src/qmlcompiler/qqmljsstreamwriter_p.h main.cpp qmltypereader.cpp qmltypereader.h INCLUDE_DIRECTORIES diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index bfc78f2974..aa78a9c6bc 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -60,7 +60,7 @@ #include #include "qmltypereader.h" -#include "qmlstreamwriter_p.h" +#include "qqmljsstreamwriter_p.h" #ifdef QT_SIMULATOR #include @@ -360,11 +360,11 @@ public: class Dumper { - QmlStreamWriter *qml; + QQmlJSStreamWriter *qml; QString relocatableModuleUri; public: - Dumper(QmlStreamWriter *qml) : qml(qml) {} + Dumper(QQmlJSStreamWriter *qml) : qml(qml) {} void setRelocatableModuleUri(const QString &uri) { @@ -1346,7 +1346,7 @@ int main(int argc, char *argv[]) // start dumping data QByteArray bytes; - QmlStreamWriter qml(&bytes); + QQmlJSStreamWriter qml(&bytes); qml.writeStartDocument(); qml.writeLibraryImport(QLatin1String("QtQuick.tooling"), 1, 2); diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro index 217fe23bbe..2e6e793157 100644 --- a/tools/qmlplugindump/qmlplugindump.pro +++ b/tools/qmlplugindump/qmlplugindump.pro @@ -11,12 +11,12 @@ QTPLUGIN.platforms = qminimal INCLUDEPATH += $$PWD/../../src/qmlcompiler SOURCES += \ - ../../src/qmlcompiler/qmlstreamwriter.cpp \ + ../../src/qmlcompiler/qqmljsstreamwriter.cpp \ main.cpp \ qmltypereader.cpp HEADERS += \ - ../../src/qmlcompiler/qmlstreamwriter_p.h \ + ../../src/qmlcompiler/qqmljsstreamwriter_p.h \ qmltypereader.h macx { -- cgit v1.2.3