elf.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <string>
  6. #include "common/common_types.h"
  7. #include "core/loader/loader.h"
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////
  9. // Loader namespace
  10. namespace Loader {
  11. /// Loads an ELF/AXF file
  12. class AppLoader_ELF final : public AppLoader {
  13. public:
  14. AppLoader_ELF(FileUtil::IOFile&& file, std::string filename)
  15. : AppLoader(std::move(file)), filename(std::move(filename)) {}
  16. /**
  17. * Returns the type of the file
  18. * @param file FileUtil::IOFile open file
  19. * @return FileType found, or FileType::Error if this loader doesn't know it
  20. */
  21. static FileType IdentifyType(FileUtil::IOFile& file);
  22. /**
  23. * Returns the type of this file
  24. * @return FileType corresponding to the loaded file
  25. */
  26. FileType GetFileType() override {
  27. return IdentifyType(file);
  28. }
  29. /**
  30. * Load the bootable file
  31. * @return ResultStatus result of function
  32. */
  33. ResultStatus Load() override;
  34. private:
  35. std::string filename;
  36. };
  37. } // namespace Loader