![]() |
DeskUp 0.3
|
Convenience façade for workspace-level window operations. More...
#include <desk_up_backend_interface.h>
Static Public Member Functions | |
| static DeskUp::Status | saveAllWindowsLocal (std::string workspaceName) |
| Saves all currently enumerated windows to a local workspace folder. | |
| static DeskUp::Status | restoreWindows (std::string workspaceName) |
| Restores all tabs saved previously in the workspace name specified by the parameter. | |
| static bool | isWorkspaceValid (const std::string &workspaceName) |
| This function checks whether if a string is a valid name for a workspace folder. | |
| static bool | existsWorkspace (const std::string &workspaceName) |
This function checks whether if a given workspace with the name workspaceName already exists. | |
| static int | removeWorkspace (const std::string &workspaceName) |
| This function deletes a workspace. | |
| static bool | existsFile (const fs::path &filePath) |
| Checks whether a given file path exists on disk. | |
Convenience façade for workspace-level window operations.
This lightweight façade exposes high-level operations that orchestrate the active backend device (see current_window_backend) to work with window snapshots and workspaces.
Error handling:
|
static |
Checks whether a given file path exists on disk.
Uses the C++17 <filesystem> library to test whether the file or directory specified by filePath exists in the current filesystem. Returns true if it exists, false otherwise.
Reads:
filePath.| filePath | The absolute or relative filesystem path to check. |
true if the file or directory exists, false otherwise.
|
static |
This function checks whether if a given workspace with the name workspaceName already exists.
Checks whether <DESKUPDIR>/<workspaceName> exists and is a directory.
Reads:
| workspaceName | Name of the workspace folder to use under DESKUPDIR. |
true if the workspace exists, false otherwise.
|
static |
This function checks whether if a string is a valid name for a workspace folder.
A workspace name is invalid if it is empty or contains any of the following forbidden characters: \\ / : ? * " < > |.
Reads:
| workspaceName | Name of the workspace to check. |
true if the workspace name is valid, false otherwise.
|
static |
This function deletes a workspace.
Removes <DESKUPDIR>/<workspaceName> recursively from disk. Returns 1 on success, 0 if the workspace does not exist or deletion failed.
Reads:
| workspaceName | Name of the workspace folder to use under DESKUPDIR. |
1 if deleted, 0 otherwise.
|
static |
Restores all tabs saved previously in the workspace name specified by the parameter.
Iterates over all files in <DESKUPDIR>/<workspaceName> and, for each saved window:
Non-fatal backend errors (Retry or Warning) are logged to console but do not abort the overall restore cycle. Fatal errors propagate as a failed DeskUp::Status.
Calls (indirectly through the backend):
Reads:
| workspaceName | Name of the workspace folder to use under DESKUPDIR. |
@errors
|
static |
Saves all currently enumerated windows to a local workspace folder.
Builds <DESKUPDIR>/<workspaceName> and ensures the directory exists. Then asks the active backend device to enumerate all open windows and writes each window's description to an individual file using windowDesc::saveTo(). Non-fatal save errors are skipped; fatal ones abort the operation.
Calls (indirectly through the backend):
Reads:
| workspaceName | Name of the workspace folder to create/use under DESKUPDIR. |
@errors
