Blender V5.3
GHOST_ISystemPaths Class Referenceabstract

#include <GHOST_ISystemPaths.hh>

Inherited by GHOST_SystemPaths.

Public Member Functions

virtual const char * getSystemDir (int version, const char *versionstr) const =0
virtual const char * getSystemLibsDir (int, const char *) const
virtual const char * getUserDir (int version, const char *versionstr) const =0
virtual std::optional< std::string > getUserSpecialDir (GHOST_TUserSpecialDirTypes type) const =0
virtual const char * getBinaryDir () const =0
virtual void addToSystemRecentFiles (const char *filepath) const =0

Static Public Member Functions

static GHOST_TSuccess create ()
static GHOST_TSuccess dispose ()
static GHOST_ISystemPaths * get ()

Protected Member Functions

 GHOST_ISystemPaths ()
virtual ~GHOST_ISystemPaths ()=default

Detailed Description

Definition at line 16 of file GHOST_ISystemPaths.hh.

Constructor & Destructor Documentation

◆ GHOST_ISystemPaths()

GHOST_ISystemPaths::GHOST_ISystemPaths ( )
inlineprotected

Constructor. Protected default constructor to force use of static createSystem member.

Definition at line 41 of file GHOST_ISystemPaths.hh.

Referenced by addToSystemRecentFiles(), and get().

◆ ~GHOST_ISystemPaths()

virtual GHOST_ISystemPaths::~GHOST_ISystemPaths ( )
protectedvirtualdefault

Destructor. Protected default constructor to force use of static dispose member.

Member Function Documentation

◆ addToSystemRecentFiles()

virtual void GHOST_ISystemPaths::addToSystemRecentFiles ( const char * filepath) const
pure virtual

Add the file to the operating system most recently used files

Implemented in GHOST_SystemPaths, GHOST_SystemPathsCocoa, GHOST_SystemPathsUnix, and GHOST_SystemPathsWin32.

References GHOST_ISystemPaths().

Referenced by blender::wm_history_file_update().

◆ create()

GHOST_TSuccess GHOST_ISystemPaths::create ( )
static

Creates the one and only system.

Returns
An indication of success.

Definition at line 27 of file GHOST_ISystemPaths.cc.

References GHOST_kFailure, GHOST_kSuccess, GHOST_SystemPathsCocoa::GHOST_SystemPathsCocoa(), GHOST_SystemPathsUnix::GHOST_SystemPathsUnix(), and GHOST_SystemPathsWin32::GHOST_SystemPathsWin32().

Referenced by get().

◆ dispose()

GHOST_TSuccess GHOST_ISystemPaths::dispose ( )
static

Disposes the one and only system.

Returns
An indication of success.

Definition at line 48 of file GHOST_ISystemPaths.cc.

References GHOST_kFailure, and GHOST_kSuccess.

Referenced by blender::BKE_appdir_exit(), and blender::gpu::GPUTest::TearDownTestSuite().

◆ get()

GHOST_ISystemPaths * GHOST_ISystemPaths::get ( )
static

◆ getBinaryDir()

virtual const char * GHOST_ISystemPaths::getBinaryDir ( ) const
pure virtual

Determine the directory of the current binary

Returns
Unsigned char string pointing to the binary directory.

Implemented in GHOST_SystemPaths, GHOST_SystemPathsCocoa, GHOST_SystemPathsUnix, and GHOST_SystemPathsWin32.

◆ getSystemDir()

virtual const char * GHOST_ISystemPaths::getSystemDir ( int version,
const char * versionstr ) const
pure virtual

Determine the base directory in which shared resources are located. It will first try to use "unpack and run" path, then look for properly installed path, including versioning.

Returns
Unsigned char string pointing to system directory (eg /usr/share/blender/).

Implemented in GHOST_SystemPaths, GHOST_SystemPathsCocoa, GHOST_SystemPathsUnix, and GHOST_SystemPathsWin32.

Referenced by blender::get_path_system_ex().

◆ getSystemLibsDir()

virtual const char * GHOST_ISystemPaths::getSystemLibsDir ( int ,
const char *  ) const
inlinevirtual

The base directory where architecture-dependent files are located, mirroring getSystemDir under the install lib tree (eg /usr/lib/blender/).

Returns
String pointing to the system libraries directory, or null when this build has no separate system library directory.

For portable builds this function always returns null, for specific details see CMake's BLENDER_INSTALL_LIBDIR define for when this is/isn't used and why.

Reimplemented in GHOST_SystemPathsUnix.

Definition at line 67 of file GHOST_ISystemPaths.hh.

Referenced by blender::get_path_system_libs_ex().

◆ getUserDir()

virtual const char * GHOST_ISystemPaths::getUserDir ( int version,
const char * versionstr ) const
pure virtual

Determine the base directory in which user configuration is stored, including versioning. If needed, it will create the base directory.

Returns
Unsigned char string pointing to user directory (eg ~/.blender/).

Implemented in GHOST_SystemPaths, GHOST_SystemPathsCocoa, GHOST_SystemPathsUnix, and GHOST_SystemPathsWin32.

Referenced by blender::get_path_user_ex().

◆ getUserSpecialDir()

virtual std::optional< std::string > GHOST_ISystemPaths::getUserSpecialDir ( GHOST_TUserSpecialDirTypes type) const
pure virtual

Determine a special ("well known") and easy to reach user directory.

Returns
If successful, a string containing the user directory path (eg ~/Documents/).

Implemented in GHOST_SystemPathsCocoa, GHOST_SystemPathsUnix, and GHOST_SystemPathsWin32.

Referenced by blender::BKE_appdir_folder_caches(), and blender::BKE_appdir_folder_documents().


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