HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Friends
v1::text_cursor Class Reference

Public Member Functions

constexpr text_cursor (text_cursor const &) noexcept=default
 
constexpr text_cursor (text_cursor &&) noexcept=default
 
constexpr text_cursoroperator= (text_cursor const &) noexcept=default
 
constexpr text_cursoroperator= (text_cursor &&) noexcept=default
 
constexpr text_cursor (size_t index, bool after, size_t size) noexcept
 Create a new text cursor.
 
constexpr text_cursor neighbor (size_t size) const noexcept
 Return the neighbor cursor.
 
constexpr text_cursor after_neighbor (size_t size) const noexcept
 
constexpr text_cursor before_neighbor (size_t size) const noexcept
 
constexpr bool start_of_text () const noexcept
 
constexpr bool end_of_text (size_t size) const noexcept
 
constexpr size_t index () const noexcept
 
constexpr bool after () const noexcept
 
constexpr bool before () const noexcept
 

Friends

constexpr friend bool operator== (text_cursor const &, text_cursor const &)=default
 
constexpr friend auto operator<=> (text_cursor const &, text_cursor const &)=default
 

Constructor & Destructor Documentation

◆ text_cursor()

constexpr v1::text_cursor::text_cursor ( size_t index,
bool after,
size_t size )
inlineconstexprnoexcept

Create a new text cursor.

Parameters
indexThe character where the cursor is.
afterTrue if the cursor is after the character, false if the cursor is before the character
sizeThe size of the text, used to check for overflow.

Member Function Documentation

◆ neighbor()

constexpr text_cursor v1::text_cursor::neighbor ( size_t size) const
inlineconstexprnoexcept

Return the neighbor cursor.

Parameters
sizeThe text size.
Returns
The cursor that is the neighbor of the this cursor. If this cursor is at start-of-text or end-of-text then this cursor is returned.

The documentation for this class was generated from the following file: