Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
host_storage.cpp File Reference

Implements saved host persistence. More...

#include "src/startup/host_storage.h"
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include "src/platform/filesystem_utils.h"
#include "src/startup/storage_paths.h"
Include dependency graph for host_storage.cpp:

Functions

std::string startup::default_host_storage_path ()
 Return the default path used for saved host storage.
 
LoadSavedHostsResult startup::load_saved_hosts (const std::string &filePath=default_host_storage_path())
 Load saved host records from disk.
 
SaveSavedHostsResult startup::save_saved_hosts (const std::vector< app::HostRecord > &hosts, const std::string &filePath=default_host_storage_path())
 Save the current saved host records to disk.
 

Detailed Description

Implements saved host persistence.

Function Documentation

◆ default_host_storage_path()

std::string startup::default_host_storage_path ( )

Return the default path used for saved host storage.

Returns
Default saved-host storage path.

◆ load_saved_hosts()

LoadSavedHostsResult startup::load_saved_hosts ( const std::string & filePath = default_host_storage_path())

Load saved host records from disk.

Parameters
filePathStorage file to load.
Returns
Loaded hosts plus any non-fatal warnings.

◆ save_saved_hosts()

SaveSavedHostsResult startup::save_saved_hosts ( const std::vector< app::HostRecord > & hosts,
const std::string & filePath = default_host_storage_path() )

Save the current saved host records to disk.

Parameters
hostsSaved host records to persist.
filePathStorage file to write.
Returns
Save result including success state and error detail.