Use virtual classes instead of templates for file interfaces

For convenience.
This commit is contained in:
zhupengfei
2020-08-01 09:47:44 +08:00
parent e861d84b72
commit 1f91cbdaec
11 changed files with 111 additions and 212 deletions
+5 -6
View File
@@ -204,13 +204,12 @@ enum class EncryptionType;
* Note that this is heavily stripped down and can only read (primary-key
* encrypted non-code sections of) ExeFS and ExHeader by design.
*/
template <typename File = SDMCFile>
class NCCHContainer {
public:
NCCHContainer(std::shared_ptr<File> file);
NCCHContainer(std::shared_ptr<FileUtil::IOFile> file);
NCCHContainer() {}
ResultStatus OpenFile(std::shared_ptr<File> file);
ResultStatus OpenFile(std::shared_ptr<FileUtil::IOFile> file);
/**
* Ensure ExeFS and exheader is loaded and ready for reading sections
@@ -304,11 +303,11 @@ private:
std::string root_folder;
std::string filepath;
std::shared_ptr<File> file;
std::shared_ptr<File> exefs_file;
std::shared_ptr<FileUtil::IOFile> file;
std::shared_ptr<FileUtil::IOFile> exefs_file;
// Used for DecryptToFile
QuickDecryptor<File, FileUtil::IOFile> decryptor;
QuickDecryptor decryptor;
std::atomic_bool aborted{false};
};