summaryrefslogtreecommitdiffstats
path: root/src/core/loader/loader.h
diff options
context:
space:
mode:
authorZach Hilman <DarkLordZach@users.noreply.github.com>2018-07-19 03:07:11 +0200
committerbunnei <bunneidev@gmail.com>2018-07-19 03:07:11 +0200
commit29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef (patch)
tree3202e2ce55ab6387a4ca366a509eccdd963434c3 /src/core/loader/loader.h
parentMerge pull request #683 from DarkLordZach/touch (diff)
downloadyuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.gz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.bz2
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.lz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.xz
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.zst
yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.zip
Diffstat (limited to 'src/core/loader/loader.h')
-rw-r--r--src/core/loader/loader.h30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index b76f7b13d..1da9e8099 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -13,6 +13,7 @@
#include <boost/optional.hpp>
#include "common/common_types.h"
#include "common/file_util.h"
+#include "core/file_sys/vfs.h"
#include "core/hle/kernel/kernel.h"
namespace Kernel {
@@ -36,10 +37,9 @@ enum class FileType {
/**
* Identifies the type of a bootable file based on the magic value in its header.
* @param file open file
- * @param filepath Path of the file that we are opening.
* @return FileType of file
*/
-FileType IdentifyFile(FileUtil::IOFile& file, const std::string& filepath);
+FileType IdentifyFile(FileSys::VirtualFile file);
/**
* Identifies the type of a bootable file based on the magic value in its header.
@@ -50,12 +50,12 @@ FileType IdentifyFile(FileUtil::IOFile& file, const std::string& filepath);
FileType IdentifyFile(const std::string& file_name);
/**
- * Guess the type of a bootable file from its extension
- * @param extension String extension of bootable file
+ * Guess the type of a bootable file from its name
+ * @param name String name of bootable file
* @return FileType of file. Note: this will return FileType::Unknown if it is unable to determine
* a filetype, and will never return FileType::Error.
*/
-FileType GuessFromExtension(const std::string& extension);
+FileType GuessFromFilename(const std::string& name);
/**
* Convert a FileType into a string which can be displayed to the user.
@@ -79,7 +79,7 @@ enum class ResultStatus {
/// Interface for loading an application
class AppLoader : NonCopyable {
public:
- AppLoader(FileUtil::IOFile&& file) : file(std::move(file)) {}
+ AppLoader(FileSys::VirtualFile file) : file(std::move(file)) {}
virtual ~AppLoader() {}
/**
@@ -154,26 +154,20 @@ public:
/**
* Get the RomFS of the application
* Since the RomFS can be huge, we return a file reference instead of copying to a buffer
- * @param romfs_file The file containing the RomFS
- * @param offset The offset the romfs begins on
- * @param size The size of the romfs
+ * @param file The file containing the RomFS
* @return ResultStatus result of function
*/
- virtual ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
- u64& size) {
+ virtual ResultStatus ReadRomFS(FileSys::VirtualFile& dir) {
return ResultStatus::ErrorNotImplemented;
}
/**
* Get the update RomFS of the application
* Since the RomFS can be huge, we return a file reference instead of copying to a buffer
- * @param romfs_file The file containing the RomFS
- * @param offset The offset the romfs begins on
- * @param size The size of the romfs
+ * @param file The file containing the RomFS
* @return ResultStatus result of function
*/
- virtual ResultStatus ReadUpdateRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
- u64& size) {
+ virtual ResultStatus ReadUpdateRomFS(FileSys::VirtualFile& file) {
return ResultStatus::ErrorNotImplemented;
}
@@ -187,7 +181,7 @@ public:
}
protected:
- FileUtil::IOFile file;
+ FileSys::VirtualFile file;
bool is_loaded = false;
};
@@ -202,6 +196,6 @@ extern const std::initializer_list<Kernel::AddressMapping> default_address_mappi
* @param filename String filename of bootable file
* @return best loader for this file
*/
-std::unique_ptr<AppLoader> GetLoader(const std::string& filename);
+std::unique_ptr<AppLoader> GetLoader(FileSys::VirtualFile file);
} // namespace Loader