1#ifndef YAZE_SRC_CLI_HANDLERS_ROM_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_ROM_COMMANDS_H_
15 std::string
GetName()
const override {
return "rom-read"; }
17 return "Read raw bytes from ROM at an address";
20 return "rom-read --address <hex> [--length <bytes>] "
21 "[--data-format <hex|ascii|both>] [--format <json|text>]";
37 std::string
GetName()
const override {
return "rom-write"; }
39 return "Write raw bytes to ROM at an address";
42 return "rom-write --address <hex> --data <hex_string>";
58 std::string
GetName()
const override {
return "rom-info"; }
60 std::string
GetUsage()
const override {
return "rom-info"; }
63 return absl::OkStatus();
75 std::string
GetName()
const override {
return "rom-validate"; }
77 std::string
GetUsage()
const override {
return "rom-validate"; }
80 return absl::OkStatus();
92 std::string
GetName()
const override {
return "rom-diff"; }
95 return "rom-diff --rom_a <file> --rom_b <file>";
112 std::string
GetName()
const override {
return "rom-generate-golden"; }
114 return "Generate golden ROM file for testing";
117 return "rom-generate-golden --rom_file <file> --golden_file <file>";
122 return parser.
RequireArgs({
"rom_file",
"golden_file"});
134 std::string
GetName()
const override {
return "rom-resolve-address"; }
136 return "Resolve an address to a symbol name";
139 return "rom-resolve-address --address <hex> [--max-offset <bytes>]";
155 std::string
GetName()
const override {
return "rom-find-symbol"; }
156 std::string
GetDescription()
const {
return "Find a symbol by name or pattern"; }
158 return "rom-find-symbol --name <string>";
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Command handler for comparing ROM files.
std::string GetDescription() const
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 finding a symbol by name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetDescription() const
std::string GetName() const override
Get the command name.
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.
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.
std::string GetDescription() const
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.
std::string GetDescription() const
Command handler for reading raw ROM bytes.
std::string GetUsage() const override
Get the command usage string.
std::string GetName() const override
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetDescription() const
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Command handler for resolving an address to a symbol.
std::string GetName() const override
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetUsage() const override
Get the command usage string.
std::string GetDescription() const
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.
std::string GetDescription() const
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Command handler for writing raw ROM bytes.
std::string GetDescription() const
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.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
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.