yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
platform_paths.h
Go to the documentation of this file.
1#ifndef YAZE_UTIL_PLATFORM_PATHS_H_
2#define YAZE_UTIL_PLATFORM_PATHS_H_
3
4#include <filesystem>
5#include <string>
6
7#include "absl/status/statusor.h"
8
9namespace yaze {
10namespace util {
11
19 public:
29 static std::filesystem::path GetHomeDirectory();
30
42 static absl::StatusOr<std::filesystem::path> GetAppDataDirectory();
43
55 static absl::StatusOr<std::filesystem::path> GetConfigDirectory();
56
68 static absl::StatusOr<std::filesystem::path> GetUserDocumentsDirectory();
69
78 static absl::StatusOr<std::filesystem::path> GetUserDocumentsSubdirectory(
79 const std::string& subdir);
80
89 static absl::StatusOr<std::filesystem::path> GetAppDataSubdirectory(
90 const std::string& subdir);
91
100 static absl::Status EnsureDirectoryExists(const std::filesystem::path& path);
101
108 static bool Exists(const std::filesystem::path& path);
109
118 static absl::StatusOr<std::filesystem::path> GetTempDirectory();
119
129 static std::string NormalizePathForDisplay(const std::filesystem::path& path);
130
139 static std::string ToNativePath(const std::filesystem::path& path);
140
156 static absl::StatusOr<std::filesystem::path> FindAsset(
157 const std::string& relative_path);
158};
159
160} // namespace util
161} // namespace yaze
162
163#endif // YAZE_UTIL_PLATFORM_PATHS_H_
Cross-platform utilities for file system paths.
static absl::StatusOr< std::filesystem::path > GetTempDirectory()
Get a temporary directory for the application.
static absl::StatusOr< std::filesystem::path > GetAppDataDirectory()
Get the user-specific application data directory for YAZE.
static absl::StatusOr< std::filesystem::path > GetAppDataSubdirectory(const std::string &subdir)
Get a subdirectory within the app data folder.
static std::string ToNativePath(const std::filesystem::path &path)
Convert path to native format.
static absl::StatusOr< std::filesystem::path > GetConfigDirectory()
Get the user-specific configuration directory for YAZE.
static absl::StatusOr< std::filesystem::path > GetUserDocumentsSubdirectory(const std::string &subdir)
Get a subdirectory within the user documents folder.
static absl::StatusOr< std::filesystem::path > GetUserDocumentsDirectory()
Get the user's Documents directory.
static absl::StatusOr< std::filesystem::path > FindAsset(const std::string &relative_path)
Find an asset file in multiple standard locations.
static absl::Status EnsureDirectoryExists(const std::filesystem::path &path)
Ensure a directory exists, creating it if necessary.
static std::string NormalizePathForDisplay(const std::filesystem::path &path)
Normalize path separators for display.
static bool Exists(const std::filesystem::path &path)
Check if a file or directory exists.
static std::filesystem::path GetHomeDirectory()
Get the user's home directory in a cross-platform way.