cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
Term::Cursor Class Reference

#include <cpp-terminal/cursor.hpp>

Public Member Functions

 Cursor ()=default
 
 Cursor (const Position &position)
 
std::size_t row () const
 
std::size_t column () const
 
bool empty () const
 
bool operator== (const Term::Cursor &cursor) const
 
bool operator!= (const Term::Cursor &cursor) const
 

Private Attributes

Position m_position
 

Detailed Description

Definition at line 19 of file cursor.hpp.

Constructor & Destructor Documentation

◆ Cursor() [1/2]

Term::Cursor::Cursor ( )
default

◆ Cursor() [2/2]

Term::Cursor::Cursor ( const Position & position)
explicit

Definition at line 12 of file cursor.cpp.

12: m_position(position) {}
Position m_position
Definition cursor.hpp:31

Member Function Documentation

◆ column()

std::size_t Term::Cursor::column ( ) const

Definition at line 16 of file cursor.cpp.

16{ return m_position.column(); }
const Column & column() const noexcept
Definition position.hpp:47

◆ empty()

bool Term::Cursor::empty ( ) const

Definition at line 18 of file cursor.cpp.

18{ return (0 == m_position.row()) && (0 == m_position.column()); }
const Row & row() const noexcept
Definition position.hpp:46

◆ operator!=()

bool Term::Cursor::operator!= ( const Term::Cursor & cursor) const

Definition at line 22 of file cursor.cpp.

22{ return !(*this == cursor); }

◆ operator==()

bool Term::Cursor::operator== ( const Term::Cursor & cursor) const

Definition at line 20 of file cursor.cpp.

20{ return (this->row() == cursor.row()) && (this->column() == cursor.column()); }
std::size_t column() const
Definition cursor.cpp:16
std::size_t row() const
Definition cursor.cpp:14

◆ row()

std::size_t Term::Cursor::row ( ) const

Definition at line 14 of file cursor.cpp.

14{ return m_position.row(); }

Member Data Documentation

◆ m_position

Position Term::Cursor::m_position
private

Definition at line 31 of file cursor.hpp.


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