Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
filesystem_utils.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <cstdint>
9#include <string>
10#include <string_view>
11
12namespace platform {
13
20
27 bool is_path_separator(char character);
28
36 std::string join_path(const std::string &left, const std::string &right);
37
44 std::string parent_directory(std::string_view filePath);
45
52 std::string file_name_from_path(std::string_view path);
53
61 bool ensure_directory_exists(const std::string &directoryPath, std::string *errorMessage = nullptr);
62
70 bool try_get_file_size(std::string_view path, std::uint64_t *sizeBytes = nullptr);
71
79 bool path_has_prefix(const std::string &path, const std::string &prefix);
80
81} // namespace platform
bool ensure_directory_exists(const std::string &directoryPath, std::string *errorMessage)
Ensure that a directory path exists, creating missing segments as needed.
Definition filesystem_utils.cpp:112
char preferred_path_separator()
Return the preferred path separator for the active platform.
Definition filesystem_utils.cpp:74
std::string parent_directory(std::string_view filePath)
Return the parent directory portion of a file path.
Definition filesystem_utils.cpp:99
bool is_path_separator(char character)
Return whether a character is recognized as a path separator.
Definition filesystem_utils.cpp:82