The Workspace class represents a workspace with all its data (library, projects, settings, ...)
More...
#include <workspace.h>
Inherits QObject.
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
To access the settings of the workspace, use the method getSettings().
◆ Workspace() [1/3]
◆ Workspace() [2/3]
◆ Workspace() [3/3]
Constructor to open an existing workspace.
- Parameters
-
wsPath | The filepath to the workspace directory. |
dataDirName | Subdirectory name where data files are stored (e.g. "data" or "v0.1"). |
lockCallback | A callback which gets called if the workspace directory is locked, to decide what to do in this case. |
- Exceptions
-
Exception | If the workspace could not be opened, this constructor throws an exception. |
◆ ~Workspace()
◆ getPath()
Get the filepath to the workspace directory.
◆ getProjectsPath()
const FilePath & getProjectsPath |
( |
| ) |
const |
|
inline |
Get the filepath to the "projects" directory in the workspace.
◆ getDataPath()
Get the filepath to the data directory in the workspace.
◆ getLibrariesPath()
const FilePath & getLibrariesPath |
( |
| ) |
const |
|
inline |
Get the filepath to the "data/libraries" directory in the workspace.
◆ getLocalLibrariesPath()
FilePath getLocalLibrariesPath |
( |
| ) |
const |
|
inline |
Get the filepath to the "data/libraries/local" directory.
◆ getRemoteLibrariesPath()
FilePath getRemoteLibrariesPath |
( |
| ) |
const |
|
inline |
Get the filepath to the "data/libraries/remote" directory.
◆ getSettings() [1/2]
Get the workspace settings.
◆ getSettings() [2/2]
Get the workspace settings.
◆ getLibraryDb()
Get the workspace library database.
◆ saveSettings()
Save all (modified) settings to disk.
◆ operator=()
◆ checkCompatibility()
bool checkCompatibility |
( |
const FilePath & |
wsRoot, |
|
|
QString * |
errorMsg = nullptr |
|
) |
| |
|
static |
Check the existence & compatibility of a workspace directory.
- Parameters
-
wsRoot | Workspace directory root path to check. |
errorMsg | If not nullptr, and the function returns false , an explanation error message will be written here. |
- Returns
- True if the path is a compatible workspace directory, false otherwise.
◆ findDataDirectories()
Find all data directories of a workspace.
- Parameters
-
- Returns
- All data directory names and their contained (resp. intended) file format version.
◆ determineDataDirectory()
QString determineDataDirectory |
( |
const QMap< QString, Version > & |
dataDirs, |
|
|
QString & |
copyFromDir, |
|
|
QString & |
copyToDir |
|
) |
| |
|
staticnoexcept |
Decide which data directory to open, and how to do it.
- Parameters
-
dataDirs | All available data directories, as returned by findDataDirectories(). |
copyFromDir | If the file format of the data directory needs to be upgraded, the source directory of the copy operation will be written out here. |
copyToDir | If the file format of the data directory needs to be upgraded, the destination directory of the copy operation will be written out here. |
- Returns
- Name of the data directory to open or create.
◆ createNewWorkspace()
void createNewWorkspace |
( |
const FilePath & |
path | ) |
|
|
static |
Create a new workspace.
- Parameters
-
path | A path to a directory where to create the new workspace |
- Exceptions
-
◆ getMostRecentlyUsedWorkspacePath()
FilePath getMostRecentlyUsedWorkspacePath |
( |
| ) |
|
|
staticnoexcept |
Get the most recently used workspace path.
- Returns
- The filepath to the last recently used workspace (may be invalid)
◆ setMostRecentlyUsedWorkspacePath()
void setMostRecentlyUsedWorkspacePath |
( |
const FilePath & |
path | ) |
|
|
staticnoexcept |
Set the most recently used workspace path.
- Parameters
-
path | The filepath to the workspace directory |
◆ FILE_FORMAT_VERSION()
static Version FILE_FORMAT_VERSION |
( |
| ) |
|
|
inlinestaticnoexcept |
Current workspace file format version (constant)
- Warning
- Don't change this value unless you know exactly what you're doing!
- Returns
- File format version
◆ saveSettingsToTransactionalFileSystem()
void saveSettingsToTransactionalFileSystem |
( |
| ) |
|
|
private |
Save the workspace settings to the transactional file system.
◆ mPath
a FilePath object which represents the workspace directory
◆ mProjectsPath
◆ mDataPath
the subdirectory of the current file format version
◆ mLibrariesPath
the directory "data/libraries"
◆ mFileSystem
◆ mWorkspaceSettings
◆ mLibraryDb
The documentation for this class was generated from the following files: