mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 12:55:45 +00:00
User Data Migration from Citron, Sudachi, and Yuzu (#91)
Includes citron, sudachi, yuzu currently broken, because the eden dir is always made early? Signed-off-by: swurl <swurl@swurl.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/91 Co-authored-by: swurl <swurl@swurl.xyz> Co-committed-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
d659d6f5b4
commit
f786802b9b
62 changed files with 703 additions and 384 deletions
|
@ -1,6 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2025 eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
|
@ -10,8 +13,8 @@
|
|||
|
||||
namespace Common::FS {
|
||||
|
||||
enum class YuzuPath {
|
||||
YuzuDir, // Where yuzu stores its data.
|
||||
enum class EdenPath {
|
||||
EdenDir, // Where yuzu stores its data.
|
||||
AmiiboDir, // Where Amiibo backups are stored.
|
||||
CacheDir, // Where cached filesystem data is stored.
|
||||
ConfigDir, // Where config files are stored.
|
||||
|
@ -29,6 +32,24 @@ enum class YuzuPath {
|
|||
IconsDir, // Where Icons for Windows shortcuts are stored.
|
||||
};
|
||||
|
||||
enum LegacyPath {
|
||||
CitronDir, // Citron Directories for migration
|
||||
CitronConfigDir,
|
||||
CitronCacheDir,
|
||||
|
||||
SudachiDir, // Sudachi Directories for migration
|
||||
SudachiConfigDir,
|
||||
SudachiCacheDir,
|
||||
|
||||
YuzuDir, // Yuzu Directories for migration
|
||||
YuzuConfigDir,
|
||||
YuzuCacheDir,
|
||||
|
||||
SuyuDir, // Suyu Directories for migration
|
||||
SuyuConfigDir,
|
||||
SuyuCacheDir,
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates a given path.
|
||||
*
|
||||
|
@ -193,39 +214,62 @@ 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 EdenPath enum.
|
||||
*
|
||||
* @param yuzu_path YuzuPath enum
|
||||
* @param eden_path EdenPath enum
|
||||
*
|
||||
* @returns The filesystem path associated with the YuzuPath enum.
|
||||
* @returns The filesystem path associated with the EdenPath enum.
|
||||
*/
|
||||
[[nodiscard]] const std::filesystem::path& GetYuzuPath(YuzuPath yuzu_path);
|
||||
[[nodiscard]] const std::filesystem::path& GetEdenPath(EdenPath eden_path);
|
||||
|
||||
/**
|
||||
* Gets the filesystem path associated with the YuzuPath enum as a UTF-8 encoded std::string.
|
||||
* Gets the filesystem path associated with the LegacyPath enum.
|
||||
*
|
||||
* @param yuzu_path YuzuPath enum
|
||||
* @param legacy_path LegacyPath enum
|
||||
*
|
||||
* @returns The filesystem path associated with the YuzuPath enum as a UTF-8 encoded std::string.
|
||||
* @returns The filesystem path associated with the LegacyPath enum.
|
||||
*/
|
||||
[[nodiscard]] std::string GetYuzuPathString(YuzuPath yuzu_path);
|
||||
[[nodiscard]] const std::filesystem::path& GetLegacyPath(LegacyPath legacy_path);
|
||||
|
||||
/**
|
||||
* Sets a new filesystem path associated with the YuzuPath enum.
|
||||
* Gets the filesystem path associated with the EdenPath enum as a UTF-8 encoded std::string.
|
||||
*
|
||||
* @param eden_path EdenPath enum
|
||||
*
|
||||
* @returns The filesystem path associated with the EdenPath enum as a UTF-8 encoded std::string.
|
||||
*/
|
||||
[[nodiscard]] std::string GetEdenPathString(EdenPath eden_path);
|
||||
|
||||
/**
|
||||
* Gets the filesystem path associated with the LegacyPath enum as a UTF-8 encoded std::string.
|
||||
*
|
||||
* @param legacy_path LegacyPath enum
|
||||
*
|
||||
* @returns The filesystem path associated with the LegacyPath enum as a UTF-8 encoded std::string.
|
||||
*/
|
||||
[[nodiscard]] std::string GetLegacyPathString(LegacyPath legacy_path);
|
||||
|
||||
/**
|
||||
* Sets a new filesystem path associated with the EdenPath enum.
|
||||
* If the filesystem object at new_path is not a directory, this function will not do anything.
|
||||
*
|
||||
* @param yuzu_path YuzuPath enum
|
||||
* @param eden_path EdenPath enum
|
||||
* @param new_path New filesystem path
|
||||
*/
|
||||
void SetYuzuPath(YuzuPath yuzu_path, const std::filesystem::path& new_path);
|
||||
void SetEdenPath(EdenPath eden_path, const std::filesystem::path& new_path);
|
||||
|
||||
/**
|
||||
* Creates all necessary Eden paths in the filesystem.
|
||||
*/
|
||||
void CreateEdenPaths();
|
||||
|
||||
#ifdef _WIN32
|
||||
template <typename Path>
|
||||
void SetYuzuPath(YuzuPath yuzu_path, const Path& new_path) {
|
||||
void SetEdenPath(EdenPath eden_path, const Path& new_path) {
|
||||
if constexpr (IsChar<typename Path::value_type>) {
|
||||
SetYuzuPath(yuzu_path, ToU8String(new_path));
|
||||
SetEdenPath(eden_path, ToU8String(new_path));
|
||||
} else {
|
||||
SetYuzuPath(yuzu_path, std::filesystem::path{new_path});
|
||||
SetEdenPath(eden_path, std::filesystem::path{new_path});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue