yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::RomDoctorCommandHandler Class Reference

ROM doctor command for file integrity validation. More...

#include <rom_doctor_commands.h>

Inheritance diagram for yaze::cli::RomDoctorCommandHandler:
Collaboration diagram for yaze::cli::RomDoctorCommandHandler:

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::string GetDefaultFormat () const override
 Get the default output format ("json" or "text")
 
std::string GetOutputTitle () const override
 Get the output title for formatting.
 
Descriptor Describe () const override
 Provide metadata for TUI/help summaries.
 
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.
 
- 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 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.
 

Additional Inherited Members

- Protected Attributes inherited from yaze::cli::resources::CommandHandler
Romrom_ = nullptr
 
project::YazeProjectproject_ = nullptr
 
core::AsarWrapperasar_wrapper_ = nullptr
 

Detailed Description

ROM doctor command for file integrity validation.

Diagnoses ROM-level issues:

  • File size and header validation
  • SNES checksum verification
  • Expansion status detection
  • Version marker checks
  • Free space analysis

Supports structured JSON output for agent consumption.

Definition at line 20 of file rom_doctor_commands.h.

Member Function Documentation

◆ GetName()

std::string yaze::cli::RomDoctorCommandHandler::GetName ( ) const
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 22 of file rom_doctor_commands.h.

◆ GetDescription()

std::string yaze::cli::RomDoctorCommandHandler::GetDescription ( ) const
inline

Definition at line 24 of file rom_doctor_commands.h.

◆ GetUsage()

std::string yaze::cli::RomDoctorCommandHandler::GetUsage ( ) const
inlineoverridevirtual

Get the command usage string.

Implements yaze::cli::resources::CommandHandler.

Definition at line 28 of file rom_doctor_commands.h.

◆ GetDefaultFormat()

std::string yaze::cli::RomDoctorCommandHandler::GetDefaultFormat ( ) const
inlineoverridevirtual

Get the default output format ("json" or "text")

Reimplemented from yaze::cli::resources::CommandHandler.

Definition at line 32 of file rom_doctor_commands.h.

◆ GetOutputTitle()

std::string yaze::cli::RomDoctorCommandHandler::GetOutputTitle ( ) const
inlineoverridevirtual

Get the output title for formatting.

Reimplemented from yaze::cli::resources::CommandHandler.

Definition at line 34 of file rom_doctor_commands.h.

◆ Describe()

Descriptor yaze::cli::RomDoctorCommandHandler::Describe ( ) const
inlineoverridevirtual

◆ ValidateArgs()

absl::Status yaze::cli::RomDoctorCommandHandler::ValidateArgs ( const resources::ArgumentParser & parser)
inlineoverridevirtual

Validate command arguments.

Override this to check required arguments and perform custom validation. Called before Execute().

Implements yaze::cli::resources::CommandHandler.

Definition at line 45 of file rom_doctor_commands.h.

◆ Execute()

absl::Status yaze::cli::RomDoctorCommandHandler::Execute ( Rom * rom,
const resources::ArgumentParser & parser,
resources::OutputFormatter & formatter )
overridevirtual

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 283 of file rom_doctor_commands.cc.

References yaze::cli::resources::OutputFormatter::AddArrayItem(), yaze::cli::resources::OutputFormatter::AddField(), yaze::cli::DiagnosticReport::AddFinding(), yaze::cli::resources::OutputFormatter::AddHexField(), yaze::cli::resources::OutputFormatter::BeginArray(), yaze::cli::DiagnosticReport::critical_count, yaze::Rom::data(), yaze::cli::resources::OutputFormatter::EndArray(), yaze::cli::DiagnosticReport::error_count, yaze::cli::DiagnosticReport::features, yaze::Rom::filename(), yaze::cli::DiagnosticReport::findings, yaze::cli::DiagnosticFinding::fixable, yaze::cli::RomFeatures::GetVersionString(), yaze::cli::RomFeatures::has_expanded_pointer_tables, yaze::cli::RomFeatures::has_expanded_tile16, yaze::cli::RomFeatures::has_expanded_tile32, yaze::rom::HyruleMagicValidator::HasBank00Erasure(), yaze::cli::resources::ArgumentParser::HasFlag(), yaze::cli::DiagnosticReport::HasProblems(), yaze::cli::DiagnosticFinding::id, yaze::cli::DiagnosticReport::info_count, yaze::cli::RomFeatures::is_vanilla, yaze::cli::resources::OutputFormatter::IsJson(), yaze::rom::HyruleMagicValidator::IsParallelWorlds(), yaze::cli::kChecksumComplementPos, yaze::cli::kCritical, yaze::cli::kError, yaze::cli::kInfo, yaze::cli::kWarning, yaze::cli::DiagnosticFinding::location, yaze::cli::DiagnosticFinding::message, yaze::cli::DiagnosticReport::rom_path, yaze::cli::DiagnosticFinding::severity, yaze::Rom::size(), yaze::cli::DiagnosticFinding::suggested_action, yaze::cli::DiagnosticReport::TotalFindings(), and yaze::cli::DiagnosticReport::warning_count.


The documentation for this class was generated from the following files: