Sunshine master
Self-hosted game stream host for Moonlight.
nvprefs::undo_file_t Class Reference

File-backed storage for NVIDIA preference undo data. More...

#include <src/platform/windows/nvprefs/undo_file.h>

Public Member Functions

bool delete_file ()
 Delete the persisted NVIDIA settings undo file.
 
std::optional< undo_data_tread_undo_data ()
 Read undo data.
 
bool write_undo_data (const undo_data_t &undo_data)
 Write undo data.
 

Static Public Member Functions

static std::optional< undo_file_tcreate_new_file (std::filesystem::path file_path)
 Create new file.
 
static std::optional< undo_file_topen_existing_file (std::filesystem::path file_path, bool &access_denied)
 Open existing file.
 

Detailed Description

File-backed storage for NVIDIA preference undo data.

Member Function Documentation

◆ create_new_file()

std::optional< undo_file_t > nvprefs::undo_file_t::create_new_file ( std::filesystem::path file_path)
static

Create new file.

Parameters
file_pathFile path.
Returns
Created new file object or status.

◆ delete_file()

bool nvprefs::undo_file_t::delete_file ( )

Delete the persisted NVIDIA settings undo file.

Returns
True when the undo-file operation succeeds.

◆ open_existing_file()

std::optional< undo_file_t > nvprefs::undo_file_t::open_existing_file ( std::filesystem::path file_path,
bool & access_denied )
static

Open existing file.

Parameters
file_pathFile path.
access_deniedAccess denied.
Returns
Open undo file wrapper, or std::nullopt when the file cannot be opened.

◆ read_undo_data()

std::optional< undo_data_t > nvprefs::undo_file_t::read_undo_data ( )

Read undo data.

Returns
Parsed undo data, or std::nullopt when the file is empty or invalid.

◆ write_undo_data()

bool nvprefs::undo_file_t::write_undo_data ( const undo_data_t & undo_data)

Write undo data.

Parameters
undo_dataDriver settings to persist for a later restore.
Returns
True when the undo-file operation succeeds.

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