mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-09 16:39:08 +01:00
vfs_real: Forward declare IOFile
Eliminates the need to rebuild some source files if the file_util header ever changes. This also uncovered some indirect inclusions, which have also been fixed.
This commit is contained in:
parent
325f3e0693
commit
a405373144
13 changed files with 45 additions and 15 deletions
|
@ -14,6 +14,9 @@
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/core_cpu.h"
|
#include "core/core_cpu.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
|
#include "core/file_sys/mode.h"
|
||||||
|
#include "core/file_sys/vfs_concat.h"
|
||||||
|
#include "core/file_sys/vfs_real.h"
|
||||||
#include "core/gdbstub/gdbstub.h"
|
#include "core/gdbstub/gdbstub.h"
|
||||||
#include "core/hle/kernel/client_port.h"
|
#include "core/hle/kernel/client_port.h"
|
||||||
#include "core/hle/kernel/kernel.h"
|
#include "core/hle/kernel/kernel.h"
|
||||||
|
@ -27,8 +30,6 @@
|
||||||
#include "core/perf_stats.h"
|
#include "core/perf_stats.h"
|
||||||
#include "core/settings.h"
|
#include "core/settings.h"
|
||||||
#include "core/telemetry_session.h"
|
#include "core/telemetry_session.h"
|
||||||
#include "file_sys/vfs_concat.h"
|
|
||||||
#include "file_sys/vfs_real.h"
|
|
||||||
#include "video_core/debug_utils/debug_utils.h"
|
#include "video_core/debug_utils/debug_utils.h"
|
||||||
#include "video_core/gpu.h"
|
#include "video_core/gpu.h"
|
||||||
#include "video_core/renderer_base.h"
|
#include "video_core/renderer_base.h"
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <mbedtls/sha256.h>
|
#include <mbedtls/sha256.h>
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/hex_util.h"
|
#include "common/hex_util.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/crypto/encryption_layer.h"
|
|
||||||
#include "core/file_sys/card_image.h"
|
#include "core/file_sys/card_image.h"
|
||||||
#include "core/file_sys/nca_metadata.h"
|
#include "core/file_sys/nca_metadata.h"
|
||||||
#include "core/file_sys/registered_cache.h"
|
#include "core/file_sys/registered_cache.h"
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/common_paths.h"
|
#include "common/common_paths.h"
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/file_sys/vfs_real.h"
|
#include "core/file_sys/vfs_real.h"
|
||||||
|
|
||||||
|
@ -39,6 +40,7 @@ static std::string ModeFlagsToString(Mode mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RealVfsFilesystem::RealVfsFilesystem() : VfsFilesystem(nullptr) {}
|
RealVfsFilesystem::RealVfsFilesystem() : VfsFilesystem(nullptr) {}
|
||||||
|
RealVfsFilesystem::~RealVfsFilesystem() = default;
|
||||||
|
|
||||||
std::string RealVfsFilesystem::GetName() const {
|
std::string RealVfsFilesystem::GetName() const {
|
||||||
return "Real";
|
return "Real";
|
||||||
|
@ -219,6 +221,8 @@ RealVfsFile::RealVfsFile(RealVfsFilesystem& base_, std::shared_ptr<FileUtil::IOF
|
||||||
parent_components(FileUtil::SliceVector(path_components, 0, path_components.size() - 1)),
|
parent_components(FileUtil::SliceVector(path_components, 0, path_components.size() - 1)),
|
||||||
perms(perms_) {}
|
perms(perms_) {}
|
||||||
|
|
||||||
|
RealVfsFile::~RealVfsFile() = default;
|
||||||
|
|
||||||
std::string RealVfsFile::GetName() const {
|
std::string RealVfsFile::GetName() const {
|
||||||
return path_components.back();
|
return path_components.back();
|
||||||
}
|
}
|
||||||
|
@ -312,6 +316,8 @@ RealVfsDirectory::RealVfsDirectory(RealVfsFilesystem& base_, const std::string&
|
||||||
FileUtil::CreateDir(path);
|
FileUtil::CreateDir(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RealVfsDirectory::~RealVfsDirectory() = default;
|
||||||
|
|
||||||
std::shared_ptr<VfsFile> RealVfsDirectory::GetFileRelative(std::string_view path) const {
|
std::shared_ptr<VfsFile> RealVfsDirectory::GetFileRelative(std::string_view path) const {
|
||||||
const auto full_path = FileUtil::SanitizePath(this->path + DIR_SEP + std::string(path));
|
const auto full_path = FileUtil::SanitizePath(this->path + DIR_SEP + std::string(path));
|
||||||
if (!FileUtil::Exists(full_path) || FileUtil::IsDirectory(full_path))
|
if (!FileUtil::Exists(full_path) || FileUtil::IsDirectory(full_path))
|
||||||
|
|
|
@ -6,15 +6,19 @@
|
||||||
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <boost/container/flat_map.hpp>
|
#include <boost/container/flat_map.hpp>
|
||||||
#include "common/file_util.h"
|
|
||||||
#include "core/file_sys/mode.h"
|
#include "core/file_sys/mode.h"
|
||||||
#include "core/file_sys/vfs.h"
|
#include "core/file_sys/vfs.h"
|
||||||
|
|
||||||
|
namespace FileUtil {
|
||||||
|
class IOFile;
|
||||||
|
}
|
||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
class RealVfsFilesystem : public VfsFilesystem {
|
class RealVfsFilesystem : public VfsFilesystem {
|
||||||
public:
|
public:
|
||||||
RealVfsFilesystem();
|
RealVfsFilesystem();
|
||||||
|
~RealVfsFilesystem() override;
|
||||||
|
|
||||||
std::string GetName() const override;
|
std::string GetName() const override;
|
||||||
bool IsReadable() const override;
|
bool IsReadable() const override;
|
||||||
|
@ -40,10 +44,9 @@ class RealVfsFile : public VfsFile {
|
||||||
friend class RealVfsDirectory;
|
friend class RealVfsDirectory;
|
||||||
friend class RealVfsFilesystem;
|
friend class RealVfsFilesystem;
|
||||||
|
|
||||||
RealVfsFile(RealVfsFilesystem& base, std::shared_ptr<FileUtil::IOFile> backing,
|
|
||||||
const std::string& path, Mode perms = Mode::Read);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
~RealVfsFile() override;
|
||||||
|
|
||||||
std::string GetName() const override;
|
std::string GetName() const override;
|
||||||
size_t GetSize() const override;
|
size_t GetSize() const override;
|
||||||
bool Resize(size_t new_size) override;
|
bool Resize(size_t new_size) override;
|
||||||
|
@ -55,6 +58,9 @@ public:
|
||||||
bool Rename(std::string_view name) override;
|
bool Rename(std::string_view name) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
RealVfsFile(RealVfsFilesystem& base, std::shared_ptr<FileUtil::IOFile> backing,
|
||||||
|
const std::string& path, Mode perms = Mode::Read);
|
||||||
|
|
||||||
bool Close();
|
bool Close();
|
||||||
|
|
||||||
RealVfsFilesystem& base;
|
RealVfsFilesystem& base;
|
||||||
|
@ -70,9 +76,9 @@ private:
|
||||||
class RealVfsDirectory : public VfsDirectory {
|
class RealVfsDirectory : public VfsDirectory {
|
||||||
friend class RealVfsFilesystem;
|
friend class RealVfsFilesystem;
|
||||||
|
|
||||||
RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, Mode perms = Mode::Read);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
~RealVfsDirectory() override;
|
||||||
|
|
||||||
std::shared_ptr<VfsFile> GetFileRelative(std::string_view path) const override;
|
std::shared_ptr<VfsFile> GetFileRelative(std::string_view path) const override;
|
||||||
std::shared_ptr<VfsDirectory> GetDirectoryRelative(std::string_view path) const override;
|
std::shared_ptr<VfsDirectory> GetDirectoryRelative(std::string_view path) const override;
|
||||||
std::shared_ptr<VfsFile> GetFile(std::string_view name) const override;
|
std::shared_ptr<VfsFile> GetFile(std::string_view name) const override;
|
||||||
|
@ -97,6 +103,8 @@ protected:
|
||||||
bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override;
|
bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, Mode perms = Mode::Read);
|
||||||
|
|
||||||
template <typename T, typename R>
|
template <typename T, typename R>
|
||||||
std::vector<std::shared_ptr<R>> IterateEntries() const;
|
std::vector<std::shared_ptr<R>> IterateEntries() const;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <mbedtls/md.h>
|
#include <mbedtls/md.h>
|
||||||
#include <mbedtls/sha256.h>
|
#include <mbedtls/sha256.h>
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/hex_util.h"
|
#include "common/hex_util.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/crypto/aes_util.h"
|
#include "core/crypto/aes_util.h"
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
#include "core/file_sys/vfs_real.h"
|
|
||||||
#include "core/hle/kernel/process.h"
|
#include "core/hle/kernel/process.h"
|
||||||
#include "core/loader/deconstructed_rom_directory.h"
|
#include "core/loader/deconstructed_rom_directory.h"
|
||||||
#include "core/loader/elf.h"
|
#include "core/loader/elf.h"
|
||||||
|
@ -144,6 +144,9 @@ std::ostream& operator<<(std::ostream& os, ResultStatus status) {
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AppLoader::AppLoader(FileSys::VirtualFile file) : file(std::move(file)) {}
|
||||||
|
AppLoader::~AppLoader() = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a loader for a file with a specific type
|
* Get a loader for a file with a specific type
|
||||||
* @param file The file to load
|
* @param file The file to load
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -12,7 +11,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/file_util.h"
|
|
||||||
#include "core/file_sys/vfs.h"
|
#include "core/file_sys/vfs.h"
|
||||||
#include "core/hle/kernel/object.h"
|
#include "core/hle/kernel/object.h"
|
||||||
|
|
||||||
|
@ -114,8 +112,8 @@ std::ostream& operator<<(std::ostream& os, ResultStatus status);
|
||||||
/// Interface for loading an application
|
/// Interface for loading an application
|
||||||
class AppLoader : NonCopyable {
|
class AppLoader : NonCopyable {
|
||||||
public:
|
public:
|
||||||
explicit AppLoader(FileSys::VirtualFile file) : file(std::move(file)) {}
|
explicit AppLoader(FileSys::VirtualFile file);
|
||||||
virtual ~AppLoader() {}
|
virtual ~AppLoader();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type of this file
|
* Returns the type of this file
|
||||||
|
|
|
@ -16,8 +16,9 @@
|
||||||
#include <boost/container/flat_map.hpp>
|
#include <boost/container/flat_map.hpp>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include "common/common_paths.h"
|
#include "common/common_paths.h"
|
||||||
|
#include "common/common_types.h"
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/string_util.h"
|
|
||||||
#include "core/file_sys/content_archive.h"
|
#include "core/file_sys/content_archive.h"
|
||||||
#include "core/file_sys/control_metadata.h"
|
#include "core/file_sys/control_metadata.h"
|
||||||
#include "core/file_sys/registered_cache.h"
|
#include "core/file_sys/registered_cache.h"
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "common/common_types.h"
|
||||||
|
|
||||||
class GameListWorker;
|
class GameListWorker;
|
||||||
class GMainWindow;
|
class GMainWindow;
|
||||||
|
|
||||||
|
|
|
@ -4,18 +4,23 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QRunnable>
|
#include <QRunnable>
|
||||||
#include <QStandardItem>
|
#include <QStandardItem>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#include "common/common_types.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
#include "yuzu/ui_settings.h"
|
#include "yuzu/ui_settings.h"
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include "common/common_paths.h"
|
#include "common/common_paths.h"
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/logging/backend.h"
|
#include "common/logging/backend.h"
|
||||||
#include "common/logging/filter.h"
|
#include "common/logging/filter.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
|
|
@ -6,8 +6,11 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include "common/common_types.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "ui_main.h"
|
#include "ui_main.h"
|
||||||
#include "yuzu/hotkeys.h"
|
#include "yuzu/hotkeys.h"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <fmt/ostream.h>
|
#include <fmt/ostream.h>
|
||||||
|
|
||||||
#include "common/common_paths.h"
|
#include "common/common_paths.h"
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/logging/backend.h"
|
#include "common/logging/backend.h"
|
||||||
#include "common/logging/filter.h"
|
#include "common/logging/filter.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
|
Loading…
Reference in a new issue