Compare two ROM files and identify differences. More...
#include <rom_diff_tool.h>


Public Member Functions | |
| std::string | GetName () const override |
| Get the command name. | |
| std::string | GetDescription () const |
| std::string | GetUsage () const override |
| Get the command usage string. | |
Public Member Functions inherited from yaze::cli::resources::CommandHandler | |
| virtual | ~CommandHandler ()=default |
| absl::Status | Run (const std::vector< std::string > &args, Rom *rom_context, std::string *captured_output=nullptr) |
| Execute the command. | |
| virtual Descriptor | Describe () const |
| Provide metadata for TUI/help summaries. | |
| virtual bool | RequiresLabels () const |
| Check if the command requires ROM labels. | |
| virtual void | SetProjectContext (project::YazeProject *project) |
| Set the YazeProject context. Default implementation does nothing, override if tool needs project info. | |
| virtual void | SetAsarWrapper (core::AsarWrapper *asar_wrapper) |
| Set the AsarWrapper context. Default implementation does nothing, override if tool needs Asar access. | |
| virtual void | SetRomContext (Rom *rom) |
| Set the ROM context for tools that need ROM access. Default implementation stores the ROM pointer for subclass use. | |
Protected Member Functions | |
| absl::Status | ValidateArgs (const resources::ArgumentParser &parser) override |
| Validate command arguments. | |
| 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. | |
Protected Member Functions inherited from yaze::cli::resources::CommandHandler | |
| virtual std::string | GetDefaultFormat () const |
| Get the default output format ("json" or "text") | |
| virtual std::string | GetOutputTitle () const |
| Get the output title for formatting. | |
Private Member Functions | |
| DiffSummary | ComputeDiff (const std::vector< uint8_t > &rom1, const std::vector< uint8_t > &rom2, bool semantic) |
| std::string | CategorizeAddress (uint32_t address) const |
| std::string | DescribeChange (uint32_t address, const std::vector< uint8_t > &old_val, const std::vector< uint8_t > &new_val) const |
| std::string | FormatAsJson (const DiffSummary &summary) const |
| std::string | FormatAsText (const DiffSummary &summary) const |
Additional Inherited Members | |
Protected Attributes inherited from yaze::cli::resources::CommandHandler | |
| Rom * | rom_ = nullptr |
| project::YazeProject * | project_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
Compare two ROM files and identify differences.
Usage: rom-diff –rom1=<path> –rom2=<path> [–semantic] [–format=<json|text>]
Definition at line 51 of file rom_diff_tool.h.
|
inlineoverridevirtual |
Get the command name.
Override this to provide a unique identifier for the command. This is used for command registration and lookup.
Implements yaze::cli::resources::CommandHandler.
Definition at line 53 of file rom_diff_tool.h.
|
inline |
Definition at line 55 of file rom_diff_tool.h.
|
inlineoverridevirtual |
Get the command usage string.
Implements yaze::cli::resources::CommandHandler.
Definition at line 59 of file rom_diff_tool.h.
|
inlineoverrideprotectedvirtual |
Validate command arguments.
Override this to check required arguments and perform custom validation. Called before Execute().
Implements yaze::cli::resources::CommandHandler.
Definition at line 64 of file rom_diff_tool.h.
References yaze::cli::resources::ArgumentParser::RequireArgs().

|
overrideprotectedvirtual |
Execute the command business logic.
Override this to implement command-specific functionality. The ROM is guaranteed to be loaded and labels initialized.
Implements yaze::cli::resources::CommandHandler.
Definition at line 66 of file rom_diff_tool.cc.
References yaze::cli::resources::OutputFormatter::AddField(), ComputeDiff(), FormatAsJson(), FormatAsText(), yaze::cli::resources::ArgumentParser::GetString(), yaze::cli::resources::ArgumentParser::HasFlag(), yaze::Rom::LoadFromFile(), and yaze::Rom::vector().
|
inlineoverrideprotectedvirtual |
Check if the command requires a loaded ROM.
Override to return false if ROM is not needed (e.g., filesystem tools).
Reimplemented from yaze::cli::resources::CommandHandler.
Definition at line 71 of file rom_diff_tool.h.
|
private |
Definition at line 100 of file rom_diff_tool.cc.
References yaze::cli::agent::tools::RomDiff::address, CategorizeAddress(), yaze::cli::agent::tools::RomDiff::category, yaze::cli::agent::tools::DiffSummary::changes_by_category, DescribeChange(), yaze::cli::agent::tools::RomDiff::description, yaze::cli::agent::tools::DiffSummary::diffs, yaze::cli::agent::tools::RomDiff::length, yaze::cli::agent::tools::RomDiff::new_value, yaze::cli::agent::tools::DiffSummary::num_regions, yaze::cli::agent::tools::RomDiff::old_value, and yaze::cli::agent::tools::DiffSummary::total_bytes_changed.
Referenced by Execute().

|
private |
Definition at line 171 of file rom_diff_tool.cc.
Referenced by ComputeDiff(), and DescribeChange().
|
private |
Definition at line 180 of file rom_diff_tool.cc.
References CategorizeAddress(), and yaze::zelda3::category.
Referenced by ComputeDiff().

|
private |
Definition at line 204 of file rom_diff_tool.cc.
References yaze::cli::agent::tools::DiffSummary::changes_by_category, yaze::cli::agent::tools::DiffSummary::diffs, yaze::cli::agent::tools::DiffSummary::num_regions, and yaze::cli::agent::tools::DiffSummary::total_bytes_changed.
Referenced by Execute().
|
private |
Definition at line 246 of file rom_diff_tool.cc.
References yaze::cli::agent::tools::DiffSummary::changes_by_category, yaze::cli::agent::tools::DiffSummary::diffs, yaze::cli::agent::tools::DiffSummary::num_regions, and yaze::cli::agent::tools::DiffSummary::total_bytes_changed.
Referenced by Execute().