Base class for project tools. More...
#include <project_tool.h>
Inherits yaze::cli::resources::CommandHandler.
Inherited by yaze::cli::agent::tools::ProjectDiffTool, yaze::cli::agent::tools::ProjectExportTool, yaze::cli::agent::tools::ProjectImportTool, yaze::cli::agent::tools::ProjectRestoreTool, yaze::cli::agent::tools::ProjectSnapshotTool, and yaze::cli::agent::tools::ProjectStatusTool.

Protected Member Functions | |
| absl::StatusOr< ProjectManager * > | GetProjectManager (AgentContext *context) const |
| Get or create project manager from context. | |
| std::string | FormatEdits (const std::vector< RomEdit > &edits) const |
| Format edit list as text. | |
| std::string | FormatSnapshot (const ProjectSnapshot &snapshot) const |
| Format snapshot info as text. | |
Protected Member Functions inherited from yaze::cli::resources::CommandHandler | |
| virtual absl::Status | ValidateArgs (const ArgumentParser &parser)=0 |
| Validate command arguments. | |
| virtual absl::Status | Execute (Rom *rom, const ArgumentParser &parser, OutputFormatter &formatter)=0 |
| Execute the command business logic. | |
| 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 | |
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 std::string | GetName () const =0 |
| Get the command name. | |
| virtual Descriptor | Describe () const |
| Provide metadata for TUI/help summaries. | |
| virtual std::string | GetUsage () const =0 |
| Get the command usage string. | |
| 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 Attributes inherited from yaze::cli::resources::CommandHandler | |
| Rom * | rom_ = nullptr |
| project::YazeProject * | project_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
Base class for project tools.
Definition at line 226 of file project_tool.h.
|
protected |
Get or create project manager from context.
Definition at line 633 of file project_tool.cc.
Referenced by yaze::cli::agent::tools::ProjectStatusTool::Execute(), yaze::cli::agent::tools::ProjectSnapshotTool::Execute(), yaze::cli::agent::tools::ProjectRestoreTool::Execute(), yaze::cli::agent::tools::ProjectExportTool::Execute(), yaze::cli::agent::tools::ProjectImportTool::Execute(), and yaze::cli::agent::tools::ProjectDiffTool::Execute().
|
protected |
Format edit list as text.
Definition at line 641 of file project_tool.cc.
|
protected |
Format snapshot info as text.
Definition at line 652 of file project_tool.cc.
References yaze::cli::agent::tools::ProjectSnapshot::created, yaze::cli::agent::tools::ProjectSnapshot::description, yaze::cli::agent::tools::ProjectSnapshot::edits, yaze::cli::agent::tools::ProjectToolUtils::FormatChecksum(), yaze::cli::agent::tools::ProjectToolUtils::FormatTimestamp(), yaze::cli::agent::tools::ProjectSnapshot::name, and yaze::cli::agent::tools::ProjectSnapshot::rom_checksum.
