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> GetAppDataSubdirectory(
66 const std::string& subdir);
67
76 static absl::Status EnsureDirectoryExists(const std::filesystem::path& path);
77
84 static bool Exists(const std::filesystem::path& path);
85
94 static absl::StatusOr<std::filesystem::path> GetTempDirectory();
95
105 static std::string NormalizePathForDisplay(const std::filesystem::path& path);
106
115 static std::string ToNativePath(const std::filesystem::path& path);
116
131 static absl::StatusOr<std::filesystem::path> FindAsset(
132 const std::string& relative_path);
133};
134
135} // namespace util
136} // namespace yaze
137
138#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 > 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.
Main namespace for the application.