diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-02-10 05:34:48 -0800 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-03-20 14:56:32 -0700 |
commit | 2e8d04aad0d4fe3e742e4b29f4e23dc91b8ef838 (patch) | |
tree | a8d2f18a5cf68d3e5b0690c952e1909921e92c28 /launcher/FileSystem.h | |
parent | 3a0e4546c2a1914c18f71622727997a2a7518ad2 (diff) | |
download | PrismLauncher-2e8d04aad0d4fe3e742e4b29f4e23dc91b8ef838.tar.gz PrismLauncher-2e8d04aad0d4fe3e742e4b29f4e23dc91b8ef838.tar.bz2 PrismLauncher-2e8d04aad0d4fe3e742e4b29f4e23dc91b8ef838.zip |
feat: support reflink on windows via winbtrfs!
https://github.com/maharmstone/btrfs
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/FileSystem.h')
-rw-r--r-- | launcher/FileSystem.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/launcher/FileSystem.h b/launcher/FileSystem.h index 7485206a..3f6b78e5 100644 --- a/launcher/FileSystem.h +++ b/launcher/FileSystem.h @@ -344,6 +344,7 @@ bool createShortcut(QString destination, QString target, QStringList args, QStri enum class FilesystemType { FAT, NTFS, + REFS, EXT, EXT_2_OLD, EXT_2_3_4, @@ -363,6 +364,7 @@ enum class FilesystemType { static const QMap<FilesystemType, QString> s_filesystem_type_names = { {FilesystemType::FAT, QString("FAT")}, {FilesystemType::NTFS, QString("NTFS")}, + {FilesystemType::REFS, QString("REFS")}, {FilesystemType::EXT, QString("EXT")}, {FilesystemType::EXT_2_OLD, QString("EXT2_OLD")}, {FilesystemType::EXT_2_3_4, QString("EXT2/3/4")}, @@ -382,6 +384,7 @@ static const QMap<FilesystemType, QString> s_filesystem_type_names = { static const QMap<QString, FilesystemType> s_filesystem_type_names_inverse = { {QString("FAT"), FilesystemType::FAT}, {QString("NTFS"), FilesystemType::NTFS}, + {QString("REFS"), FilesystemType::REFS}, {QString("EXT2_OLD"), FilesystemType::EXT_2_OLD}, {QString("EXT2"), FilesystemType::EXT_2_3_4}, {QString("EXT3"), FilesystemType::EXT_2_3_4}, @@ -415,14 +418,20 @@ struct FilesystemInfo { }; /** + * @brief path to the near ancestor that exsists + * + */ +QString NearestExistentAncestor(const QString& path); + +/** * @brief colect information about the filesystem under a file * */ -FilesystemInfo statFS(QString path); +FilesystemInfo statFS(const QString& path); static const QList<FilesystemType> s_clone_filesystems = { - FilesystemType::BTRFS, FilesystemType::APFS, FilesystemType::ZFS, FilesystemType::XFS + FilesystemType::BTRFS, FilesystemType::APFS, FilesystemType::ZFS, FilesystemType::XFS, FilesystemType::REFS }; /** @@ -486,6 +495,14 @@ class clone : public QObject { */ bool clone_file(const QString& src, const QString& dst, std::error_code& ec); +#if defined(Q_OS_WIN) +bool winbtrfs_clone(const std::wstring& src_path, const std::wstring& dst_path, std::error_code& ec); +bool refs_clone(const std::wstring& src_path, const std::wstring& dst_path, std::error_code& ec); +#elif defined(Q_OS_LINUX) +bool linux_ficlone(const std::string& src_path, const std::string& dst_path, std::error_code& ec); +#elif defined(Q_OS_MACOS) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) +bool macos_bsd_clonefile(const std::string& src_path, const std::string& dst_path, std::error_code& ec); +#endif static const QList<FilesystemType> s_non_link_filesystems = { FilesystemType::FAT, |