2022-04-23 10:59:50 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2019-06-05 06:21:17 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "core/loader/loader.h"
|
|
|
|
|
2020-09-16 14:19:25 +02:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2019-06-05 06:21:17 +02:00
|
|
|
namespace FileSys {
|
|
|
|
class KIP;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Loader {
|
|
|
|
|
|
|
|
class AppLoader_KIP final : public AppLoader {
|
|
|
|
public:
|
|
|
|
explicit AppLoader_KIP(FileSys::VirtualFile file);
|
|
|
|
~AppLoader_KIP() override;
|
|
|
|
|
|
|
|
/**
|
2021-04-27 18:05:34 +02:00
|
|
|
* Identifies whether or not the given file is a KIP.
|
|
|
|
*
|
|
|
|
* @param in_file The file to identify.
|
|
|
|
*
|
|
|
|
* @return FileType::KIP if found, or FileType::Error if unknown.
|
2019-06-05 06:21:17 +02:00
|
|
|
*/
|
2021-04-27 18:05:34 +02:00
|
|
|
static FileType IdentifyType(const FileSys::VirtualFile& in_file);
|
2019-06-05 06:21:17 +02:00
|
|
|
|
|
|
|
FileType GetFileType() const override;
|
|
|
|
|
2021-04-24 07:04:28 +02:00
|
|
|
LoadResult Load(Kernel::KProcess& process, Core::System& system) override;
|
2019-06-05 06:21:17 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<FileSys::KIP> kip;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Loader
|