Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qqmljsstreamwriter_p.h
Go to the documentation of this file.
1
// Copyright (C) 2020 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
// Qt-Security score:significant
4
5
#
ifndef
QQMLJSSTREAMWRITER_P_H
6
#
define
QQMLJSSTREAMWRITER_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
18
#
include
<
QtCore
/
QIODevice
>
19
#
include
<
QtCore
/
QList
>
20
#
include
<
QtCore
/
QString
>
21
#
include
<
QtCore
/
QScopedPointer
>
22
#
include
<
utility
>
23
24
QT_BEGIN_NAMESPACE
25
26
class
QQmlJSStreamWriter
27
{
28
public
:
29
QQmlJSStreamWriter(QByteArray *array);
30
31
void
writeStartDocument();
32
void
writeEndDocument();
33
void
writeLibraryImport(
34
QByteArrayView uri,
int
majorVersion,
int
minorVersion, QByteArrayView as = {});
35
void
writeStartObject(QByteArrayView component);
36
void
writeEndObject();
37
void
writeScriptBinding(QByteArrayView name, QByteArrayView rhs);
38
void
writeStringBinding(QByteArrayView name, QAnyStringView value);
39
void
writeNumberBinding(QByteArrayView name, qint64 value);
40
41
// TODO: Drop this once we can drop qmlplugindump. It is substantially weird.
42
void
writeEnumObjectLiteralBinding(
43
QByteArrayView name,
const
QList<std::pair<QAnyStringView,
int
>> &keyValue);
44
45
// TODO: these would look better with generator functions.
46
void
writeArrayBinding(QByteArrayView name,
const
QByteArrayList &elements);
47
void
writeStringListBinding(QByteArrayView name,
const
QList<QAnyStringView> &elements);
48
49
void
write(QByteArrayView data);
50
void
writeBooleanBinding(QByteArrayView name,
bool
value);
51
52
private
:
53
void
writeIndent();
54
void
writePotentialLine(
const
QByteArray &line);
55
void
flushPotentialLinesWithNewlines();
56
57
template
<
typename
String,
typename
ElementHandler>
58
void
doWriteArrayBinding(
59
QByteArrayView name,
const
QList<String> &elements, ElementHandler &&handler);
60
61
int
m_indentDepth;
62
QList<QByteArray> m_pendingLines;
63
int
m_pendingLineLength;
64
bool
m_maybeOneline;
65
QScopedPointer<QIODevice> m_stream;
66
};
67
68
QT_END_NAMESPACE
69
70
#
endif
// QQMLJSSTREAMWRITER_P_H
QAnyStringViewUtils
Definition
qanystringviewutils_p.h:24
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
enquoteByteArray
static QT_BEGIN_NAMESPACE QByteArray enquoteByteArray(QByteArrayView string)
Definition
qqmljsstreamwriter.cpp:16
enquoteAnyString
static QByteArray enquoteAnyString(QAnyStringView string)
Definition
qqmljsstreamwriter.cpp:30
qtdeclarative
src
qmltyperegistrar
qqmljsstreamwriter_p.h
Generated on
for Qt by
1.18.0