Sunshine v2025.118.151840
Self-hosted game stream host for Moonlight.
file_handler.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <string>
8
12namespace file_handler {
21 std::string
22 get_parent_directory(const std::string &path);
23
32 bool
33 make_directory(const std::string &path);
34
43 std::string
44 read_file(const char *path);
45
55 int
56 write_file(const char *path, const std::string_view &contents);
57} // namespace file_handler
Responsible for file handling functions.
Definition file_handler.cpp:14
std::string get_parent_directory(const std::string &path)
Get the parent directory of a file or directory.
Definition file_handler.cpp:16
std::string read_file(const char *path)
Read a file to string.
Definition file_handler.cpp:38
int write_file(const char *path, const std::string_view &contents)
Writes a file.
Definition file_handler.cpp:49
bool make_directory(const std::string &path)
Make a directory.
Definition file_handler.cpp:28