Installer_emu.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #include <iostream>
  2. #include <cpp3ds/System/I18n.hpp>
  3. #include <cpp3ds/System/FileInputStream.hpp>
  4. #include "Installer.hpp"
  5. namespace FreeShop {
  6. Installer::Installer(cpp3ds::Uint64 titleId, int contentIndex)
  7. : m_titleId(titleId)
  8. , m_isSuspended(false)
  9. , m_isInstalling(false)
  10. , m_isInstallingTmd(false)
  11. , m_isInstallingContent(false)
  12. , m_currentContentIndex(-1)
  13. , m_currentContentPosition(0)
  14. {
  15. if (contentIndex >= 0)
  16. m_currentContentIndex = contentIndex;
  17. }
  18. Installer::~Installer()
  19. {
  20. //
  21. }
  22. bool Installer::installTicket(cpp3ds::Uint16 titleVersion)
  23. {
  24. return true;
  25. }
  26. bool Installer::installSeed(const void *seed)
  27. {
  28. return true;
  29. }
  30. bool Installer::start(bool deleteTitle)
  31. {
  32. return true;
  33. }
  34. bool Installer::resume()
  35. {
  36. return true;
  37. }
  38. bool Installer::suspend()
  39. {
  40. return true;
  41. }
  42. void Installer::abort()
  43. {
  44. //
  45. }
  46. bool Installer::commit()
  47. {
  48. return true;
  49. }
  50. bool Installer::finalizeTmd()
  51. {
  52. return true;
  53. }
  54. bool Installer::finalizeContent()
  55. {
  56. m_currentContentPosition = 0;
  57. return true;
  58. }
  59. bool Installer::importContents(size_t count, cpp3ds::Uint16 *indices)
  60. {
  61. if (m_isInstalling && !commit())
  62. return false;
  63. return start(false);
  64. }
  65. bool Installer::installTmd(const void *data, size_t size)
  66. {
  67. return true;
  68. }
  69. bool Installer::installContent(const void *data, size_t size, cpp3ds::Uint16 index)
  70. {
  71. m_currentContentPosition += size;
  72. m_currentContentIndex = index;
  73. return true;
  74. }
  75. cpp3ds::Int32 Installer::getErrorCode() const
  76. {
  77. return 0;
  78. }
  79. const cpp3ds::String &Installer::getErrorString() const
  80. {
  81. return m_errorStr;
  82. }
  83. int Installer::getCurrentContentIndex() const
  84. {
  85. return m_currentContentIndex;
  86. }
  87. cpp3ds::Uint64 Installer::getCurrentContentPosition() const
  88. {
  89. return m_currentContentPosition;
  90. }
  91. cpp3ds::Uint64 Installer::getTitleId() const
  92. {
  93. return m_titleId;
  94. }
  95. } // namespace FreeShop