Project manager for snapshot and version control. More...
#include <project_tool.h>
Public Member Functions | |
| ProjectManager ()=default | |
| absl::Status | Initialize (const std::string &base_path) |
| Initialize project directory structure. | |
| absl::Status | CreateSnapshot (const std::string &name, const std::string &description, const std::vector< RomEdit > &edits, const std::array< uint8_t, 32 > &rom_checksum) |
| Create a named snapshot of current state. | |
| absl::Status | RestoreSnapshot (const std::string &name, Rom *rom) |
| Restore ROM to a named snapshot. | |
| std::vector< std::string > | ListSnapshots () const |
| List all available snapshots. | |
| absl::StatusOr< ProjectSnapshot > | GetSnapshot (const std::string &name) const |
| Get snapshot details. | |
| absl::Status | DeleteSnapshot (const std::string &name) |
| Delete a snapshot. | |
| absl::Status | ExportProject (const std::string &export_path, bool include_rom=false) |
| Export project as portable archive. | |
| absl::Status | ImportProject (const std::string &archive_path) |
| Import project archive. | |
| absl::StatusOr< std::string > | DiffSnapshots (const std::string &snapshot1, const std::string &snapshot2) const |
| Compare two snapshots. | |
| const std::string & | GetProjectPath () const |
| Get project directory path. | |
| bool | IsInitialized () const |
| Check if project is initialized. | |
Private Member Functions | |
| absl::Status | LoadSnapshots () |
| absl::Status | SaveProjectMetadata () |
| std::string | GetSnapshotFilePath (const std::string &name) const |
Private Attributes | |
| std::string | project_path_ |
| std::string | snapshots_path_ |
| std::map< std::string, ProjectSnapshot > | snapshots_ |
Project manager for snapshot and version control.
Manages project state including:
Definition at line 90 of file project_tool.h.
|
default |
| absl::Status yaze::cli::agent::tools::ProjectManager::Initialize | ( | const std::string & | base_path | ) |
Initialize project directory structure.
| base_path | Base directory for project (creates .yaze-project/) |
Definition at line 355 of file project_tool.cc.
References yaze::cli::agent::tools::ProjectToolUtils::FormatTimestamp(), LoadSnapshots(), project_path_, and snapshots_path_.
Referenced by yaze::cli::agent::tools::ProjectSnapshotTool::Execute().

| absl::Status yaze::cli::agent::tools::ProjectManager::CreateSnapshot | ( | const std::string & | name, |
| const std::string & | description, | ||
| const std::vector< RomEdit > & | edits, | ||
| const std::array< uint8_t, 32 > & | rom_checksum ) |
Create a named snapshot of current state.
| name | Snapshot name |
| description | Optional description |
| edits | Edit list to snapshot |
| rom_checksum | SHA-256 of base ROM |
Definition at line 383 of file project_tool.cc.
References yaze::cli::agent::tools::ProjectSnapshot::created, yaze::cli::agent::tools::ProjectSnapshot::description, yaze::zelda3::description, yaze::cli::agent::tools::ProjectSnapshot::edits, GetSnapshotFilePath(), yaze::cli::agent::tools::ProjectSnapshot::name, yaze::zelda3::name, yaze::cli::agent::tools::ProjectSnapshot::rom_checksum, SaveProjectMetadata(), yaze::cli::agent::tools::ProjectSnapshot::SaveToFile(), and snapshots_.
Referenced by yaze::cli::agent::tools::ProjectSnapshotTool::Execute().

| absl::Status yaze::cli::agent::tools::ProjectManager::RestoreSnapshot | ( | const std::string & | name, |
| Rom * | rom ) |
Restore ROM to a named snapshot.
| name | Snapshot name |
| rom | ROM instance to restore |
Definition at line 414 of file project_tool.cc.
References yaze::cli::agent::tools::ProjectToolUtils::ComputeRomChecksum(), yaze::cli::agent::tools::ProjectSnapshot::edits, yaze::Rom::is_loaded(), yaze::zelda3::name, yaze::cli::agent::tools::ProjectSnapshot::rom_checksum, snapshots_, and yaze::Rom::WriteByte().
Referenced by yaze::cli::agent::tools::ProjectRestoreTool::Execute().

| std::vector< std::string > yaze::cli::agent::tools::ProjectManager::ListSnapshots | ( | ) | const |
List all available snapshots.
Definition at line 445 of file project_tool.cc.
References yaze::zelda3::name, and snapshots_.
Referenced by yaze::cli::agent::tools::ProjectStatusTool::Execute().
| absl::StatusOr< ProjectSnapshot > yaze::cli::agent::tools::ProjectManager::GetSnapshot | ( | const std::string & | name | ) | const |
Get snapshot details.
| name | Snapshot name |
Definition at line 454 of file project_tool.cc.
References yaze::zelda3::name, and snapshots_.
Referenced by DiffSnapshots(), and yaze::cli::agent::tools::ProjectRestoreTool::Execute().
| absl::Status yaze::cli::agent::tools::ProjectManager::DeleteSnapshot | ( | const std::string & | name | ) |
Delete a snapshot.
| name | Snapshot name |
Definition at line 464 of file project_tool.cc.
References GetSnapshotFilePath(), yaze::zelda3::name, SaveProjectMetadata(), and snapshots_.

| absl::Status yaze::cli::agent::tools::ProjectManager::ExportProject | ( | const std::string & | export_path, |
| bool | include_rom = false ) |
Export project as portable archive.
| export_path | Path for exported archive |
| include_rom | Include ROM file in export |
Definition at line 484 of file project_tool.cc.
Referenced by yaze::cli::agent::tools::ProjectExportTool::Execute().
| absl::Status yaze::cli::agent::tools::ProjectManager::ImportProject | ( | const std::string & | archive_path | ) |
Import project archive.
| archive_path | Path to project archive |
Definition at line 490 of file project_tool.cc.
Referenced by yaze::cli::agent::tools::ProjectImportTool::Execute().
| absl::StatusOr< std::string > yaze::cli::agent::tools::ProjectManager::DiffSnapshots | ( | const std::string & | snapshot1, |
| const std::string & | snapshot2 ) const |
Compare two snapshots.
| snapshot1 | First snapshot name |
| snapshot2 | Second snapshot name |
Definition at line 495 of file project_tool.cc.
References yaze::cli::agent::tools::ProjectSnapshot::edits, and GetSnapshot().
Referenced by yaze::cli::agent::tools::ProjectDiffTool::Execute().

|
inline |
Get project directory path.
Definition at line 161 of file project_tool.h.
References project_path_.
Referenced by yaze::cli::agent::tools::ProjectStatusTool::Execute().
|
inline |
Check if project is initialized.
Definition at line 166 of file project_tool.h.
References project_path_.
Referenced by yaze::cli::agent::tools::ProjectStatusTool::Execute(), yaze::cli::agent::tools::ProjectSnapshotTool::Execute(), yaze::cli::agent::tools::ProjectRestoreTool::Execute(), and yaze::cli::agent::tools::ProjectDiffTool::Execute().
|
private |
Definition at line 565 of file project_tool.cc.
References yaze::cli::agent::tools::ProjectSnapshot::LoadFromFile(), yaze::cli::agent::tools::ProjectSnapshot::name, snapshots_, and snapshots_path_.
Referenced by Initialize().

|
private |
Definition at line 589 of file project_tool.cc.
References yaze::cli::agent::tools::ProjectToolUtils::FormatTimestamp(), yaze::zelda3::name, project_path_, and snapshots_.
Referenced by CreateSnapshot(), and DeleteSnapshot().

|
private |
Definition at line 619 of file project_tool.cc.
References yaze::zelda3::name, and snapshots_path_.
Referenced by CreateSnapshot(), and DeleteSnapshot().
|
private |
Definition at line 169 of file project_tool.h.
Referenced by GetProjectPath(), Initialize(), IsInitialized(), and SaveProjectMetadata().
|
private |
Definition at line 170 of file project_tool.h.
Referenced by GetSnapshotFilePath(), Initialize(), and LoadSnapshots().
|
private |
Definition at line 171 of file project_tool.h.
Referenced by CreateSnapshot(), DeleteSnapshot(), GetSnapshot(), ListSnapshots(), LoadSnapshots(), RestoreSnapshot(), and SaveProjectMetadata().