![]() |
Sunshine latest
Self-hosted game stream host for Moonlight.
|
Responsible for file handling functions. More...
Functions | |
std::string | get_parent_directory (const std::string &path) |
Get the parent directory of a file or directory. | |
bool | make_directory (const std::string &path) |
Make a directory. | |
std::string | read_file (const char *path) |
Read a file to string. | |
int | write_file (const char *path, const std::string_view &contents) |
Writes a file. | |
Responsible for file handling functions.
std::string file_handler::get_parent_directory | ( | const std::string & | path | ) |
Get the parent directory of a file or directory.
path | The path of the file or directory. |
Examples
bool file_handler::make_directory | ( | const std::string & | path | ) |
Make a directory.
path | The path of the directory. |
true
on success, false
on failure.Examples
std::string file_handler::read_file | ( | const char * | path | ) |
Read a file to string.
path | The path of the file. |
Examples
int file_handler::write_file | ( | const char * | path, |
const std::string_view & | contents ) |
Writes a file.
path | The path of the file. |
contents | The contents to write. |
0
on success, -1
on failure.Examples