Loader: Keep a reference to the file and pass it to the correct AppLoader, instead of loading it multiple times.

This commit is contained in:
Emmanuel Gil Peyrot 2015-01-06 21:30:40 +00:00
parent 2d63df90a9
commit b5237e885d
8 changed files with 130 additions and 190 deletions

View file

@ -15,18 +15,13 @@ namespace Loader {
/// Loads an ELF/AXF file
class AppLoader_ELF final : public AppLoader {
public:
AppLoader_ELF(const std::string& filename);
~AppLoader_ELF() override;
AppLoader_ELF(std::unique_ptr<FileUtil::IOFile>&& file) : AppLoader(std::move(file)) { }
/**
* Load the bootable file
* @return ResultStatus result of function
*/
ResultStatus Load() override;
private:
std::string filename;
bool is_loaded = false;
};
} // namespace Loader