![]() |
Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
|
Implements filesystem utility helpers. More...
#include "src/platform/filesystem_utils.h"#include <cctype>#include <cerrno>#include <cstring>#include <string_view>#include <windows.h>#include <direct.h>Functions | |
| bool | platform::ensure_directory_exists (const std::string &directoryPath, std::string *errorMessage=nullptr) |
| Ensure that a directory path exists, creating missing segments as needed. | |
| std::string | platform::file_name_from_path (std::string_view path) |
| Return the last path component from a file path. | |
| bool | platform::is_path_separator (char character) |
| Return whether a character is recognized as a path separator. | |
| std::string | platform::join_path (const std::string &left, const std::string &right) |
| Join two path components using the preferred platform separator. | |
| std::string | platform::parent_directory (std::string_view filePath) |
| Return the parent directory portion of a file path. | |
| bool | platform::path_has_prefix (const std::string &path, const std::string &prefix) |
| Return whether a path begins with the requested prefix. | |
| char | platform::preferred_path_separator () |
| Return the preferred path separator for the active platform. | |
| bool | platform::try_get_file_size (std::string_view path, std::uint64_t *sizeBytes=nullptr) |
| Try to read the size of a regular file. | |
Implements filesystem utility helpers.
| bool platform::ensure_directory_exists | ( | const std::string & | directoryPath, |
| std::string * | errorMessage = nullptr ) |
Ensure that a directory path exists, creating missing segments as needed.
| directoryPath | Directory path to create. |
| errorMessage | Optional output for creation failures. |
| std::string platform::file_name_from_path | ( | std::string_view | path | ) |
Return the last path component from a file path.
| path | Path to inspect. |
| bool platform::is_path_separator | ( | char | character | ) |
Return whether a character is recognized as a path separator.
| character | Character to inspect. |
| std::string platform::join_path | ( | const std::string & | left, |
| const std::string & | right ) |
Join two path components using the preferred platform separator.
| left | Left path component. |
| right | Right path component. |
| std::string platform::parent_directory | ( | std::string_view | filePath | ) |
Return the parent directory portion of a file path.
| filePath | File path to inspect. |
| bool platform::path_has_prefix | ( | const std::string & | path, |
| const std::string & | prefix ) |
Return whether a path begins with the requested prefix.
| path | Full path to inspect. |
| prefix | Prefix to compare against. |
| char platform::preferred_path_separator | ( | ) |
Return the preferred path separator for the active platform.
| bool platform::try_get_file_size | ( | std::string_view | path, |
| std::uint64_t * | sizeBytes = nullptr ) |
Try to read the size of a regular file.
| path | File path to inspect. |
| sizeBytes | Optional output for the file size in bytes. |