1 // Copyright 2014 Dolphin Emulator Project / Citra Emulator Project
2 // Licensed under GPLv2 or any later version
3 // Refer to the license.txt file included.
4 
5 #pragma once
6 
7 #include <memory>
8 #include <string>
9 #include "common/common_types.h"
10 #include "core/loader/loader.h"
11 
12 ////////////////////////////////////////////////////////////////////////////////////////////////////
13 // Loader namespace
14 
15 namespace Loader {
16 
17 /// Loads an 3DSX file
18 class AppLoader_THREEDSX final : public AppLoader {
19 public:
AppLoader_THREEDSX(FileUtil::IOFile && file,const std::string & filename,const std::string & filepath)20     AppLoader_THREEDSX(FileUtil::IOFile&& file, const std::string& filename,
21                        const std::string& filepath)
22         : AppLoader(std::move(file)), filename(std::move(filename)), filepath(filepath) {}
23 
24     /**
25      * Returns the type of the file
26      * @param file FileUtil::IOFile open file
27      * @return FileType found, or FileType::Error if this loader doesn't know it
28      */
29     static FileType IdentifyType(FileUtil::IOFile& file);
30 
GetFileType()31     FileType GetFileType() override {
32         return IdentifyType(file);
33     }
34 
35     ResultStatus Load(std::shared_ptr<Kernel::Process>& process) override;
36 
37     ResultStatus ReadIcon(std::vector<u8>& buffer) override;
38 
39     ResultStatus ReadRomFS(std::shared_ptr<FileSys::RomFSReader>& romfs_file) override;
40 
41 private:
42     std::string filename;
43     std::string filepath;
44 };
45 
46 } // namespace Loader
47