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
65 static absl::StatusOr<std::filesystem::path> GetImGuiIniPath();
66
78 static absl::StatusOr<std::filesystem::path> GetUserDocumentsDirectory();
79
88 static absl::StatusOr<std::filesystem::path> GetUserDocumentsSubdirectory(
89 const std::string& subdir);
90
99 static absl::StatusOr<std::filesystem::path> GetAppDataSubdirectory(
100 const std::string& subdir);
101
110 static absl::Status EnsureDirectoryExists(const std::filesystem::path& path);
111
118 static bool Exists(const std::filesystem::path& path);
119
128 static absl::StatusOr<std::filesystem::path> GetTempDirectory();
129
139 static std::string NormalizePathForDisplay(const std::filesystem::path& path);
140
149 static std::string ToNativePath(const std::filesystem::path& path);
150
166 static absl::StatusOr<std::filesystem::path> FindAsset(
167 const std::string& relative_path);
168};
169
170} // namespace util
171} // namespace yaze
172
173#endif // YAZE_UTIL_PLATFORM_PATHS_H_
Cross-platform utilities for file system paths.
static absl::StatusOr< std::filesystem::path > GetImGuiIniPath()
Get the ImGui ini path for YAZE.
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.