yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
rom_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_ROM_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_ROM_COMMANDS_H_
3
5
6namespace yaze {
7namespace cli {
8namespace handlers {
9
14 public:
15 std::string GetName() const override { return "rom-info"; }
16 std::string GetDescription() const { return "Display ROM information"; }
17 std::string GetUsage() const override { return "rom-info"; }
18
19 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
20 return absl::OkStatus();
21 }
22
23 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
24 resources::OutputFormatter& formatter) override;
25};
26
31 public:
32 std::string GetName() const override { return "rom-validate"; }
33 std::string GetDescription() const { return "Validate ROM file integrity"; }
34 std::string GetUsage() const override { return "rom-validate"; }
35
36 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
37 return absl::OkStatus();
38 }
39
40 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
41 resources::OutputFormatter& formatter) override;
42};
43
48 public:
49 std::string GetName() const override { return "rom-diff"; }
50 std::string GetDescription() const { return "Compare two ROM files"; }
51 std::string GetUsage() const override {
52 return "rom-diff --rom_a <file> --rom_b <file>";
53 }
54 bool RequiresRom() const override { return false; }
55
56 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
57 return parser.RequireArgs({"rom_a", "rom_b"});
58 }
59
60 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
61 resources::OutputFormatter& formatter) override;
62};
63
68 public:
69 std::string GetName() const override { return "rom-generate-golden"; }
70 std::string GetDescription() const {
71 return "Generate golden ROM file for testing";
72 }
73 std::string GetUsage() const override {
74 return "rom-generate-golden --rom_file <file> --golden_file <file>";
75 }
76 bool RequiresRom() const override { return false; }
77
78 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
79 return parser.RequireArgs({"rom_file", "golden_file"});
80 }
81
82 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
83 resources::OutputFormatter& formatter) override;
84};
85
86} // namespace handlers
87} // namespace cli
88} // namespace yaze
89
90#endif // YAZE_SRC_CLI_HANDLERS_ROM_COMMANDS_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:24
Command handler for comparing ROM files.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
bool RequiresRom() const override
Check if the command requires a loaded ROM.
std::string GetName() const override
Get the command name.
std::string GetUsage() const override
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Command handler for generating golden ROM files.
bool RequiresRom() const override
Check if the command requires a loaded ROM.
std::string GetUsage() const override
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const override
Get the command name.
Command handler for displaying ROM information.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetUsage() const override
Get the command usage string.
std::string GetName() const override
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Command handler for validating ROM files.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetUsage() const override
Get the command usage string.
std::string GetName() const override
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Utility for parsing common CLI argument patterns.
absl::Status RequireArgs(const std::vector< std::string > &required) const
Validate that required arguments are present.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.