archive_savedata.cpp 967 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <sys/stat.h>
  5. #include "common/common_types.h"
  6. #include "common/file_util.h"
  7. #include "core/file_sys/archive_savedata.h"
  8. #include "core/file_sys/disk_archive.h"
  9. #include "core/settings.h"
  10. ////////////////////////////////////////////////////////////////////////////////////////////////////
  11. // FileSys namespace
  12. namespace FileSys {
  13. Archive_SaveData::Archive_SaveData(const std::string& mount_point, u64 program_id)
  14. : DiskArchive(mount_point + Common::StringFromFormat("%016X", program_id) + DIR_SEP) {
  15. LOG_INFO(Service_FS, "Directory %s set as SaveData.", this->mount_point.c_str());
  16. }
  17. bool Archive_SaveData::Initialize() {
  18. if (!FileUtil::CreateFullPath(mount_point)) {
  19. LOG_ERROR(Service_FS, "Unable to create SaveData path.");
  20. return false;
  21. }
  22. return true;
  23. }
  24. } // namespace FileSys