aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-02 12:52:05 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-05 14:58:58 +0200
commit31302761f0cab83ad412797afe8f39a497b02531 (patch)
treeb8db32c966491bc2c42e352518203dbad9dc63dc /src/qmlcompiler
parent4f44f82b9f152572222d5d9db78faa5c1db3413c (diff)
QmlCompiler: Rename QmlStreamWriter
The names should start with a common prefix. Change-Id: Ib2cc247d459d78de5f0a8ea0be73b89429154475 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler')
-rw-r--r--src/qmlcompiler/CMakeLists.txt2
-rw-r--r--src/qmlcompiler/qmlcompiler.pro4
-rw-r--r--src/qmlcompiler/qqmljsstreamwriter.cpp (renamed from src/qmlcompiler/qmlstreamwriter.cpp)30
-rw-r--r--src/qmlcompiler/qqmljsstreamwriter_p.h (renamed from src/qmlcompiler/qmlstreamwriter_p.h)10
4 files changed, 23 insertions, 23 deletions
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/qqmljsstreamwriter.cpp
index b5b9ee0d4a..eb11eaa2ae 100644
--- a/src/qmlcompiler/qmlstreamwriter.cpp
+++ b/src/qmlcompiler/qqmljsstreamwriter.cpp
@@ -26,12 +26,12 @@
**
****************************************************************************/
-#include "qmlstreamwriter_p.h"
+#include "qqmljsstreamwriter_p.h"
#include <QtCore/QBuffer>
#include <QtCore/QStringList>
-QmlStreamWriter::QmlStreamWriter(QByteArray *array)
+QQmlJSStreamWriter::QQmlJSStreamWriter(QByteArray *array)
: m_indentDepth(0)
, m_pendingLineLength(0)
, m_maybeOneline(false)
@@ -40,15 +40,15 @@ QmlStreamWriter::QmlStreamWriter(QByteArray *array)
m_stream->open(QIODevice::WriteOnly);
}
-void QmlStreamWriter::writeStartDocument()
+void QQmlJSStreamWriter::writeStartDocument()
{
}
-void QmlStreamWriter::writeEndDocument()
+void QQmlJSStreamWriter::writeEndDocument()
{
}
-void QmlStreamWriter::writeLibraryImport(const QString &uri, int majorVersion, int minorVersion, const QString &as)
+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())
@@ -56,7 +56,7 @@ void QmlStreamWriter::writeLibraryImport(const QString &uri, int majorVersion, i
m_stream->write("\n");
}
-void QmlStreamWriter::writeStartObject(const QString &component)
+void QQmlJSStreamWriter::writeStartObject(const QString &component)
{
flushPotentialLinesWithNewlines();
writeIndent();
@@ -65,7 +65,7 @@ void QmlStreamWriter::writeStartObject(const QString &component)
m_maybeOneline = true;
}
-void QmlStreamWriter::writeEndObject()
+void QQmlJSStreamWriter::writeEndObject()
{
if (m_maybeOneline && !m_pendingLines.isEmpty()) {
--m_indentDepth;
@@ -87,17 +87,17 @@ void QmlStreamWriter::writeEndObject()
}
}
-void QmlStreamWriter::writeScriptBinding(const QString &name, const QString &rhs)
+void QQmlJSStreamWriter::writeScriptBinding(const QString &name, const QString &rhs)
{
writePotentialLine(QString::fromLatin1("%1: %2").arg(name, rhs).toUtf8());
}
-void QmlStreamWriter::writeBooleanBinding(const QString &name, bool value)
+void QQmlJSStreamWriter::writeBooleanBinding(const QString &name, bool value)
{
writeScriptBinding(name, value ? QLatin1String("true") : QLatin1String("false"));
}
-void QmlStreamWriter::writeArrayBinding(const QString &name, const QStringList &elements)
+void QQmlJSStreamWriter::writeArrayBinding(const QString &name, const QStringList &elements)
{
flushPotentialLinesWithNewlines();
writeIndent();
@@ -133,13 +133,13 @@ void QmlStreamWriter::writeArrayBinding(const QString &name, const QStringList &
m_stream->write("]\n");
}
-void QmlStreamWriter::write(const QString &data)
+void QQmlJSStreamWriter::write(const QString &data)
{
flushPotentialLinesWithNewlines();
m_stream->write(data.toUtf8());
}
-void QmlStreamWriter::writeScriptObjectLiteralBinding(const QString &name, const QList<QPair<QString, QString> > &keyValue)
+void QQmlJSStreamWriter::writeScriptObjectLiteralBinding(const QString &name, const QList<QPair<QString, QString> > &keyValue)
{
flushPotentialLinesWithNewlines();
writeIndent();
@@ -161,12 +161,12 @@ void QmlStreamWriter::writeScriptObjectLiteralBinding(const QString &name, const
m_stream->write("}\n");
}
-void QmlStreamWriter::writeIndent()
+void QQmlJSStreamWriter::writeIndent()
{
m_stream->write(QByteArray(m_indentDepth * 4, ' '));
}
-void QmlStreamWriter::writePotentialLine(const QByteArray &line)
+void QQmlJSStreamWriter::writePotentialLine(const QByteArray &line)
{
m_pendingLines.append(line);
m_pendingLineLength += line.size();
@@ -175,7 +175,7 @@ void QmlStreamWriter::writePotentialLine(const QByteArray &line)
}
}
-void QmlStreamWriter::flushPotentialLinesWithNewlines()
+void QQmlJSStreamWriter::flushPotentialLinesWithNewlines()
{
if (m_maybeOneline)
m_stream->write("\n");
diff --git a/src/qmlcompiler/qmlstreamwriter_p.h b/src/qmlcompiler/qqmljsstreamwriter_p.h
index 260923feed..b6a71775f0 100644
--- a/src/qmlcompiler/qmlstreamwriter_p.h
+++ b/src/qmlcompiler/qqmljsstreamwriter_p.h
@@ -26,8 +26,8 @@
**
****************************************************************************/
-#ifndef QMLSTREAMWRITER_H
-#define QMLSTREAMWRITER_H
+#ifndef QQMLJSSTREAMWRITER_P_H
+#define QQMLJSSTREAMWRITER_P_H
//
// W A R N I N G
@@ -45,10 +45,10 @@
#include <QtCore/QScopedPointer>
#include <QtCore/QPair>
-class QmlStreamWriter
+class QQmlJSStreamWriter
{
public:
- QmlStreamWriter(QByteArray *array);
+ QQmlJSStreamWriter(QByteArray *array);
void writeStartDocument();
void writeEndDocument();
@@ -74,4 +74,4 @@ private:
QScopedPointer<QIODevice> m_stream;
};
-#endif // QMLSTREAMWRITER_H
+#endif // QQMLJSSTREAMWRITER_P_H