diff options
| author | bunnei <bunneidev@gmail.com> | 2015-03-22 14:58:38 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2015-03-22 14:58:38 -0400 |
| commit | 03ceb7adf978693728eaae42d4cc8ccb9ff6913b (patch) | |
| tree | cca5e66af529021ea7a7eedb7a61e56e6dde241c /src/core/file_sys/archive_extsavedata.cpp | |
| parent | 5ac2a41f7248a9f2cfbb8ee6180bd4ad1df47ff5 (diff) | |
| parent | b9612fe9195206ab9920d697b6b20e23db8a5be4 (diff) | |
Merge pull request #656 from Subv/nz
Services/FS: Implemented DeleteExtSaveData, CreateSystemSaveData and Del...
Diffstat (limited to 'src/core/file_sys/archive_extsavedata.cpp')
| -rw-r--r-- | src/core/file_sys/archive_extsavedata.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 0363c9771..3076fa263 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -34,6 +34,27 @@ std::string GetExtDataContainerPath(const std::string& mount_point, bool shared) SYSTEM_ID.c_str(), SDCARD_ID.c_str()); } +Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low) { + std::vector<u8> binary_path; + binary_path.reserve(12); + + // Append each word byte by byte + + // The first word is the media type + for (unsigned i = 0; i < 4; ++i) + binary_path.push_back((media_type >> (8 * i)) & 0xFF); + + // Next is the low word + for (unsigned i = 0; i < 4; ++i) + binary_path.push_back((low >> (8 * i)) & 0xFF); + + // Next is the high word + for (unsigned i = 0; i < 4; ++i) + binary_path.push_back((high >> (8 * i)) & 0xFF); + + return { binary_path }; +} + ArchiveFactory_ExtSaveData::ArchiveFactory_ExtSaveData(const std::string& mount_location, bool shared) : mount_point(GetExtDataContainerPath(mount_location, shared)) { LOG_INFO(Service_FS, "Directory %s set as base for ExtSaveData.", mount_point.c_str()); |
