Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
portal::restore_token_t Class Reference

Persistent portal restore token used to reuse screencast permission. More...

Static Public Member Functions

static void clear ()
 Clear a restore token if it already exists on disk.
static bool empty ()
 Return whether the persisted value is empty.
static bool exists ()
 Check if a Portal restore token exists on disk without inspecting its contents.
static std::string get ()
 Return the currently wrapped value or handle.
static std::filesystem::path get_file_path (const std::filesystem::path &directory=platf::appdata(), const std::string &desktop=lizardbyte::common::get_env("XDG_SESSION_DESKTOP"))
 Get file path of the XDG Portal restore token.
static void load ()
 Load persisted state from its backing store.
static void save ()
 Save current state to its backing store.
static void set (std::string_view value)
 Store the new value and mark it dirty for persistence.

Detailed Description

Persistent portal restore token used to reuse screencast permission.

Member Function Documentation

◆ empty()

bool portal::restore_token_t::empty ( )
inlinestatic

Return whether the persisted value is empty.

Returns
True when no portal display id has been persisted.

◆ exists()

bool portal::restore_token_t::exists ( )
inlinestatic

Check if a Portal restore token exists on disk without inspecting its contents.

Returns
True if file exists on disk.

◆ get()

std::string portal::restore_token_t::get ( )
inlinestatic

Return the currently wrapped value or handle.

Returns
Underlying native handle or object pointer.

◆ get_file_path()

std::filesystem::path portal::restore_token_t::get_file_path ( const std::filesystem::path & directory = platf::appdata(),
const std::string & desktop = lizardbyte::common::get_env("XDG_SESSION_DESKTOP") )
inlinestatic

Get file path of the XDG Portal restore token.

The token filename is suffixed with the XDG session desktop when set in the environment.

Parameters
directoryDirectory containing saved tokens; defaults to the application data directory.
desktopSession desktop; defaults to the XDG_SESSION_DESKTOP environment variable.
Returns
File path.

◆ set()

void portal::restore_token_t::set ( std::string_view value)
inlinestatic

Store the new value and mark it dirty for persistence.

Parameters
valuePortal restore token received from xdg-desktop-portal.

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