From 5244ac0e9c784c402946616f913a8b4fe63af88c Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 6 Jan 2015 15:02:30 -0500 Subject: [PATCH] Archives: Addressed some comments --- src/core/file_sys/archive_extsavedata.cpp | 2 +- src/core/file_sys/archive_savedata.cpp | 12 ++++++------ src/core/file_sys/archive_savedatacheck.cpp | 8 ++++---- src/core/file_sys/archive_sdmc.cpp | 4 ++-- src/core/hle/service/fs/archive.cpp | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 50ca878e2..b8f8b2ed2 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -34,7 +34,7 @@ static std::string GetExtDataContainerPath(const std::string& mount_point, bool } Archive_ExtSaveData::Archive_ExtSaveData(const std::string& mount_location, bool shared) - : DiskArchive(GetExtDataContainerPath(mount_location, shared)), concrete_mount_point(mount_point) { + : DiskArchive(GetExtDataContainerPath(mount_location, shared)), concrete_mount_point(mount_point) { LOG_INFO(Service_FS, "Directory %s set as base for ExtSaveData.", mount_point.c_str()); } diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index ecce7c105..3baee5294 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp @@ -17,19 +17,19 @@ namespace FileSys { -static std::string GetSaveDataContainerPath(const std::string& mount_point) { - return Common::StringFromFormat("%sNintendo 3DS/%s/%s/title/", mount_point.c_str(), +static std::string GetSaveDataContainerPath(const std::string& sdmc_directory) { + return Common::StringFromFormat("%sNintendo 3DS/%s/%s/title/", sdmc_directory.c_str(), SYSTEM_ID.c_str(), SDCARD_ID.c_str()); } -static std::string GetSaveDataPath(const std::string& mount_point, u64 program_id) { +static std::string GetSaveDataPath(const std::string& mount_location, u64 program_id) { u32 high = program_id >> 32; u32 low = program_id & 0xFFFFFFFF; - return Common::StringFromFormat("%s%08x/%08x/data/00000001/", mount_point.c_str(), high, low); + return Common::StringFromFormat("%s%08x/%08x/data/00000001/", mount_location.c_str(), high, low); } -Archive_SaveData::Archive_SaveData(const std::string& mount_point) - : DiskArchive(GetSaveDataContainerPath(mount_point)) { +Archive_SaveData::Archive_SaveData(const std::string& sdmc_directory) + : DiskArchive(GetSaveDataContainerPath(sdmc_directory)) { LOG_INFO(Service_FS, "Directory %s set as SaveData.", this->mount_point.c_str()); } diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp index 82449d1b7..a7a507536 100644 --- a/src/core/file_sys/archive_savedatacheck.cpp +++ b/src/core/file_sys/archive_savedatacheck.cpp @@ -12,8 +12,8 @@ namespace FileSys { -static std::string GetSaveDataCheckContainerPath(const std::string& mount_point) { - return Common::StringFromFormat("%s%s/title/", mount_point.c_str(), SYSTEM_ID.c_str()); +static std::string GetSaveDataCheckContainerPath(const std::string& nand_directory) { + return Common::StringFromFormat("%s%s/title/", nand_directory.c_str(), SYSTEM_ID.c_str()); } static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high, u32 low) { @@ -21,8 +21,8 @@ static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high mount_point.c_str(), high, low); } -Archive_SaveDataCheck::Archive_SaveDataCheck(const std::string& mount_loc) : -mount_point(GetSaveDataCheckContainerPath(mount_loc)) { +Archive_SaveDataCheck::Archive_SaveDataCheck(const std::string& nand_directory) : + mount_point(GetSaveDataCheckContainerPath(nand_directory)) { } ResultCode Archive_SaveDataCheck::Open(const Path& path) { diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 1c1c170b6..26b03e82f 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -16,8 +16,8 @@ namespace FileSys { -Archive_SDMC::Archive_SDMC(const std::string& mount_point) : DiskArchive(mount_point) { - LOG_INFO(Service_FS, "Directory %s set as SDMC.", mount_point.c_str()); +Archive_SDMC::Archive_SDMC(const std::string& sdmc_directory) : DiskArchive(sdmc_directory) { + LOG_INFO(Service_FS, "Directory %s set as SDMC.", sdmc_directory.c_str()); } bool Archive_SDMC::Initialize() { diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index e627f1d64..0834b342a 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -36,6 +36,7 @@ namespace std { }; } +/// TODO(Subv): Confirm length of these strings const std::string SYSTEM_ID = "00000000000000000000000000000000"; const std::string SDCARD_ID = "00000000000000000000000000000000"; @@ -436,8 +437,7 @@ void ArchiveInit() { next_handle = 1; // TODO(Link Mauve): Add the other archive types (see here for the known types: - // http://3dbrew.org/wiki/FS:OpenArchive#Archive_idcodes). Currently the only half-finished - // archive type is SDMC, so it is the only one getting exposed. + // http://3dbrew.org/wiki/FS:OpenArchive#Archive_idcodes). std::string sdmc_directory = FileUtil::GetUserPath(D_SDMC_IDX); std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX);