Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
DirectoryManager Class Reference

This can just be created on the stack as needed since it uses globally available information. More...

#include <src/utils/directory_manager.h>

Inheritance diagram for DirectoryManager:
Collaboration diagram for DirectoryManager:

Public Types

using UserDirProvider = std::function<fs::path ()>
using DefaultUserDirProvider = std::function<fs::path ()>
using ApplicationDirPathProvider = std::function<fs::path ()>
Public Types inherited from IDirectoryManager
enum class  DirectoryType {
  SYSTEM_PREFIX , SYSTEM_BINDIR , SYSTEM_PARENT_DATADIR , SYSTEM_PARENT_LIBDIR ,
  SYSTEM_ZRYTHM_LIBDIR , SYSTEM_BUNDLED_PLUGINSDIR , SYSTEM_LOCALEDIR , SYSTEM_ZRYTHM_DATADIR ,
  SYSTEM_SAMPLESDIR , SYSTEM_SCRIPTSDIR , SYSTEM_THEMESDIR , SYSTEM_THEMES_CSS_DIR ,
  SYSTEM_THEMES_ICONS_DIR , SYSTEM_SPECIAL_LV2_PLUGINS_DIR , SYSTEM_TEMPLATES , USER_TOP ,
  USER_PROJECTS , USER_TEMPLATES , USER_THEMES , USER_THEMES_CSS ,
  USER_THEMES_ICONS , USER_SCRIPTS , USER_LOG , USER_PROFILING ,
  USER_GDB , USER_BACKTRACE
}
 Type of directory. More...

Public Member Functions

 DirectoryManager (UserDirProvider user_dir_provider, DefaultUserDirProvider default_user_dir_provider, ApplicationDirPathProvider application_dir_path_provider)
fs::path get_prefix () const override
 Returns the prefix or in the case of Windows the root dir (C/program files/zrythm) or in the case of macos the bundle path.
fs::path get_user_dir (bool force_default) override
 Gets the zrythm directory, either from the settings if non-empty, or the default ($XDG_DATA_DIR/zrythm).
fs::path get_default_user_dir () override
 Returns the default user "zrythm" dir.
Public Member Functions inherited from IDirectoryManager
virtual fs::path get_dir (DirectoryType type)
 Returns a Zrythm directory specified by type.

Detailed Description

This can just be created on the stack as needed since it uses globally available information.

Definition at line 155 of file directory_manager.h.

Member Typedef Documentation

◆ ApplicationDirPathProvider

using DirectoryManager::ApplicationDirPathProvider = std::function<fs::path ()>

Definition at line 160 of file directory_manager.h.

◆ DefaultUserDirProvider

using DirectoryManager::DefaultUserDirProvider = std::function<fs::path ()>

Definition at line 159 of file directory_manager.h.

◆ UserDirProvider

using DirectoryManager::UserDirProvider = std::function<fs::path ()>

Definition at line 158 of file directory_manager.h.

Constructor & Destructor Documentation

◆ DirectoryManager()

DirectoryManager::DirectoryManager ( UserDirProvider user_dir_provider,
DefaultUserDirProvider default_user_dir_provider,
ApplicationDirPathProvider application_dir_path_provider )
inline

Definition at line 163 of file directory_manager.h.

Member Function Documentation

◆ get_default_user_dir()

fs::path DirectoryManager::get_default_user_dir ( )
overridevirtual

Returns the default user "zrythm" dir.

This is used when resetting or when the dir is not selected by the user yet.

Implements IDirectoryManager.

◆ get_prefix()

fs::path DirectoryManager::get_prefix ( ) const
overridevirtual

Returns the prefix or in the case of Windows the root dir (C/program files/zrythm) or in the case of macos the bundle path.

In all cases, "share" is expected to be found in this dir.

Returns
A newly allocated string.

Implements IDirectoryManager.

◆ get_user_dir()

fs::path DirectoryManager::get_user_dir ( bool force_default)
overridevirtual

Gets the zrythm directory, either from the settings if non-empty, or the default ($XDG_DATA_DIR/zrythm).

Parameters
force_defaultIgnore the settings and get the default dir.

Implements IDirectoryManager.


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