KTextEditor
utils/range.cpp
28 if (startIndex < 0 || endIndex < 0 || closeIndex < 0 || closeIndex < startIndex || endIndex < closeIndex || endIndex < startIndex) {
32 return Range(Cursor::fromString(str.mid(startIndex + 1, closeIndex - startIndex)), Cursor::fromString(str.mid(closeIndex + 2, endIndex - closeIndex - 2)));
156 QByteArray ba = "Cursor[" + QByteArray::number(cursor.line()) + ", " + QByteArray::number(cursor.column()) + ']';
165 ba += QByteArray::number(range.start().line()) + ", " + QByteArray::number(range.start().column()) + " - ";
constexpr int column() const noexcept
Retrieve the column on which this cursor is situated.
Definition cursor.h:192
static Cursor fromString(QStringView str) noexcept
Returns a Cursor created from the string str containing the format "(line, column)".
Definition ktexteditor.cpp:41
QString toString() const
Returns the cursor position as string in the format "(line, column)".
Definition ktexteditor.cpp:65
constexpr int line() const noexcept
Retrieve the line on which this cursor is situated.
Definition cursor.h:174
An object representing lines from a start line to an end line.
Definition linerange.h:41
constexpr int start() const noexcept
Get the start line of this line range.
Definition linerange.h:105
QString toString() const
Returns the line range as string in the format "[start line, end line]".
Definition utils/range.cpp:145
static LineRange fromString(QStringView str) noexcept
Returns a LineRange created from the string str containing the format "[start line,...
Definition utils/range.cpp:94
An object representing a section of text, from one Cursor to another.
Definition include/ktexteditor/range.h:49
constexpr Cursor end() const noexcept
Get the end position of this range.
Definition include/ktexteditor/range.h:163
constexpr Cursor start() const noexcept
Get the start position of this range.
Definition include/ktexteditor/range.h:153
bool confineToRange(Range range) noexcept
Confine this range if necessary to fit within range.
Definition utils/range.cpp:50
void setRange(Range range) noexcept
Set the start and end cursors to range.start() and range.end() respectively.
Definition utils/range.cpp:35
bool expandToRange(Range range) noexcept
Expand this range if necessary to contain range.
Definition utils/range.cpp:67
static Range fromString(QStringView str) noexcept
Returns a Range created from the string str containing the format "[(start-line, start-column),...
Definition utils/range.cpp:22
QString toString() const
Returns the cursor position as string in the format "start-line:start-column,endl-line:end-column".
Definition utils/range.cpp:140
Q_SCRIPTABLE Q_NOREPLY void start()
char * toString(const EngineQuery &query)
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition katetextblock.h:18
KTEXTEDITOR_EXPORT size_t qHash(KTextEditor::Cursor cursor, size_t seed=0) noexcept
QHash function for KTextEditor::Cursor.
Definition ktexteditor.cpp:76
KTEXTEDITOR_EXPORT QDebug operator<<(QDebug s, const MovingCursor *cursor)
qDebug() stream operator.
Definition movingapi.cpp:156
char * data()
QByteArray number(double n, char format, int precision)
QString arg(Args &&... args) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.