1// Copyright (C) 2024 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 QQMLDOMLINEWRITERFACTORY_P_H
5#define QQMLDOMLINEWRITERFACTORY_P_H
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 "qqmldomlinewriter_p.h"
19#include "qqmldomindentinglinewriter_p.h"
20
21QT_BEGIN_NAMESPACE
22
23namespace QQmlJS {
24namespace Dom {
25
26inline std::unique_ptr<LineWriter> createLineWriter(const SinkF &innerSink, const QString &fileName,
27 const LineWriterOptions &options)
28{
29 return options.maxLineLength > 0
30 ? std::make_unique<IndentingLineWriter>(args: innerSink, args: fileName, args: options)
31 : std::make_unique<LineWriter>(args: innerSink, args: fileName, args: options);
32}
33
34} // namespace Dom
35} // namespace QQmlJS
36
37QT_END_NAMESPACE
38
39#endif // QQMLDOMLINEWRITERFACTORY_P_H
40

source code of qtdeclarative/src/qmldom/qqmldomlinewriterfactory_p.h