Installer_emu.cpp 1.7 KB

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