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 std::size_t &row, const std::size_t &column)
 
std::size_t row () const
 
std::size_t column () const
 
void setRow (const std::size_t &)
 
void setColum (const std::size_t &)
 
bool empty () const
 
bool operator== (const Term::Cursor &cursor) const
 
bool operator!= (const Term::Cursor &cursor) const
 

Private Attributes

std::pair< std::size_t, std::size_t > 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 std::size_t & row,
const std::size_t & column )

Definition at line 12 of file cursor.cpp.

12: m_position({row, column}) {}
std::size_t column() const
Definition cursor.cpp:16
std::pair< std::size_t, std::size_t > m_position
Definition cursor.hpp:33
std::size_t row() const
Definition cursor.cpp:14

Member Function Documentation

◆ column()

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

Definition at line 16 of file cursor.cpp.

16{ return m_position.second; }

◆ empty()

bool Term::Cursor::empty ( ) const

Definition at line 18 of file cursor.cpp.

18{ return (0 == m_position.first) && (0 == m_position.second); }

◆ operator!=()

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

Definition at line 26 of file cursor.cpp.

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

◆ operator==()

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

Definition at line 24 of file cursor.cpp.

24{ return (this->row() == cursor.row()) && (this->column() == cursor.column()); }

◆ row()

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

Definition at line 14 of file cursor.cpp.

14{ return m_position.first; }

◆ setColum()

void Term::Cursor::setColum ( const std::size_t & column)

Definition at line 22 of file cursor.cpp.

22{ m_position.second = column; }

◆ setRow()

void Term::Cursor::setRow ( const std::size_t & row)

Definition at line 20 of file cursor.cpp.

20{ m_position.first = row; }

Member Data Documentation

◆ m_position

std::pair<std::size_t, std::size_t> Term::Cursor::m_position
private

Definition at line 33 of file cursor.hpp.


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