Skip to content

EntropyEngine::VirtualFileSystem

Name
std::optional< std::string >getResourcesPath()
Get the application’s resources directory (cross-platform).
std::optional< std::string >getResourceFilePath(const std::string & relativePath)
Get the full path to a resource file.
std::optional< std::string >getExecutablePath()
Get the full path to the executable.
std::optional< std::string >getExecutableDirectory()
Get the directory containing the executable.
std::optional< std::string >getAppDataPath(const std::string & appName)
Get platform-appropriate app data directory.
std::optional< std::string >getAppCachePath(const std::string & appName)
Get platform-appropriate app cache directory.
std::optional< std::string > getResourcesPath()

Get the application’s resources directory (cross-platform).

Return: Absolute path to resources directory, or nullopt on failure

Platform behavior:

  • macOS App Bundle: Returns MyApp.app/Contents/Resources/
  • macOS CLI/Windows/Linux: Returns directory containing the executable
std::optional< std::string > getResourceFilePath(
const std::string & relativePath
)

Get the full path to a resource file.

Parameters:

  • relativePath Path relative to resources directory (e.g., “Shaders/blit.slang”)

Return: Absolute path to the resource file, or nullopt on failure

std::optional< std::string > getExecutablePath()

Get the full path to the executable.

Return: Absolute path to executable, or nullopt on failure

std::optional< std::string > getExecutableDirectory()

Get the directory containing the executable.

Return: Absolute path to executable’s directory, or nullopt on failure

std::optional< std::string > getAppDataPath(
const std::string & appName
)

Get platform-appropriate app data directory.

Parameters:

  • appName Application name (used as subdirectory)

Return: Absolute path to app data directory, or nullopt on failure

Platform behavior:

  • macOS: ~/Library/Application Support/{appName}/
  • Linux: $XDG_DATA_HOME/{appName}/ or ~/.local/share/{appName}/
  • Windows: APPDATAappName}\
std::optional< std::string > getAppCachePath(
const std::string & appName
)

Get platform-appropriate app cache directory.

Parameters:

  • appName Application name (used as subdirectory)

Return: Absolute path to app cache directory, or nullopt on failure

Platform behavior:

  • macOS: ~/Library/Caches/{appName}/
  • Linux: $XDG_CACHE_HOME/{appName}/ or ~/.cache/{appName}/
  • Windows: LOCALAPPDATAappName}\

Updated on 2026-01-26 at 17:14:35 -0500