Merge pull request #1075 from lioncash/include

loader/{nca, xci}: Remove unnecessary includes and unused member variables
This commit is contained in:
bunnei 2018-08-16 00:04:25 -04:00 committed by GitHub
commit 24a759de4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 35 deletions

View File

@ -3,28 +3,22 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <utility> #include <utility>
#include <vector>
#include "common/file_util.h" #include "common/file_util.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/string_util.h"
#include "common/swap.h"
#include "core/core.h"
#include "core/file_sys/content_archive.h" #include "core/file_sys/content_archive.h"
#include "core/file_sys/program_metadata.h"
#include "core/gdbstub/gdbstub.h"
#include "core/hle/kernel/process.h" #include "core/hle/kernel/process.h"
#include "core/hle/kernel/resource_limit.h"
#include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/filesystem.h"
#include "core/loader/deconstructed_rom_directory.h"
#include "core/loader/nca.h" #include "core/loader/nca.h"
#include "core/loader/nso.h"
#include "core/memory.h"
namespace Loader { namespace Loader {
AppLoader_NCA::AppLoader_NCA(FileSys::VirtualFile file_) AppLoader_NCA::AppLoader_NCA(FileSys::VirtualFile file_)
: AppLoader(std::move(file_)), nca(std::make_unique<FileSys::NCA>(file)) {} : AppLoader(std::move(file_)), nca(std::make_unique<FileSys::NCA>(file)) {}
AppLoader_NCA::~AppLoader_NCA() = default;
FileType AppLoader_NCA::IdentifyType(const FileSys::VirtualFile& file) { FileType AppLoader_NCA::IdentifyType(const FileSys::VirtualFile& file) {
FileSys::NCA nca(file); FileSys::NCA nca(file);
@ -83,6 +77,4 @@ ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) {
return ResultStatus::Success; return ResultStatus::Success;
} }
AppLoader_NCA::~AppLoader_NCA() = default;
} // namespace Loader } // namespace Loader

View File

@ -4,20 +4,24 @@
#pragma once #pragma once
#include <string>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/file_sys/content_archive.h" #include "core/file_sys/vfs.h"
#include "core/file_sys/program_metadata.h"
#include "core/hle/kernel/object.h" #include "core/hle/kernel/object.h"
#include "core/loader/loader.h" #include "core/loader/loader.h"
#include "deconstructed_rom_directory.h"
namespace FileSys {
class NCA;
}
namespace Loader { namespace Loader {
class AppLoader_DeconstructedRomDirectory;
/// Loads an NCA file /// Loads an NCA file
class AppLoader_NCA final : public AppLoader { class AppLoader_NCA final : public AppLoader {
public: public:
explicit AppLoader_NCA(FileSys::VirtualFile file); explicit AppLoader_NCA(FileSys::VirtualFile file);
~AppLoader_NCA() override;
/** /**
* Returns the type of the file * Returns the type of the file
@ -35,12 +39,7 @@ public:
ResultStatus ReadRomFS(FileSys::VirtualFile& dir) override; ResultStatus ReadRomFS(FileSys::VirtualFile& dir) override;
ResultStatus ReadProgramId(u64& out_program_id) override; ResultStatus ReadProgramId(u64& out_program_id) override;
~AppLoader_NCA();
private: private:
FileSys::ProgramMetadata metadata;
FileSys::NCAHeader header;
std::unique_ptr<FileSys::NCA> nca; std::unique_ptr<FileSys::NCA> nca;
std::unique_ptr<AppLoader_DeconstructedRomDirectory> directory_loader; std::unique_ptr<AppLoader_DeconstructedRomDirectory> directory_loader;
}; };

View File

@ -4,22 +4,14 @@
#include <vector> #include <vector>
#include "common/file_util.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "core/file_sys/card_image.h"
#include "common/string_util.h"
#include "common/swap.h"
#include "core/core.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/program_metadata.h"
#include "core/file_sys/romfs.h" #include "core/file_sys/romfs.h"
#include "core/gdbstub/gdbstub.h"
#include "core/hle/kernel/process.h" #include "core/hle/kernel/process.h"
#include "core/hle/kernel/resource_limit.h" #include "core/loader/nca.h"
#include "core/hle/service/filesystem/filesystem.h"
#include "core/loader/nso.h"
#include "core/loader/xci.h" #include "core/loader/xci.h"
#include "core/memory.h"
namespace Loader { namespace Loader {

View File

@ -6,12 +6,18 @@
#include <memory> #include <memory>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/file_sys/card_image.h" #include "core/file_sys/vfs.h"
#include "core/loader/loader.h" #include "core/loader/loader.h"
#include "core/loader/nca.h"
namespace FileSys {
class NACP;
class XCI;
} // namespace FileSys
namespace Loader { namespace Loader {
class AppLoader_NCA;
/// Loads an XCI file /// Loads an XCI file
class AppLoader_XCI final : public AppLoader { class AppLoader_XCI final : public AppLoader {
public: public:
@ -37,8 +43,6 @@ public:
ResultStatus ReadTitle(std::string& title) override; ResultStatus ReadTitle(std::string& title) override;
private: private:
FileSys::ProgramMetadata metadata;
std::unique_ptr<FileSys::XCI> xci; std::unique_ptr<FileSys::XCI> xci;
std::unique_ptr<AppLoader_NCA> nca_loader; std::unique_ptr<AppLoader_NCA> nca_loader;