Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::Project Class Reference

Represents an active project including configuration and directory management. More...

#include <Project.h>

Public Member Functions

ProjectConfigGetConfig ()
 Gets a mutable reference to the current project configuration.

Static Public Member Functions

static const std::filesystem::path GetProjectDirectory ()
 Gets the root directory of the currently active project.
static std::filesystem::path GetAssetDirectory ()
 Gets the full path to the asset directory of the active project.
static std::filesystem::path GetAssetFileSystemPath (const std::filesystem::path &path)
 Resolves a relative asset path against the active project's asset directory.
static Ref< ProjectGetActiveProject ()
 Gets a reference-counted pointer to the active project instance.
static Ref< ProjectNew ()
 Creates a new, empty project instance and sets it as active.
static Ref< ProjectLoad (const std::filesystem::path &path)
 Loads a project from a file and sets it as the active project.
static bool SaveActive (const std::filesystem::path &path)
 Saves the currently active project to the given file path.

Detailed Description

Represents an active project including configuration and directory management.

This singleton-style class manages the currently loaded project, including loading, saving, and providing access to project-related paths.

Member Function Documentation

◆ GetActiveProject()

Ref< Project > Raven::Project::GetActiveProject ( )
inlinestatic

Gets a reference-counted pointer to the active project instance.

Returns
Ref<Project> to the active project, or nullptr if none is active.

◆ GetAssetDirectory()

std::filesystem::path Raven::Project::GetAssetDirectory ( )
inlinestatic

Gets the full path to the asset directory of the active project.

Returns
Filesystem path of the assets directory.

Logs an error and returns an empty path if no project is active.

◆ GetAssetFileSystemPath()

std::filesystem::path Raven::Project::GetAssetFileSystemPath ( const std::filesystem::path & path)
inlinestatic

Resolves a relative asset path against the active project's asset directory.

Parameters
pathRelative path to an asset.
Returns
Full filesystem path to the asset.

Logs an error and returns an empty path if no project is active.

◆ GetConfig()

ProjectConfig & Raven::Project::GetConfig ( )
inline

Gets a mutable reference to the current project configuration.

Returns
Reference to the ProjectConfig struct.

◆ GetProjectDirectory()

const std::filesystem::path Raven::Project::GetProjectDirectory ( )
inlinestatic

Gets the root directory of the currently active project.

Returns
Filesystem path of the active project directory.

Logs an error and returns an empty path if no project is active.

◆ Load()

Ref< Project > Raven::Project::Load ( const std::filesystem::path & path)
static

Loads a project from a file and sets it as the active project.

Parameters
pathFilesystem path to the project file.
Returns
Reference-counted pointer to the loaded project, or nullptr on failure.

◆ New()

Ref< Project > Raven::Project::New ( )
static

Creates a new, empty project instance and sets it as active.

Returns
Reference-counted pointer to the new project.

◆ SaveActive()

bool Raven::Project::SaveActive ( const std::filesystem::path & path)
static

Saves the currently active project to the given file path.

Parameters
pathFilesystem path where to save the project.
Returns
True if save was successful, false otherwise.

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