Continue C++ rewrite.

This commit is contained in:
2025-11-25 00:04:58 -08:00
parent bbb23916a0
commit 881e2b3393
13 changed files with 1563 additions and 213 deletions

39
terminal.h Normal file
View File

@@ -0,0 +1,39 @@
#ifndef TERMINAL_HPP
#define TERMINAL_HPP
#include <termios.h>
namespace ke {
/**
* Terminal management class for handling raw mode and terminal operations.
*/
class Terminal {
public:
Terminal();
~Terminal();
// Deleted copy constructor and assignment
Terminal(const Terminal&) = delete;
Terminal& operator=(const Terminal&) = delete;
// Setup and teardown
void setup();
void enable_raw_mode();
void disable_raw_mode();
// Terminal operations
static int get_window_size(int* rows, int* cols);
static void clear_screen();
// Access to original terminal settings
const termios& entry_term() const { return entry_term_; }
private:
termios entry_term_;
bool raw_mode_enabled_;
};
} // namespace ke
#endif // TERMINAL_HPP