SVCS - English Documentation
Loading...
Searching...
No Matches
RemoveCommand.hxx
Go to the documentation of this file.
1
13#pragma once
14
15#include "ICommand.hxx"
18
19#include <memory>
20#include <string>
21#include <vector>
22
36namespace svcs::cli {
38using namespace svcs::core;
39
51class RemoveCommand : public ICommand {
52private:
60 std::shared_ptr<ISubject> eventBus_;
61
69 std::shared_ptr<RepositoryManager> repoManager_;
70
71public:
83 RemoveCommand(std::shared_ptr<ISubject> subject,
84 std::shared_ptr<RepositoryManager> repoManager);
85
97 bool execute(const std::vector<std::string>& args) override;
98
108 [[nodiscard]] std::string getName() const override { return "remove"; }
109
119 [[nodiscard]] std::string getDescription() const override;
120
130 [[nodiscard]] std::string getUsage() const override;
131
139 void showHelp() const override;
140
141private:
153 bool removeFileFromStaging(const std::string& filePath) const;
154
164 bool removeAllFromStaging() const;
165
175 [[nodiscard]] bool confirmRemoveAll() const;
176};
177
178}
Declaration of the ICommand interface for all executable CLI commands.
Defines the interface for the Subject (Publisher) component of the Observer pattern.
Declaration of the RepositoryManager class, managing all repository-level file operations.
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
std::string getUsage() const override
Gets the usage syntax of the command.
Definition RemoveCommand.cxx:126
bool execute(const std::vector< std::string > &args) override
Executes the remove command.
Definition RemoveCommand.cxx:26
std::string getName() const override
Gets the name of the command.
Definition RemoveCommand.hxx:74
std::string getDescription() const override
Gets the description of the command.
Definition RemoveCommand.cxx:122
void showHelp() const override
Shows detailed help information for this command.
Definition RemoveCommand.cxx:130
RemoveCommand(std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager)
Constructs the RemoveCommand.
Definition RemoveCommand.cxx:21
Command-line interface components and command implementations.
Core VCS data structures and object model.