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

#include <atlas_commands.h>

Inheritance diagram for yaze::cli::handlers::AtlasRenderCommandHandler:
Collaboration diagram for yaze::cli::handlers::AtlasRenderCommandHandler:

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.
 
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.
 
absl::Status ExecuteWithContext (Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter, const resources::CommandInvocationContext &invocation_context) override
 Execute with immutable, invocation-scoped ROM path identity.
 
- 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.
 
virtual void SetAssemblySymbolTable (const std::map< std::string, core::AsarSymbol > *table)
 Optional Asar symbol table for assembly-aware tools.
 
virtual void SetSymbolProvider (emu::debug::SymbolProvider *provider)
 Set the SymbolProvider context.
 

Private Member Functions

std::string GetDefaultFormat () const override
 Get the default output format ("json" or "text")
 
std::string GetOutputTitle () const override
 Get the output title for formatting.
 

Additional Inherited Members

- Protected Attributes inherited from yaze::cli::resources::CommandHandler
Rom * rom_ = nullptr
 
emu::debug::SymbolProvider * symbol_provider_ = nullptr
 
project::YazeProject * project_ = nullptr
 
core::AsarWrapper * asar_wrapper_ = nullptr
 
const std::map< std::string, core::AsarSymbol > * assembly_symbol_table_
 

Detailed Description

Definition at line 24 of file atlas_commands.h.

Member Function Documentation

◆ GetName()

std::string yaze::cli::handlers::AtlasRenderCommandHandler::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 26 of file atlas_commands.h.

◆ GetDescription()

std::string yaze::cli::handlers::AtlasRenderCommandHandler::GetDescription ( ) const
inline

Definition at line 27 of file atlas_commands.h.

◆ GetUsage()

std::string yaze::cli::handlers::AtlasRenderCommandHandler::GetUsage ( ) const
inlineoverridevirtual

Get the command usage string.

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

Definition at line 31 of file atlas_commands.h.

◆ ValidateArgs()

absl::Status yaze::cli::handlers::AtlasRenderCommandHandler::ValidateArgs ( const resources::ArgumentParser & parser)
overridevirtual

Validate command arguments.

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

Definition at line 64 of file atlas_commands.cc.

References yaze::cli::resources::ArgumentParser::GetString().

Referenced by ExecuteWithContext().

Here is the call graph for this function:

◆ Execute()

absl::Status yaze::cli::handlers::AtlasRenderCommandHandler::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 91 of file atlas_commands.cc.

References yaze::cli::resources::CommandInvocationContext::active_rom_path, ExecuteWithContext(), yaze::Rom::filename(), and yaze::cli::resources::CommandInvocationContext::source_rom_path.

Here is the call graph for this function:

◆ ExecuteWithContext()

absl::Status yaze::cli::handlers::AtlasRenderCommandHandler::ExecuteWithContext ( Rom * rom,
const resources::ArgumentParser & parser,
resources::OutputFormatter & formatter,
const resources::CommandInvocationContext & invocation_context )
overridevirtual

Execute with immutable, invocation-scoped ROM path identity.

Handlers that protect filesystem outputs from aliasing a source or sandbox ROM can override this hook. Existing handlers continue through Execute() without carrying mutable state on singleton handler instances.

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

Definition at line 102 of file atlas_commands.cc.

References yaze::cli::resources::OutputFormatter::AddArrayItem(), yaze::cli::resources::OutputFormatter::AddField(), yaze::zelda3::atlas::DungeonAtlas::annotation_files, yaze::zelda3::atlas::DungeonAtlas::areas, ASSIGN_OR_RETURN, yaze::project::YazeProject::atlas, yaze::project::YazeProject::AtlasAnnotationPaths(), yaze::project::YazeProject::AtlasSymbolsPath(), yaze::cli::resources::OutputFormatter::BeginArray(), yaze::cli::resources::OutputFormatter::BeginObject(), yaze::zelda3::atlas::BuildDungeonAtlas(), yaze::zelda3::atlas::CollectDungeonAtlasInput(), yaze::zelda3::atlas::DungeonAtlas::counts, yaze::project::AtlasSettings::defaults, yaze::zelda3::atlas::DungeonAtlasToJson(), yaze::core::ProjectRegistry::dungeons, yaze::zelda3::atlas::DungeonAtlas::edges, yaze::cli::resources::OutputFormatter::EndArray(), yaze::cli::resources::OutputFormatter::EndObject(), yaze::Rom::filename(), yaze::zelda3::atlas::DungeonAtlasCounts::free, yaze::zelda3::atlas::DungeonAtlasJsonContext::generator, yaze::project::YazeProject::GetAbsolutePath(), yaze::zelda3::GetResourceLabels(), yaze::cli::resources::ArgumentParser::GetString(), yaze::project::YazeProject::hack_manifest, yaze::zelda3::atlas::DungeonAtlasCounts::in_use, yaze::zelda3::atlas::DungeonAtlasCounts::interior, yaze::Rom::is_loaded(), yaze::zelda3::atlas::kDungeonAtlasJsonSchema, yaze::zelda3::atlas::LoadAtlasAnnotations(), yaze::Rom::LoadFromFile(), yaze::zelda3::atlas::DungeonAtlasCollectOptions::manifest, yaze::zelda3::atlas::AtlasRomIdentity::name, yaze::project::YazeProject::Open(), yaze::zelda3::atlas::DungeonAtlasCounts::orphan, yaze::zelda3::atlas::DungeonAtlas::owners_from_project, yaze::zelda3::atlas::DungeonAtlasJsonContext::project, yaze::core::HackManifest::project_registry(), yaze::zelda3::atlas::DungeonAtlasCounts::reclaimable, yaze::zelda3::atlas::DungeonAtlasCollectOptions::registry, yaze::cli::resources::RejectArtifactRomAliases(), yaze::zelda3::atlas::DungeonAtlasCounts::reserved, yaze::cli::resources::ResolveStableArtifactPath(), RETURN_IF_ERROR, yaze::zelda3::atlas::DungeonAtlas::rom, yaze::zelda3::atlas::AtlasRomIdentity::sha1, yaze::zelda3::atlas::DungeonAtlasCollectOptions::symbol_links, yaze::project::AtlasSettings::symbols, yaze::project::YazeProject::symbols_filename, yaze::zelda3::atlas::DungeonAtlasCollectOptions::symbols_path, ValidateArgs(), yaze::zelda3::atlas::DungeonAtlasCollectOptions::vanilla_rom, yaze::zelda3::atlas::DungeonAtlas::warnings, and YAZE_VERSION_STRING.

Referenced by Execute().

◆ GetDefaultFormat()

std::string yaze::cli::handlers::AtlasRenderCommandHandler::GetDefaultFormat ( ) const
inlineoverrideprivatevirtual

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

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

Definition at line 46 of file atlas_commands.h.

◆ GetOutputTitle()

std::string yaze::cli::handlers::AtlasRenderCommandHandler::GetOutputTitle ( ) const
inlineoverrideprivatevirtual

Get the output title for formatting.

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

Definition at line 47 of file atlas_commands.h.


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