yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
palette_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_PALETTE_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_PALETTE_COMMANDS_H_
3
5
6namespace yaze {
7namespace cli {
8namespace handlers {
9
25 public:
26 std::string GetName() const override { return "palette-get-colors"; }
27 std::string GetDescription() const {
28 return "Get colors from a ROM palette group";
29 }
30 std::string GetUsage() const override {
31 return "palette-get-colors --group <group_name> [--index <palette_index>] "
32 "[--format <json|text>]";
33 }
34
35 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
36 return parser.RequireArgs({"group"});
37 }
38
39 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
40 resources::OutputFormatter& formatter) override;
41};
42
56 public:
57 std::string GetName() const override { return "palette-set-color"; }
58 std::string GetDescription() const {
59 return "Set a color in a ROM palette entry";
60 }
61 std::string GetUsage() const override {
62 return "palette-set-color --group <group_name> --palette <palette_index> "
63 "--index <color_index> --color <RRGGBB> [--write] "
64 "[--format <json|text>]";
65 }
66
67 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
68 return parser.RequireArgs({"group", "palette", "index", "color"});
69 }
70
71 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
72 resources::OutputFormatter& formatter) override;
73};
74
86 public:
87 std::string GetName() const override { return "palette-analyze"; }
88 std::string GetDescription() const {
89 return "Analyze palette usage statistics and color properties";
90 }
91 std::string GetUsage() const override {
92 return "palette-analyze [--group <group_name>] [--format <json|text>]";
93 }
94
95 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
96 return absl::OkStatus(); // No required args
97 }
98
99 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
100 resources::OutputFormatter& formatter) override;
101};
102
103} // namespace handlers
104} // namespace cli
105} // namespace yaze
106
107#endif // YAZE_SRC_CLI_HANDLERS_PALETTE_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:28
Command handler for analyzing palette usage statistics.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
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 GetUsage() const override
Get the command usage string.
Command handler for getting palette colors from a ROM.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
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.
Command handler for setting a palette color in the ROM.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
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.
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.