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

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< ProjectSnapshotGetSnapshot (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, ProjectSnapshotsnapshots_
 

Detailed Description

Project manager for snapshot and version control.

Manages project state including:

  • Named snapshots (checkpoints)
  • Edit delta tracking
  • ROM checksum validation
  • Project metadata

Definition at line 90 of file project_tool.h.

Constructor & Destructor Documentation

◆ ProjectManager()

yaze::cli::agent::tools::ProjectManager::ProjectManager ( )
default

Member Function Documentation

◆ Initialize()

absl::Status yaze::cli::agent::tools::ProjectManager::Initialize ( const std::string & base_path)

Initialize project directory structure.

Parameters
base_pathBase 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().

Here is the call graph for this function:

◆ CreateSnapshot()

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 )

◆ RestoreSnapshot()

absl::Status yaze::cli::agent::tools::ProjectManager::RestoreSnapshot ( const std::string & name,
Rom * rom )

Restore ROM to a named snapshot.

Parameters
nameSnapshot name
romROM 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().

Here is the call graph for this function:

◆ ListSnapshots()

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().

◆ GetSnapshot()

absl::StatusOr< ProjectSnapshot > yaze::cli::agent::tools::ProjectManager::GetSnapshot ( const std::string & name) const

Get snapshot details.

Parameters
nameSnapshot 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().

◆ DeleteSnapshot()

absl::Status yaze::cli::agent::tools::ProjectManager::DeleteSnapshot ( const std::string & name)

Delete a snapshot.

Parameters
nameSnapshot name

Definition at line 464 of file project_tool.cc.

References GetSnapshotFilePath(), yaze::zelda3::name, SaveProjectMetadata(), and snapshots_.

Here is the call graph for this function:

◆ ExportProject()

absl::Status yaze::cli::agent::tools::ProjectManager::ExportProject ( const std::string & export_path,
bool include_rom = false )

Export project as portable archive.

Parameters
export_pathPath for exported archive
include_romInclude ROM file in export
Todo
Implement project export (create tar/zip archive)

Definition at line 484 of file project_tool.cc.

Referenced by yaze::cli::agent::tools::ProjectExportTool::Execute().

◆ ImportProject()

absl::Status yaze::cli::agent::tools::ProjectManager::ImportProject ( const std::string & archive_path)

Import project archive.

Parameters
archive_pathPath to project archive
Todo
Implement project import (extract tar/zip archive)

Definition at line 490 of file project_tool.cc.

Referenced by yaze::cli::agent::tools::ProjectImportTool::Execute().

◆ DiffSnapshots()

absl::StatusOr< std::string > yaze::cli::agent::tools::ProjectManager::DiffSnapshots ( const std::string & snapshot1,
const std::string & snapshot2 ) const

Compare two snapshots.

Parameters
snapshot1First snapshot name
snapshot2Second 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().

Here is the call graph for this function:

◆ GetProjectPath()

const std::string & yaze::cli::agent::tools::ProjectManager::GetProjectPath ( ) const
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().

◆ IsInitialized()

bool yaze::cli::agent::tools::ProjectManager::IsInitialized ( ) const
inline

◆ LoadSnapshots()

absl::Status yaze::cli::agent::tools::ProjectManager::LoadSnapshots ( )
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().

Here is the call graph for this function:

◆ SaveProjectMetadata()

absl::Status yaze::cli::agent::tools::ProjectManager::SaveProjectMetadata ( )
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().

Here is the call graph for this function:

◆ GetSnapshotFilePath()

std::string yaze::cli::agent::tools::ProjectManager::GetSnapshotFilePath ( const std::string & name) const
private

Definition at line 619 of file project_tool.cc.

References yaze::zelda3::name, and snapshots_path_.

Referenced by CreateSnapshot(), and DeleteSnapshot().

Member Data Documentation

◆ project_path_

std::string yaze::cli::agent::tools::ProjectManager::project_path_
private

Definition at line 169 of file project_tool.h.

Referenced by GetProjectPath(), Initialize(), IsInitialized(), and SaveProjectMetadata().

◆ snapshots_path_

std::string yaze::cli::agent::tools::ProjectManager::snapshots_path_
private

Definition at line 170 of file project_tool.h.

Referenced by GetSnapshotFilePath(), Initialize(), and LoadSnapshots().

◆ snapshots_

std::map<std::string, ProjectSnapshot> yaze::cli::agent::tools::ProjectManager::snapshots_
private

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