More changes

This commit is contained in:
Zach Hilman
2018-06-24 17:01:38 -04:00
parent a812e079f6
commit af1f6a94f7
34 changed files with 435 additions and 1220 deletions

View File

@@ -13,37 +13,32 @@
namespace Loader {
class Nca;
/// Loads an NCA file
class AppLoader_NCA final : public AppLoader {
public:
AppLoader_NCA(FileUtil::IOFile&& file, std::string filepath);
AppLoader_NCA(v_file file);
/**
* Returns the type of the file
* @param file FileUtil::IOFile open file
* @param filepath Path of the file that we are opening.
* @param file std::shared_ptr<VfsFile> open file
* @return FileType found, or FileType::Error if this loader doesn't know it
*/
static FileType IdentifyType(FileUtil::IOFile& file, const std::string& filepath);
static FileType IdentifyType(v_file file);
FileType GetFileType() override {
return IdentifyType(file, filepath);
return IdentifyType(file);
}
ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
u64& size) override;
ResultStatus ReadRomFS(v_dir& dir) override;
~AppLoader_NCA();
private:
std::string filepath;
FileSys::ProgramMetadata metadata;
std::unique_ptr<Nca> nca;
std::unique_ptr<FileSys::Nca> nca;
};
} // namespace Loader