Get detailed information about a file or directory. More...
#include <filesystem_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 | RequiresRom () const |
| Check if the command requires a loaded ROM. | |
| 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 | RequiresLabels () const override |
| Check if the command requires ROM labels. | |
Protected Member Functions inherited from yaze::cli::agent::tools::FileSystemToolBase | |
| absl::StatusOr< std::filesystem::path > | ValidatePath (const std::string &path_str) const |
| Validate and normalize a path for safe access. | |
| std::filesystem::path | GetProjectRoot () const |
| Get the project root directory. | |
| bool | IsPathInProject (const std::filesystem::path &path) const |
| Check if a path is within the project directory. | |
| std::string | FormatFileSize (uintmax_t size_bytes) const |
| Format file size for human-readable output. | |
| std::string | FormatTimestamp (const std::filesystem::file_time_type &time) const |
| Format timestamp for readable output. | |
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 | |
| std::string | GetPermissionString (const std::filesystem::path &path) const |
| Get permission string (Unix-style: rwxrwxrwx) | |
Additional Inherited Members | |
Protected Attributes inherited from yaze::cli::resources::CommandHandler | |
| Rom * | rom_ = nullptr |
| project::YazeProject * | project_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
Get detailed information about a file or directory.
Usage: filesystem-info –path <file|directory> [–format <json|text>]
Returns: size, type, permissions, timestamps, etc. Security: Restricted to project directory
Definition at line 158 of file filesystem_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 160 of file filesystem_tool.h.
|
inline |
Definition at line 162 of file filesystem_tool.h.
|
inlineoverridevirtual |
Get the command usage string.
Implements yaze::cli::resources::CommandHandler.
Definition at line 166 of file filesystem_tool.h.
|
overrideprotectedvirtual |
Validate command arguments.
Override this to check required arguments and perform custom validation. Called before Execute().
Implements yaze::cli::resources::CommandHandler.
Definition at line 455 of file filesystem_tool.cc.
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 460 of file filesystem_tool.cc.
References yaze::cli::resources::OutputFormatter::AddField(), yaze::cli::resources::OutputFormatter::BeginObject(), yaze::cli::resources::OutputFormatter::EndObject(), yaze::cli::agent::tools::FileSystemToolBase::FormatFileSize(), yaze::cli::agent::tools::FileSystemToolBase::FormatTimestamp(), GetPermissionString(), yaze::cli::resources::ArgumentParser::GetString(), and yaze::cli::agent::tools::FileSystemToolBase::ValidatePath().
|
inlineoverrideprotectedvirtual |
Check if the command requires ROM labels.
Override to return false if labels are not needed.
Reimplemented from yaze::cli::resources::CommandHandler.
Definition at line 176 of file filesystem_tool.h.
|
private |
Get permission string (Unix-style: rwxrwxrwx)
Definition at line 532 of file filesystem_tool.cc.
Referenced by Execute().