KTextEditor
linerange.h
55 Q_DECL_CONSTEXPR LineRange(int start, int end) Q_DECL_NOEXCEPT : m_start(qMin(start, end)), m_end(qMax(start, end))
82 return QLatin1Char('[') + QString::number(m_start) + QLatin1String(", ") + QString::number(m_end) + QLatin1Char(']');
302 return (range.start() <= start()) ? (range.end() > start()) : (range.end() >= end()) ? (range.start() < end()) : contains(range);
344 : (!range.isValid()) ? (*this) : LineRange(qMin(start(), range.start()), qMax(end(), range.end()));
355 Q_DECL_CONSTEXPR inline friend LineRange operator+(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
383 Q_DECL_CONSTEXPR inline friend LineRange operator-(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
410 Q_DECL_CONSTEXPR inline friend LineRange operator&(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
437 Q_DECL_CONSTEXPR inline friend bool operator==(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
450 Q_DECL_CONSTEXPR inline friend bool operator!=(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
464 Q_DECL_CONSTEXPR inline friend bool operator>(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
constexpr int numberOfLines() const Q_DECL_NOEXCEPT
Returns the number of lines separating the start() and end() line.
Definition: linerange.h:254
constexpr bool containsLine(int line) const Q_DECL_NOEXCEPT
Returns true if this range wholly encompasses line.
Definition: linerange.h:288
QString number(int n, int base)
constexpr static LineRange invalid() Q_DECL_NOEXCEPT
Returns an invalid line range.
Definition: linerange.h:70
friend LineRange & operator&=(LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Intersects r1 with r2 and assigns the result to r1.
Definition: linerange.h:423
Q_SCRIPTABLE Q_NOREPLY void start()
QString toString() const
Returns the line range as string in the format "[start line, end line]".
Definition: linerange.h:80
constexpr friend LineRange operator+(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Addition operator.
Definition: linerange.h:355
An object representing lines from a start line to an end line.
Definition: linerange.h:37
friend LineRange & operator-=(LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Subtraction assignment operator.
Definition: linerange.h:396
constexpr friend bool operator==(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Equality operator.
Definition: linerange.h:437
constexpr friend bool operator<(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Less than operator.
Definition: linerange.h:478
constexpr bool overlaps(const LineRange &range) const Q_DECL_NOEXCEPT
Check whether the this range overlaps with range.
Definition: linerange.h:300
constexpr friend bool operator!=(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Inequality operator.
Definition: linerange.h:450
constexpr int start() const Q_DECL_NOEXCEPT
Get the start line of this line range.
Definition: linerange.h:105
KCALENDARCORE_EXPORT uint qHash(const KCalendarCore::Period &key)
void setRange(const LineRange &range) Q_DECL_NOEXCEPT
Set the start and end lines to start and end respectively.
Definition: linerange.h:128
constexpr friend LineRange operator&(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Intersects r1 and r2.
Definition: linerange.h:410
constexpr bool overlapsLine(int line) const Q_DECL_NOEXCEPT
Check whether the range overlaps at least part of line.
Definition: linerange.h:312
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition: katetextblock.h:22
friend LineRange & operator+=(LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Addition assignment operator.
Definition: linerange.h:368
bool expandToRange(const LineRange &range) Q_DECL_NOEXCEPT
Expand this line range if necessary to contain range.
Definition: linerange.h:197
friend QDebug operator<<(QDebug s, const LineRange &range)
qDebug() stream operator.
Definition: linerange.h:486
constexpr friend bool operator>(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Greater than operator.
Definition: linerange.h:464
constexpr LineRange(int start, int end) Q_DECL_NOEXCEPT
Constructor which creates a range from start to end.
Definition: linerange.h:55
constexpr bool contains(const LineRange &range) const Q_DECL_NOEXCEPT
Check whether the this range wholly encompasses range.
Definition: linerange.h:276
constexpr int end() const Q_DECL_NOEXCEPT
Get the end line of this line range.
Definition: linerange.h:115
bool confineToRange(const LineRange &range) Q_DECL_NOEXCEPT
Confine this range if necessary to fit within range.
Definition: linerange.h:221
constexpr LineRange intersect(const LineRange &range) const Q_DECL_NOEXCEPT
Intersects this line range with another, returning the shared lines of the two line ranges.
Definition: linerange.h:327
constexpr bool onSingleLine() const Q_DECL_NOEXCEPT
Check whether this line range is on one line.
Definition: linerange.h:243
constexpr friend LineRange operator-(const LineRange &r1, const LineRange &r2) Q_DECL_NOEXCEPT
Subtraction operator.
Definition: linerange.h:383
char * toString(const EngineQuery &query)
void setRange(int start, int end) Q_DECL_NOEXCEPT
Set the start and end lines to start and end respectively.
Definition: linerange.h:141
constexpr LineRange encompass(const LineRange &range) const Q_DECL_NOEXCEPT
Returns the smallest range which encompasses this line range and the supplied range.
Definition: linerange.h:341
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:50:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:50:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.