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
QmlFormat Namespace Reference

Typedefs

using DisabledRegions = QMap<quint32, QQmlJS::SourceLocation>

Enumerations

enum class  Directive { On , Off }

Functions

static QLatin1StringView detectNewLine (QStringView code)
static quint32 findLineStartOffset (QStringView m_code, qsizetype pos, QLatin1StringView newLine)
static quint32 findDirectiveEndOffset (QStringView m_code, qsizetype offset, QLatin1StringView newLine)
static QQmlJS::SourceLocation formRegion (QStringView code, const QQmlJS::SourceLocation &off, const QQmlJS::SourceLocation &on, QLatin1StringView newline)
static QStringView commentLineFromLoc (QStringView code, const QQmlJS::SourceLocation &loc, QLatin1StringView newline)
DisabledRegions identifyDisabledRegions (QStringView code, const QList< QQmlJS::SourceLocation > &comments)
std::optional< DirectivedirectiveFromComment (QStringView commentLine)

Variables

static constexpr auto directive = QLatin1StringView("qmlformat")
static constexpr auto onCmd = QLatin1StringView("on")
static constexpr auto offCmd = QLatin1StringView("off")
static constexpr auto commentStartString = QLatin1StringView("//")

Typedef Documentation

◆ DisabledRegions

Enumeration Type Documentation

◆ Directive

enum class QmlFormat::Directive
strong
Enumerator
On 
Off 

Definition at line 27 of file qqmldomformatdirectivescanner_p.h.

Function Documentation

◆ commentLineFromLoc()

QStringView QmlFormat::commentLineFromLoc ( QStringView code,
const QQmlJS::SourceLocation & loc,
QLatin1StringView newline )
static

Definition at line 59 of file qqmldomformatdirectivescanner.cpp.

◆ detectNewLine()

QLatin1StringView QmlFormat::detectNewLine ( QStringView code)
static

Definition at line 17 of file qqmldomformatdirectivescanner.cpp.

◆ directiveFromComment()

std::optional< Directive > QmlFormat::directiveFromComment ( QStringView commentLine)
nodiscard

Definition at line 112 of file qqmldomformatdirectivescanner.cpp.

◆ findDirectiveEndOffset()

quint32 QmlFormat::findDirectiveEndOffset ( QStringView m_code,
qsizetype offset,
QLatin1StringView newLine )
static

Definition at line 35 of file qqmldomformatdirectivescanner.cpp.

◆ findLineStartOffset()

quint32 QmlFormat::findLineStartOffset ( QStringView m_code,
qsizetype pos,
QLatin1StringView newLine )
static

Definition at line 26 of file qqmldomformatdirectivescanner.cpp.

◆ formRegion()

QQmlJS::SourceLocation QmlFormat::formRegion ( QStringView code,
const QQmlJS::SourceLocation & off,
const QQmlJS::SourceLocation & on,
QLatin1StringView newline )
static

Definition at line 51 of file qqmldomformatdirectivescanner.cpp.

◆ identifyDisabledRegions()

DisabledRegions QmlFormat::identifyDisabledRegions ( QStringView code,
const QList< QQmlJS::SourceLocation > & comments )
nodiscard

Definition at line 65 of file qqmldomformatdirectivescanner.cpp.

Variable Documentation

◆ commentStartString

constexpr auto QmlFormat::commentStartString = QLatin1StringView("//")
staticconstexpr

Definition at line 14 of file qqmldomformatdirectivescanner.cpp.

◆ directive

constexpr auto QmlFormat::directive = QLatin1StringView("qmlformat")
staticconstexpr

Definition at line 11 of file qqmldomformatdirectivescanner.cpp.

◆ offCmd

constexpr auto QmlFormat::offCmd = QLatin1StringView("off")
staticconstexpr

Definition at line 13 of file qqmldomformatdirectivescanner.cpp.

◆ onCmd

constexpr auto QmlFormat::onCmd = QLatin1StringView("on")
staticconstexpr

Definition at line 12 of file qqmldomformatdirectivescanner.cpp.