Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmldomindentinglinewriter_p.h
Go to the documentation of this file.
1
// Copyright (C) 2022 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
ifndef
QQMLDOMINDENTIGLINEWRITER_P
5
#
define
QQMLDOMINDENTIGLINEWRITER_P
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
"qqmldom_global.h"
19
#
include
"qqmldomcodeformatter_p.h"
20
#
include
"qqmldomlinewriter_p.h"
21
22
#
include
<
QtQml
/
private
/
qqmljssourcelocation_p
.
h
>
23
#
include
<
QtCore
/
QAtomicInt
>
24
#
include
<
functional
>
25
26
QT_BEGIN_NAMESPACE
27
namespace
QQmlJS
{
28
namespace
Dom
{
29
30
QMLDOM_EXPORT
class
IndentingLineWriter
:
public
LineWriter
31
{
32
Q_GADGET
33
public
:
34
IndentingLineWriter
(
const
SinkF
&
innerSink
,
const
QString
&
fileName
,
35
const
LineWriterOptions
&
options
=
LineWriterOptions
(),
36
const
FormatTextStatus
&
initialStatus
=
FormatTextStatus
::
initialStatus
(),
37
int
lineNr
= 0,
int
columnNr
= 0,
int
utf16Offset
= 0,
38
QString
currentLine
=
QString
())
39
:
LineWriter
(
innerSink
,
fileName
,
options
,
lineNr
,
columnNr
,
utf16Offset
,
currentLine
),
40
m_preCachedStatus
(
initialStatus
)
41
{
42
}
43
void
reindentAndSplit
(
const
QString
&
eol
,
bool
eof
=
false
)
override
;
44
FormatPartialStatus
&
fStatus
();
45
46
void
lineChanged
()
override
{
m_fStatusValid
=
false
; }
47
void
willCommit
()
override
;
48
bool
reindent
()
const
{
return
m_reindent
; }
49
void
setReindent
(
bool
v) {
m_reindent
= v; }
50
51
private
:
52
Q_DISABLE_COPY_MOVE
(
IndentingLineWriter
)
53
protected
:
54
FormatTextStatus
m_preCachedStatus
;
55
bool
m_fStatusValid
=
false
;
56
FormatPartialStatus
m_fStatus
;
57
};
58
59
}
// namespace Dom
60
}
// namespace QQmlJS
61
QT_END_NAMESPACE
62
#
endif
QQmlJS::Dom::FormatPartialStatus
Definition
qqmldomcodeformatter_p.h:204
QQmlJS::Dom::FormatPartialStatus::indentLine
int indentLine()
Definition
qqmldomcodeformatter.cpp:1156
QQmlJS::Dom::IndentingLineWriter
Definition
qqmldomindentinglinewriter_p.h:31
QQmlJS::Dom::IndentingLineWriter::fStatus
FormatPartialStatus & fStatus()
Definition
qqmldomindentinglinewriter.cpp:13
QQmlJS::Dom::IndentingLineWriter::m_fStatusValid
bool m_fStatusValid
Definition
qqmldomindentinglinewriter_p.h:55
QQmlJS::Dom::IndentingLineWriter::m_fStatus
FormatPartialStatus m_fStatus
Definition
qqmldomindentinglinewriter_p.h:56
QQmlJS::Dom::IndentingLineWriter::reindent
bool reindent() const
Definition
qqmldomindentinglinewriter_p.h:48
QQmlJS::Dom::IndentingLineWriter::willCommit
void willCommit() override
Definition
qqmldomindentinglinewriter.cpp:22
QQmlJS::Dom::IndentingLineWriter::setReindent
void setReindent(bool v)
Definition
qqmldomindentinglinewriter_p.h:49
QQmlJS::Dom::IndentingLineWriter::lineChanged
void lineChanged() override
Definition
qqmldomindentinglinewriter_p.h:46
QQmlJS::Dom::LineWriter
Definition
qqmldomlinewriter_p.h:127
QQmlJS::Dom::LineWriter::m_reindent
bool m_reindent
Definition
qqmldomlinewriter_p.h:219
QQmlJS::Dom::LineWriter::m_columnNr
int m_columnNr
Definition
qqmldomlinewriter_p.h:206
QQmlJS::Dom::LineWriter::m_utf16Offset
int m_utf16Offset
Definition
qqmldomlinewriter_p.h:210
QQmlJS::Dom::LineWriter::setLineIndent
void setLineIndent(int indentAmount)
Definition
qqmldomlinewriter.cpp:277
QQmlJS::Dom::Scanner
Definition
qqmldomscanner_p.h:77
QQmlJS::Dom::Token
Definition
qqmldomscanner_p.h:32
QQmlJS::Dom::Token::lexKindIsComment
static bool lexKindIsComment(int kind)
Definition
qqmldomscanner.cpp:248
QQmlJS::Dom
Definition
qqmljsimportvisitor_p.h:37
QQmlJS
Definition
qv4bytecodegenerator_p.h:26
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QMLDOM_EXPORT
#define QMLDOM_EXPORT
Definition
qqmldom_global.h:16
QQmlJS::Dom::Scanner::State
Definition
qqmldomscanner_p.h:80
QQmlJS::Dom::Scanner::State::isMultilineComment
bool isMultilineComment() const
Definition
qqmldomscanner.cpp:436
QQmlJS::Dom::Scanner::State::isMultiline
bool isMultiline() const
Definition
qqmldomscanner.cpp:421
qtdeclarative
src
qmldom
qqmldomindentinglinewriter_p.h
Generated on Sun Sep 29 2024 00:46:09 for Qt by
1.12.0