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 { return "rom-info"; }
16 std::string GetDescription() const { return "Display ROM information"; }
17 std::string GetUsage() const { 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 { return "rom-validate"; }
33 std::string GetDescription() const { return "Validate ROM file integrity"; }
34 std::string GetUsage() const { 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 { return "rom-diff"; }
50 std::string GetDescription() const { return "Compare two ROM files"; }
51 std::string GetUsage() const { return "rom-diff --rom_a <file> --rom_b <file>"; }
52
53 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
54 return parser.RequireArgs({"rom_a", "rom_b"});
55 }
56
57 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
58 resources::OutputFormatter& formatter) override;
59};
60
65 public:
66 std::string GetName() const { return "rom-generate-golden"; }
67 std::string GetDescription() const { return "Generate golden ROM file for testing"; }
68 std::string GetUsage() const { return "rom-generate-golden --rom_file <file> --golden_file <file>"; }
69
70 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
71 return parser.RequireArgs({"rom_file", "golden_file"});
72 }
73
74 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
75 resources::OutputFormatter& formatter) override;
76};
77
78} // namespace handlers
79} // namespace cli
80} // namespace yaze
81
82#endif // YAZE_SRC_CLI_HANDLERS_ROM_COMMANDS_H_
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
Command handler for comparing ROM files.
std::string GetUsage() const
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Command handler for generating golden ROM files.
std::string GetName() const
Get the command name.
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 GetUsage() const
Get the command usage string.
Command handler for displaying ROM information.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetUsage() const
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const
Get the command name.
Command handler for validating ROM files.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
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.
Main namespace for the application.