yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
hex_inspector_commands.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_HANDLERS_TOOLS_HEX_INSPECTOR_COMMANDS_H
2#define YAZE_CLI_HANDLERS_TOOLS_HEX_INSPECTOR_COMMANDS_H
3
5
6namespace yaze {
7namespace cli {
8
15 public:
16 std::string GetName() const override { return "hex-dump"; }
17
18 std::string GetUsage() const override {
19 return "hex-dump <rom_path> <offset> [size] [--mode snes|pc]";
20 }
21
22 std::string GetDefaultFormat() const override { return "text"; }
23
24 std::string GetOutputTitle() const override { return "Hex Dump"; }
25
26 bool RequiresRom() const override { return false; }
27
28 Descriptor Describe() const override {
29 Descriptor desc;
30 desc.display_name = "hex-dump";
31 desc.summary = "Dump a hex view of a ROM file at a specific offset.";
32 desc.todo_reference = "todo#hex-dump";
33 return desc;
34 }
35
36 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
37
38 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
39 resources::OutputFormatter& formatter) override;
40};
41
48 public:
49 std::string GetName() const override { return "hex-compare"; }
50
51 std::string GetUsage() const override {
52 return "hex-compare <rom1> <rom2> [--start <offset>] [--end <offset>] "
53 "[--mode snes|pc]";
54 }
55
56 std::string GetDefaultFormat() const override { return "text"; }
57
58 std::string GetOutputTitle() const override { return "Hex Compare"; }
59
60 bool RequiresRom() const override { return false; }
61
62 Descriptor Describe() const override {
63 Descriptor desc;
64 desc.display_name = "hex-compare";
65 desc.summary =
66 "Compare two ROM files byte-by-byte with optional region filtering.";
67 return desc;
68 }
69
70 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
71
72 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
73 resources::OutputFormatter& formatter) override;
74};
75
82 public:
83 std::string GetName() const override { return "hex-annotate"; }
84
85 std::string GetUsage() const override {
86 return "hex-annotate <rom_path> <offset> "
87 "[--type auto|room_header|sprite|tile16|message|snes_header]";
88 }
89
90 std::string GetDefaultFormat() const override { return "text"; }
91
92 std::string GetOutputTitle() const override { return "Hex Annotate"; }
93
94 bool RequiresRom() const override { return false; }
95
96 Descriptor Describe() const override {
97 Descriptor desc;
98 desc.display_name = "hex-annotate";
99 desc.summary = "Show known data structure annotations at a ROM offset.";
100 return desc;
101 }
102
103 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
104
105 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
106 resources::OutputFormatter& formatter) override;
107};
108
109} // namespace cli
110} // namespace yaze
111
112#endif // YAZE_CLI_HANDLERS_TOOLS_HEX_INSPECTOR_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
Show known data structure annotations at a ROM offset.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
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 GetOutputTitle() const override
Get the output title for formatting.
bool RequiresRom() const override
Check if the command requires a loaded ROM.
std::string GetUsage() const override
Get the command usage string.
std::string GetName() const override
Get the command name.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
Compare two ROM files byte-by-byte.
std::string GetOutputTitle() const override
Get the output title for formatting.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
bool RequiresRom() const override
Check if the command requires a loaded ROM.
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 GetUsage() const override
Get the command usage string.
Dump a hex view of a ROM file.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
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 GetOutputTitle() const override
Get the output title for formatting.
bool RequiresRom() const override
Check if the command requires a loaded ROM.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
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.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.