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
qqmldomformatdirectivescanner_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 QMLDOMFORMATSCANNER_P_H
5#define QMLDOMFORMATSCANNER_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 <QtQml/private/qqmljssourcelocation_p.h>
19
20#include <QtCore/QMap>
21
22QT_BEGIN_NAMESPACE
23
24namespace QmlFormat {
25
27enum class Directive { On, Off };
28
29[[nodiscard]] std::optional<Directive> directiveFromComment(QStringView commentLine);
30[[nodiscard]] DisabledRegions identifyDisabledRegions(QStringView code, const QList<QQmlJS::SourceLocation> &comments);
31
32} // end namespace QmlFormat
33
34QT_END_NAMESPACE
35#endif // QMLDOMFORMATSCANNER_P_H
static constexpr auto directive
static QStringView commentLineFromLoc(QStringView code, const QQmlJS::SourceLocation &loc, QLatin1StringView newline)
static constexpr auto onCmd
DisabledRegions identifyDisabledRegions(QStringView code, const QList< QQmlJS::SourceLocation > &comments)
static constexpr auto offCmd
std::optional< Directive > directiveFromComment(QStringView commentLine)
static QQmlJS::SourceLocation formRegion(QStringView code, const QQmlJS::SourceLocation &off, const QQmlJS::SourceLocation &on, QLatin1StringView newline)
static constexpr auto commentStartString
static quint32 findDirectiveEndOffset(QStringView m_code, qsizetype offset, QLatin1StringView newLine)
static quint32 findLineStartOffset(QStringView m_code, qsizetype pos, QLatin1StringView newLine)
static QLatin1StringView detectNewLine(QStringView code)