Cleaning up and adding comments
This commit is contained in:
@@ -10,8 +10,13 @@ enum EnumActionType {
|
||||
DELETE
|
||||
};
|
||||
|
||||
// Simple fixed-size stack used for undo/redo.
|
||||
// Stores actions describing line insert/delete operations.
|
||||
class TStack {
|
||||
private:
|
||||
// Describes a single text-edit action.
|
||||
// 'action' indicates INSERT or DELETE,
|
||||
// 'text' stores the affected line, and 'index' is the line position.
|
||||
struct TAction {
|
||||
EnumActionType action;
|
||||
std::string text;
|
||||
@@ -24,9 +29,8 @@ private:
|
||||
public:
|
||||
TStack() = default;
|
||||
~TStack() = default;
|
||||
|
||||
void Push(const TAction& action);
|
||||
TAction Pop();
|
||||
void Push(const TAction& action); // Adds a new action to the top of the stack.
|
||||
TAction Pop(); // Removes and returns the most recent action.
|
||||
[[nodiscard]] TAction Peek() const;
|
||||
[[nodiscard]] bool IsEmpty() const;
|
||||
void Clear();
|
||||
|
||||
Reference in New Issue
Block a user