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

Handles all project file operations. More...

#include <project_manager.h>

Collaboration diagram for yaze::editor::ProjectManager:

Public Member Functions

 ProjectManager (ToastManager *toast_manager)
 
 ~ProjectManager ()=default
 
absl::Status CreateNewProject (const std::string &template_name="")
 
absl::Status OpenProject (const std::string &filename="")
 
absl::Status SaveProject ()
 
absl::Status SaveProjectAs (const std::string &filename="")
 
absl::Status ImportProject (const std::string &project_path)
 
absl::Status ExportProject (const std::string &export_path)
 
absl::Status RepairCurrentProject ()
 
absl::Status ValidateProject ()
 
project::YazeProjectGetCurrentProject ()
 
const project::YazeProjectGetCurrentProject () const
 
bool HasActiveProject () const
 
std::string GetProjectName () const
 
std::string GetProjectPath () const
 
std::vector< std::string > GetAvailableTemplates () const
 
absl::Status CreateFromTemplate (const std::string &template_name, const std::string &project_name)
 

Private Member Functions

absl::Status LoadProjectFromFile (const std::string &filename)
 
absl::Status SaveProjectToFile (const std::string &filename)
 
std::string GenerateProjectFilename (const std::string &project_name) const
 
bool IsValidProjectFile (const std::string &filename) const
 
absl::Status InitializeProjectStructure (const std::string &project_path)
 

Private Attributes

project::YazeProject current_project_
 
ToastManagertoast_manager_ = nullptr
 

Detailed Description

Handles all project file operations.

Extracted from EditorManager to provide focused project management:

  • Project creation and templates
  • Project loading and saving
  • Project import/export
  • Project validation and repair

Definition at line 24 of file project_manager.h.

Constructor & Destructor Documentation

◆ ProjectManager()

yaze::editor::ProjectManager::ProjectManager ( ToastManager toast_manager)
explicit

Definition at line 13 of file project_manager.cc.

◆ ~ProjectManager()

yaze::editor::ProjectManager::~ProjectManager ( )
default

Member Function Documentation

◆ CreateNewProject()

absl::Status yaze::editor::ProjectManager::CreateNewProject ( const std::string &  template_name = "")

◆ OpenProject()

absl::Status yaze::editor::ProjectManager::OpenProject ( const std::string &  filename = "")
Todo:
Show file dialog

Definition at line 33 of file project_manager.cc.

References LoadProjectFromFile().

Here is the call graph for this function:

◆ SaveProject()

absl::Status yaze::editor::ProjectManager::SaveProject ( )

Definition at line 75 of file project_manager.cc.

References current_project_, yaze::project::YazeProject::filepath, HasActiveProject(), and SaveProjectToFile().

Here is the call graph for this function:

◆ SaveProjectAs()

absl::Status yaze::editor::ProjectManager::SaveProjectAs ( const std::string &  filename = "")
Todo:
Show save dialog

Definition at line 83 of file project_manager.cc.

References SaveProjectToFile().

Here is the call graph for this function:

◆ ImportProject()

absl::Status yaze::editor::ProjectManager::ImportProject ( const std::string &  project_path)
Todo:
Implement project import logic

Definition at line 118 of file project_manager.cc.

References yaze::editor::kSuccess, yaze::editor::ToastManager::Show(), and toast_manager_.

Here is the call graph for this function:

◆ ExportProject()

absl::Status yaze::editor::ProjectManager::ExportProject ( const std::string &  export_path)
Todo:
Implement project export logic

Definition at line 140 of file project_manager.cc.

References HasActiveProject(), yaze::editor::kSuccess, yaze::editor::ToastManager::Show(), and toast_manager_.

Here is the call graph for this function:

◆ RepairCurrentProject()

absl::Status yaze::editor::ProjectManager::RepairCurrentProject ( )
Todo:
Implement project repair logic

Definition at line 161 of file project_manager.cc.

References HasActiveProject(), yaze::editor::kSuccess, yaze::editor::ToastManager::Show(), and toast_manager_.

Here is the call graph for this function:

◆ ValidateProject()

absl::Status yaze::editor::ProjectManager::ValidateProject ( )

◆ GetCurrentProject() [1/2]

project::YazeProject & yaze::editor::ProjectManager::GetCurrentProject ( )
inline

Definition at line 44 of file project_manager.h.

References current_project_.

Referenced by yaze::editor::EditorManager::CreateNewProject().

◆ GetCurrentProject() [2/2]

const project::YazeProject & yaze::editor::ProjectManager::GetCurrentProject ( ) const
inline

Definition at line 45 of file project_manager.h.

References current_project_.

◆ HasActiveProject()

◆ GetProjectName()

std::string yaze::editor::ProjectManager::GetProjectName ( ) const

◆ GetProjectPath()

std::string yaze::editor::ProjectManager::GetProjectPath ( ) const

Definition at line 202 of file project_manager.cc.

References current_project_, and yaze::project::YazeProject::filepath.

◆ GetAvailableTemplates()

std::vector< std::string > yaze::editor::ProjectManager::GetAvailableTemplates ( ) const
Todo:
Scan templates directory and return available templates

Definition at line 206 of file project_manager.cc.

◆ CreateFromTemplate()

absl::Status yaze::editor::ProjectManager::CreateFromTemplate ( const std::string &  template_name,
const std::string &  project_name 
)
Todo:
Implement template-based project creation

Definition at line 217 of file project_manager.cc.

References current_project_, yaze::project::YazeProject::filepath, GenerateProjectFilename(), yaze::editor::kSuccess, yaze::project::YazeProject::name, yaze::editor::ToastManager::Show(), and toast_manager_.

Referenced by CreateNewProject().

Here is the call graph for this function:

◆ LoadProjectFromFile()

absl::Status yaze::editor::ProjectManager::LoadProjectFromFile ( const std::string &  filename)
private
Todo:
Implement actual project loading from JSON/YAML

Definition at line 42 of file project_manager.cc.

References current_project_, yaze::project::YazeProject::filepath, IsValidProjectFile(), yaze::editor::kError, yaze::editor::kSuccess, yaze::project::YazeProject::name, yaze::editor::ToastManager::Show(), and toast_manager_.

Referenced by OpenProject().

Here is the call graph for this function:

◆ SaveProjectToFile()

absl::Status yaze::editor::ProjectManager::SaveProjectToFile ( const std::string &  filename)
private
Todo:
Implement actual project saving to JSON/YAML

Definition at line 92 of file project_manager.cc.

References current_project_, yaze::project::YazeProject::filepath, yaze::editor::kError, yaze::editor::kSuccess, yaze::editor::ToastManager::Show(), and toast_manager_.

Referenced by SaveProject(), and SaveProjectAs().

Here is the call graph for this function:

◆ GenerateProjectFilename()

std::string yaze::editor::ProjectManager::GenerateProjectFilename ( const std::string &  project_name) const
private

Definition at line 239 of file project_manager.cc.

Referenced by CreateFromTemplate(), and CreateNewProject().

◆ IsValidProjectFile()

bool yaze::editor::ProjectManager::IsValidProjectFile ( const std::string &  filename) const
private

Definition at line 249 of file project_manager.cc.

Referenced by LoadProjectFromFile().

◆ InitializeProjectStructure()

absl::Status yaze::editor::ProjectManager::InitializeProjectStructure ( const std::string &  project_path)
private

Definition at line 263 of file project_manager.cc.

Member Data Documentation

◆ current_project_

◆ toast_manager_

ToastManager* yaze::editor::ProjectManager::toast_manager_ = nullptr
private

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