loader.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common.h"
  6. ////////////////////////////////////////////////////////////////////////////////////////////////////
  7. namespace Loader {
  8. enum FileType {
  9. FILETYPE_ERROR,
  10. FILETYPE_CTR_CCI,
  11. FILETYPE_CTR_CIA,
  12. FILETYPE_CTR_CXI,
  13. FILETYPE_CTR_ELF,
  14. FILETYPE_CTR_BIN,
  15. FILETYPE_LAUNCHER_DAT,
  16. FILETYPE_DIRECTORY_CXI,
  17. FILETYPE_UNKNOWN_BIN,
  18. FILETYPE_UNKNOWN_ELF,
  19. FILETYPE_ARCHIVE_RAR,
  20. FILETYPE_ARCHIVE_ZIP,
  21. FILETYPE_NORMAL_DIRECTORY,
  22. FILETYPE_UNKNOWN
  23. };
  24. ////////////////////////////////////////////////////////////////////////////////////////////////////
  25. /**
  26. * Identifies the type of a bootable file
  27. * @param filename String filename of bootable file
  28. * @return FileType of file
  29. */
  30. FileType IdentifyFile(std::string &filename);
  31. /**
  32. * Identifies and loads a bootable file
  33. * @param filename String filename of bootable file
  34. * @param error_string Point to string to put error message if an error has occurred
  35. * @return True on success, otherwise false
  36. */
  37. bool LoadFile(std::string &filename, std::string *error_string);
  38. } // namespace