Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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"
20#include "qqmldomlinewriter_p.h"
21
22#include <QtQml/private/qqmljssourcelocation_p.h>
23#include <QtCore/QAtomicInt>
24#include <functional>
25
27namespace QQmlJS {
28namespace Dom {
29
31{
33public:
34 IndentingLineWriter(const SinkF &innerSink, const QString &fileName,
37 int lineNr = 0, int columnNr = 0, int utf16Offset = 0,
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;
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
51private:
52 Q_DISABLE_COPY_MOVE(IndentingLineWriter)
53protected:
55 bool m_fStatusValid = false;
57};
58
59} // namespace Dom
60} // namespace QQmlJS
62#endif
static FormatTextStatus initialStatus(int baseIndent=0)
IndentingLineWriter(const SinkF &innerSink, const QString &fileName, const LineWriterOptions &options=LineWriterOptions(), const FormatTextStatus &initialStatus=FormatTextStatus::initialStatus(), int lineNr=0, int columnNr=0, int utf16Offset=0, QString currentLine=QString())
void reindentAndSplit(const QString &eol, bool eof=false) override
const QString & currentLine() const
const LineWriterOptions & options() const
void eof(bool ensureNewline=true)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
std::function< void(QStringView)> SinkF
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
#define QMLDOM_EXPORT
#define Q_GADGET