Validate ROM header and checksums. More...
#include <validation_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. | |
| std::vector< ValidationIssue > | ValidateHeader (Rom *rom) |
| std::vector< ValidationIssue > | ValidateChecksum (Rom *rom) |
| std::vector< ValidationIssue > | ValidateSize (Rom *rom) |
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 | RequiresRom () const |
| Check if the command requires a loaded ROM. | |
| 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. | |
Protected Member Functions inherited from yaze::cli::agent::tools::ValidationToolBase | |
| std::string | FormatIssuesAsJson (const std::vector< ValidationIssue > &issues) const |
| Format validation issues as JSON. | |
| std::string | FormatIssuesAsText (const std::vector< ValidationIssue > &issues) const |
| Format validation issues as text. | |
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. | |
Additional Inherited Members | |
Protected Attributes inherited from yaze::cli::resources::CommandHandler | |
| Rom * | rom_ = nullptr |
| project::YazeProject * | project_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
Validate ROM header and checksums.
Checks:
Usage: rom-validate –rom=<path> [–format=<json|text>]
Definition at line 82 of file validation_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 84 of file validation_tool.h.
|
inline |
Definition at line 86 of file validation_tool.h.
|
inlineoverridevirtual |
Get the command usage string.
Implements yaze::cli::resources::CommandHandler.
Definition at line 90 of file validation_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 95 of file validation_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 124 of file validation_tool.cc.
References yaze::cli::resources::OutputFormatter::AddField(), yaze::cli::agent::tools::ValidationToolBase::FormatIssuesAsJson(), yaze::cli::agent::tools::ValidationToolBase::FormatIssuesAsText(), yaze::cli::resources::ArgumentParser::GetString(), ValidateChecksum(), ValidateHeader(), and ValidateSize().
| std::vector< ValidationIssue > yaze::cli::agent::tools::RomValidateTool::ValidateHeader | ( | Rom * | rom | ) |
Definition at line 150 of file validation_tool.cc.
References yaze::cli::agent::tools::ValidationIssue::kInfo, yaze::cli::agent::tools::ValidationIssue::kWarning, yaze::Rom::ReadByte(), and yaze::Rom::title().
Referenced by Execute(), and yaze::cli::agent::tools::ValidateAllTool::Execute().

| std::vector< ValidationIssue > yaze::cli::agent::tools::RomValidateTool::ValidateChecksum | ( | Rom * | rom | ) |
Definition at line 192 of file validation_tool.cc.
References yaze::cli::agent::tools::ValidationIssue::kError, yaze::cli::agent::tools::ValidationIssue::kInfo, yaze::cli::agent::tools::ValidationIssue::kWarning, yaze::Rom::ReadWord(), and yaze::Rom::size().
Referenced by Execute(), and yaze::cli::agent::tools::ValidateAllTool::Execute().

| std::vector< ValidationIssue > yaze::cli::agent::tools::RomValidateTool::ValidateSize | ( | Rom * | rom | ) |
Definition at line 242 of file validation_tool.cc.
References yaze::cli::agent::tools::ValidationIssue::kInfo, yaze::cli::agent::tools::ValidationIssue::kWarning, and yaze::Rom::size().
Referenced by Execute(), and yaze::cli::agent::tools::ValidateAllTool::Execute().
