diff options
author | Zephyron <zephyron@citron-emu.org> | 2024-12-31 17:07:49 +1000 |
---|---|---|
committer | Zephyron <zephyron@citron-emu.org> | 2024-12-31 17:07:49 +1000 |
commit | b3facaa6bb30cdc39f2b7d632fef1e3bfeee7785 (patch) | |
tree | 77d03cd30542cd5e1addc61f240b8120a5909e90 /src/common/fs | |
parent | 6778aa8ec8e5fa0d246ac4b9ec00c10213c30ce5 (diff) |
chore: update project references and add Citron copyright
- Replaced all references to the old project name with Citron.
- Added Citron copyright information alongside existing notices in all files.
Diffstat (limited to 'src/common/fs')
-rw-r--r-- | src/common/fs/file.cpp | 2 | ||||
-rw-r--r-- | src/common/fs/file.h | 2 | ||||
-rw-r--r-- | src/common/fs/fs.cpp | 2 | ||||
-rw-r--r-- | src/common/fs/fs.h | 2 | ||||
-rw-r--r-- | src/common/fs/fs_android.cpp | 2 | ||||
-rw-r--r-- | src/common/fs/fs_android.h | 2 | ||||
-rw-r--r-- | src/common/fs/fs_paths.h | 12 | ||||
-rw-r--r-- | src/common/fs/fs_types.h | 2 | ||||
-rw-r--r-- | src/common/fs/fs_util.cpp | 2 | ||||
-rw-r--r-- | src/common/fs/fs_util.h | 2 | ||||
-rw-r--r-- | src/common/fs/path_util.cpp | 108 | ||||
-rw-r--r-- | src/common/fs/path_util.h | 44 |
12 files changed, 91 insertions, 91 deletions
diff --git a/src/common/fs/file.cpp b/src/common/fs/file.cpp index b0b25eb43..cbc2d50d5 100644 --- a/src/common/fs/file.cpp +++ b/src/common/fs/file.cpp @@ -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 #include <vector> diff --git a/src/common/fs/file.h b/src/common/fs/file.h index 2e2396075..c5c58ccfb 100644 --- a/src/common/fs/file.h +++ b/src/common/fs/file.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 diff --git a/src/common/fs/fs.cpp b/src/common/fs/fs.cpp index 174aed49b..0386ba386 100644 --- a/src/common/fs/fs.cpp +++ b/src/common/fs/fs.cpp @@ -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 #include "common/fs/file.h" diff --git a/src/common/fs/fs.h b/src/common/fs/fs.h index ce3eb309a..144058b13 100644 --- a/src/common/fs/fs.h +++ b/src/common/fs/fs.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 diff --git a/src/common/fs/fs_android.cpp b/src/common/fs/fs_android.cpp index 9a8053222..353c30bac 100644 --- a/src/common/fs/fs_android.cpp +++ b/src/common/fs/fs_android.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2025 citron Homebrew Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/android/android_common.h" diff --git a/src/common/fs/fs_android.h b/src/common/fs/fs_android.h index b33f4beb8..75aa9ba6a 100644 --- a/src/common/fs/fs_android.h +++ b/src/common/fs/fs_android.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2025 citron Homebrew Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/fs/fs_paths.h b/src/common/fs/fs_paths.h index bcf447089..dc106b792 100644 --- a/src/common/fs/fs_paths.h +++ b/src/common/fs/fs_paths.h @@ -1,14 +1,14 @@ -// 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 -// yuzu data directories +// citron data directories -#define YUZU_DIR "yuzu" +#define CITRON_DIR "citron" #define PORTABLE_DIR "user" -// Sub-directories contained within a yuzu data directory +// Sub-directories contained within a citron data directory #define AMIIBO_DIR "amiibo" #define CACHE_DIR "cache" @@ -26,6 +26,6 @@ #define TAS_DIR "tas" #define ICONS_DIR "icons" -// yuzu-specific files +// citron-specific files -#define LOG_FILE "yuzu_log.txt" +#define LOG_FILE "citron_log.txt" diff --git a/src/common/fs/fs_types.h b/src/common/fs/fs_types.h index 900f85d24..1fb5f7592 100644 --- a/src/common/fs/fs_types.h +++ b/src/common/fs/fs_types.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 diff --git a/src/common/fs/fs_util.cpp b/src/common/fs/fs_util.cpp index 813a713c3..54dbf00ba 100644 --- a/src/common/fs/fs_util.cpp +++ b/src/common/fs/fs_util.cpp @@ -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 #include <algorithm> diff --git a/src/common/fs/fs_util.h b/src/common/fs/fs_util.h index 2492a9f94..341444430 100644 --- a/src/common/fs/fs_util.h +++ b/src/common/fs/fs_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 diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 4f69db6f5..9745870f0 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp @@ -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 #include <algorithm> @@ -56,10 +56,10 @@ namespace fs = std::filesystem; /** * The PathManagerImpl is a singleton allowing to manage the mapping of - * YuzuPath enums to real filesystem paths. - * This class provides 2 functions: GetYuzuPathImpl and SetYuzuPathImpl. - * These are used by GetYuzuPath and SetYuzuPath respectively to get or modify - * the path mapped by the YuzuPath enum. + * CitronPath enums to real filesystem paths. + * This class provides 2 functions: GetCitronPathImpl and SetCitronPathImpl. + * These are used by GetCitronPath and SetCitronPath respectively to get or modify + * the path mapped by the CitronPath enum. */ class PathManagerImpl { public: @@ -75,62 +75,62 @@ public: PathManagerImpl(PathManagerImpl&&) = delete; PathManagerImpl& operator=(PathManagerImpl&&) = delete; - [[nodiscard]] const fs::path& GetYuzuPathImpl(YuzuPath yuzu_path) { - return yuzu_paths.at(yuzu_path); + [[nodiscard]] const fs::path& GetCitronPathImpl(CitronPath citron_path) { + return citron_paths.at(citron_path); } - void SetYuzuPathImpl(YuzuPath yuzu_path, const fs::path& new_path) { - yuzu_paths.insert_or_assign(yuzu_path, new_path); + void SetCitronPathImpl(CitronPath citron_path, const fs::path& new_path) { + citron_paths.insert_or_assign(citron_path, new_path); } - void Reinitialize(fs::path yuzu_path = {}) { - fs::path yuzu_path_cache; - fs::path yuzu_path_config; + void Reinitialize(fs::path citron_path = {}) { + fs::path citron_path_cache; + fs::path citron_path_config; #ifdef _WIN32 -#ifdef YUZU_ENABLE_PORTABLE - yuzu_path = GetExeDirectory() / PORTABLE_DIR; +#ifdef CITRON_ENABLE_PORTABLE + citron_path = GetExeDirectory() / PORTABLE_DIR; #endif - if (!IsDir(yuzu_path)) { - yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; + if (!IsDir(citron_path)) { + citron_path = GetAppDataRoamingDirectory() / CITRON_DIR; } - yuzu_path_cache = yuzu_path / CACHE_DIR; - yuzu_path_config = yuzu_path / CONFIG_DIR; + citron_path_cache = citron_path / CACHE_DIR; + citron_path_config = citron_path / CONFIG_DIR; #elif ANDROID - ASSERT(!yuzu_path.empty()); - yuzu_path_cache = yuzu_path / CACHE_DIR; - yuzu_path_config = yuzu_path / CONFIG_DIR; + ASSERT(!citron_path.empty()); + citron_path_cache = citron_path / CACHE_DIR; + citron_path_config = citron_path / CONFIG_DIR; #else -#ifdef YUZU_ENABLE_PORTABLE - yuzu_path = GetCurrentDir() / PORTABLE_DIR; +#ifdef CITRON_ENABLE_PORTABLE + citron_path = GetCurrentDir() / PORTABLE_DIR; #endif - if (Exists(yuzu_path) && IsDir(yuzu_path)) { - yuzu_path_cache = yuzu_path / CACHE_DIR; - yuzu_path_config = yuzu_path / CONFIG_DIR; + if (Exists(citron_path) && IsDir(citron_path)) { + citron_path_cache = citron_path / CACHE_DIR; + citron_path_config = citron_path / CONFIG_DIR; } else { - yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; - yuzu_path_cache = GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR; - yuzu_path_config = GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR; + citron_path = GetDataDirectory("XDG_DATA_HOME") / CITRON_DIR; + citron_path_cache = GetDataDirectory("XDG_CACHE_HOME") / CITRON_DIR; + citron_path_config = GetDataDirectory("XDG_CONFIG_HOME") / CITRON_DIR; } #endif - GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); - GenerateYuzuPath(YuzuPath::AmiiboDir, yuzu_path / AMIIBO_DIR); - GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache); - GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config); - GenerateYuzuPath(YuzuPath::CrashDumpsDir, yuzu_path / CRASH_DUMPS_DIR); - GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); - GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); - GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); - GenerateYuzuPath(YuzuPath::LogDir, yuzu_path / LOG_DIR); - GenerateYuzuPath(YuzuPath::NANDDir, yuzu_path / NAND_DIR); - GenerateYuzuPath(YuzuPath::PlayTimeDir, yuzu_path / PLAY_TIME_DIR); - GenerateYuzuPath(YuzuPath::ScreenshotsDir, yuzu_path / SCREENSHOTS_DIR); - GenerateYuzuPath(YuzuPath::SDMCDir, yuzu_path / SDMC_DIR); - GenerateYuzuPath(YuzuPath::ShaderDir, yuzu_path / SHADER_DIR); - GenerateYuzuPath(YuzuPath::TASDir, yuzu_path / TAS_DIR); - GenerateYuzuPath(YuzuPath::IconsDir, yuzu_path / ICONS_DIR); + GenerateCitronPath(CitronPath::CitronDir, citron_path); + GenerateCitronPath(CitronPath::AmiiboDir, citron_path / AMIIBO_DIR); + GenerateCitronPath(CitronPath::CacheDir, citron_path_cache); + GenerateCitronPath(CitronPath::ConfigDir, citron_path_config); + GenerateCitronPath(CitronPath::CrashDumpsDir, citron_path / CRASH_DUMPS_DIR); + GenerateCitronPath(CitronPath::DumpDir, citron_path / DUMP_DIR); + GenerateCitronPath(CitronPath::KeysDir, citron_path / KEYS_DIR); + GenerateCitronPath(CitronPath::LoadDir, citron_path / LOAD_DIR); + GenerateCitronPath(CitronPath::LogDir, citron_path / LOG_DIR); + GenerateCitronPath(CitronPath::NANDDir, citron_path / NAND_DIR); + GenerateCitronPath(CitronPath::PlayTimeDir, citron_path / PLAY_TIME_DIR); + GenerateCitronPath(CitronPath::ScreenshotsDir, citron_path / SCREENSHOTS_DIR); + GenerateCitronPath(CitronPath::SDMCDir, citron_path / SDMC_DIR); + GenerateCitronPath(CitronPath::ShaderDir, citron_path / SHADER_DIR); + GenerateCitronPath(CitronPath::TASDir, citron_path / TAS_DIR); + GenerateCitronPath(CitronPath::IconsDir, citron_path / ICONS_DIR); } private: @@ -140,13 +140,13 @@ private: ~PathManagerImpl() = default; - void GenerateYuzuPath(YuzuPath yuzu_path, const fs::path& new_path) { + void GenerateCitronPath(CitronPath citron_path, const fs::path& new_path) { void(FS::CreateDir(new_path)); - SetYuzuPathImpl(yuzu_path, new_path); + SetCitronPathImpl(citron_path, new_path); } - std::unordered_map<YuzuPath, fs::path> yuzu_paths; + std::unordered_map<CitronPath, fs::path> citron_paths; }; bool ValidatePath(const fs::path& path) { @@ -230,22 +230,22 @@ void SetAppDirectory(const std::string& app_directory) { PathManagerImpl::GetInstance().Reinitialize(app_directory); } -const fs::path& GetYuzuPath(YuzuPath yuzu_path) { - return PathManagerImpl::GetInstance().GetYuzuPathImpl(yuzu_path); +const fs::path& GetCitronPath(CitronPath citron_path) { + return PathManagerImpl::GetInstance().GetCitronPathImpl(citron_path); } -std::string GetYuzuPathString(YuzuPath yuzu_path) { - return PathToUTF8String(GetYuzuPath(yuzu_path)); +std::string GetCitronPathString(CitronPath citron_path) { + return PathToUTF8String(GetCitronPath(citron_path)); } -void SetYuzuPath(YuzuPath yuzu_path, const fs::path& new_path) { +void SetCitronPath(CitronPath citron_path, const fs::path& new_path) { if (!FS::IsDir(new_path)) { LOG_ERROR(Common_Filesystem, "Filesystem object at new_path={} is not a directory", PathToUTF8String(new_path)); return; } - PathManagerImpl::GetInstance().SetYuzuPathImpl(yuzu_path, new_path); + PathManagerImpl::GetInstance().SetCitronPathImpl(citron_path, new_path); } #ifdef _WIN32 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 '\\' |