7#include "../utility/module.hpp"
8#include "../unicode/unicode_description.hpp"
13namespace hi::inline
v1 {
47 inplace_min(_value, max_value(size));
51 constexpr text_cursor resize(
size_t size) &&
noexcept
53 inplace_min(_value, max_value(size));
65 _value = (index << 1) | static_cast<size_t>(after);
80 [[nodiscard]]
constexpr text_cursor after_neighbor(
size_t size)
const noexcept
82 return before() ? neighbor(size) : *this;
85 [[nodiscard]]
constexpr text_cursor before_neighbor(
size_t size)
const noexcept
87 return after() ? neighbor(size) : *this;
90 [[nodiscard]]
constexpr bool start_of_text() const noexcept
95 [[nodiscard]]
constexpr bool end_of_text(
size_t size)
const noexcept
97 return _value >= max_value(size);
100 [[nodiscard]]
constexpr size_t index() const noexcept
105 [[nodiscard]]
constexpr bool after() const noexcept
107 return to_bool(_value & 1);
110 [[nodiscard]]
constexpr bool before() const noexcept
121 [[nodiscard]]
constexpr static size_t max_value(
size_t size)
noexcept
DOXYGEN BUG.
Definition algorithm.hpp:13
A cursor-position in text.
Definition text_cursor.hpp:22
constexpr text_cursor & resize(size_t size) &noexcept
Set the text size.
Definition text_cursor.hpp:45
constexpr text_cursor(size_t index, bool after) noexcept
Create a new text cursor.
Definition text_cursor.hpp:63
constexpr text_cursor neighbor(size_t size) const noexcept
Return the neighbor cursor.
Definition text_cursor.hpp:74