diff options
Diffstat (limited to 'src/common/fs/path_util.h')
-rw-r--r-- | src/common/fs/path_util.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index 59301e7ed..aeb9228a0 100644 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project & 2025 citron Homebrew Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -10,8 +10,8 @@ namespace Common::FS { -enum class YuzuPath { - YuzuDir, // Where yuzu stores its data. +enum class CitronPath { + CitronDir, // Where citron stores its data. AmiiboDir, // Where Amiibo backups are stored. CacheDir, // Where cached filesystem data is stored. ConfigDir, // Where config files are stored. @@ -22,7 +22,7 @@ enum class YuzuPath { LogDir, // Where log files are stored. NANDDir, // Where the emulated NAND is stored. PlayTimeDir, // Where play time data is stored. - ScreenshotsDir, // Where yuzu screenshots are stored. + ScreenshotsDir, // Where citron screenshots are stored. SDMCDir, // Where the emulated SDMC is stored. ShaderDir, // Where shaders are stored. TASDir, // Where TAS scripts are stored. @@ -193,39 +193,39 @@ template <typename Path> void SetAppDirectory(const std::string& app_directory); /** - * Gets the filesystem path associated with the YuzuPath enum. + * Gets the filesystem path associated with the CitronPath enum. * - * @param yuzu_path YuzuPath enum + * @param citron_path CitronPath enum * - * @returns The filesystem path associated with the YuzuPath enum. + * @returns The filesystem path associated with the CitronPath enum. */ -[[nodiscard]] const std::filesystem::path& GetYuzuPath(YuzuPath yuzu_path); +[[nodiscard]] const std::filesystem::path& GetCitronPath(CitronPath citron_path); /** - * Gets the filesystem path associated with the YuzuPath enum as a UTF-8 encoded std::string. + * Gets the filesystem path associated with the CitronPath enum as a UTF-8 encoded std::string. * - * @param yuzu_path YuzuPath enum + * @param citron_path CitronPath enum * - * @returns The filesystem path associated with the YuzuPath enum as a UTF-8 encoded std::string. + * @returns The filesystem path associated with the CitronPath enum as a UTF-8 encoded std::string. */ -[[nodiscard]] std::string GetYuzuPathString(YuzuPath yuzu_path); +[[nodiscard]] std::string GetCitronPathString(CitronPath citron_path); /** - * Sets a new filesystem path associated with the YuzuPath enum. + * Sets a new filesystem path associated with the CitronPath enum. * If the filesystem object at new_path is not a directory, this function will not do anything. * - * @param yuzu_path YuzuPath enum + * @param citron_path CitronPath enum * @param new_path New filesystem path */ -void SetYuzuPath(YuzuPath yuzu_path, const std::filesystem::path& new_path); +void SetCitronPath(CitronPath citron_path, const std::filesystem::path& new_path); #ifdef _WIN32 template <typename Path> -void SetYuzuPath(YuzuPath yuzu_path, const Path& new_path) { +void SetCitronPath(CitronPath citron_path, const Path& new_path) { if constexpr (IsChar<typename Path::value_type>) { - SetYuzuPath(yuzu_path, ToU8String(new_path)); + SetCitronPath(citron_path, ToU8String(new_path)); } else { - SetYuzuPath(yuzu_path, std::filesystem::path{new_path}); + SetCitronPath(citron_path, std::filesystem::path{new_path}); } } #endif @@ -257,14 +257,14 @@ void SetYuzuPath(YuzuPath yuzu_path, const Path& new_path) { [[nodiscard]] std::filesystem::path GetHomeDirectory(); /** - * Gets the relevant paths for yuzu to store its data based on the given XDG environment variable. + * Gets the relevant paths for citron to store its data based on the given XDG environment variable. * See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html * Defaults to $HOME/.local/share for main application data, * $HOME/.cache for cached data, and $HOME/.config for configuration files. * * @param env_name XDG environment variable name * - * @returns The path where yuzu should store its data. + * @returns The path where citron should store its data. */ [[nodiscard]] std::filesystem::path GetDataDirectory(const std::string& env_name); @@ -288,11 +288,11 @@ enum class DirectorySeparator { }; // Splits the path on '/' or '\' and put the components into a vector -// i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" } +// i.e. "C:\Users\Citron\Documents\save.bin" becomes {"C:", "Users", "Citron", "Documents", "save.bin" } [[nodiscard]] std::vector<std::string_view> SplitPathComponents(std::string_view filename); // Splits the path on '/' or '\' and put the components into a vector -// i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" } +// i.e. "C:\Users\Citron\Documents\save.bin" becomes {"C:", "Users", "Citron", "Documents", "save.bin" } [[nodiscard]] std::vector<std::string> SplitPathComponentsCopy(std::string_view filename); // Removes trailing slash, makes all '\\' into '/', and removes duplicate '/'. Makes '/' into '\\' |