diff options
| author | 2018-08-16 17:07:37 -0400 | |
|---|---|---|
| committer | 2018-08-23 11:53:30 -0400 | |
| commit | 8b52d6682a00d2d0ac025433f034d9974584c630 (patch) | |
| tree | 7b9ac7a33a267f98856d6c09066e58940b5c590e /src | |
| parent | sdmc_factory: Add SDMC RegisteredCache getter (diff) | |
| download | yuzu-8b52d6682a00d2d0ac025433f034d9974584c630.tar.gz yuzu-8b52d6682a00d2d0ac025433f034d9974584c630.tar.xz yuzu-8b52d6682a00d2d0ac025433f034d9974584c630.zip | |
registration: Add GetEntryUnparsed methods
Returns the file before calling parser on it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/registered_cache.cpp | 12 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index e90dc6695..a128fa33d 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp | |||
| @@ -262,6 +262,18 @@ bool RegisteredCache::HasEntry(RegisteredCacheEntry entry) const { | |||
| 262 | return GetEntryRaw(entry) != nullptr; | 262 | return GetEntryRaw(entry) != nullptr; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | VirtualFile RegisteredCache::GetEntryUnparsed(u64 title_id, ContentRecordType type) const { | ||
| 266 | const auto id = GetNcaIDFromMetadata(title_id, type); | ||
| 267 | if (id == boost::none) | ||
| 268 | return nullptr; | ||
| 269 | |||
| 270 | return GetFileAtID(id.get()); | ||
| 271 | } | ||
| 272 | |||
| 273 | VirtualFile RegisteredCache::GetEntryUnparsed(RegisteredCacheEntry entry) const { | ||
| 274 | return GetEntryUnparsed(entry.title_id, entry.type); | ||
| 275 | } | ||
| 276 | |||
| 265 | VirtualFile RegisteredCache::GetEntryRaw(u64 title_id, ContentRecordType type) const { | 277 | VirtualFile RegisteredCache::GetEntryRaw(u64 title_id, ContentRecordType type) const { |
| 266 | const auto id = GetNcaIDFromMetadata(title_id, type); | 278 | const auto id = GetNcaIDFromMetadata(title_id, type); |
| 267 | if (id == boost::none) | 279 | if (id == boost::none) |
diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index a7c51a59c..f48cf3146 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h | |||
| @@ -69,6 +69,9 @@ public: | |||
| 69 | bool HasEntry(u64 title_id, ContentRecordType type) const; | 69 | bool HasEntry(u64 title_id, ContentRecordType type) const; |
| 70 | bool HasEntry(RegisteredCacheEntry entry) const; | 70 | bool HasEntry(RegisteredCacheEntry entry) const; |
| 71 | 71 | ||
| 72 | VirtualFile GetEntryUnparsed(u64 title_id, ContentRecordType type) const; | ||
| 73 | VirtualFile GetEntryUnparsed(RegisteredCacheEntry entry) const; | ||
| 74 | |||
| 72 | VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const; | 75 | VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const; |
| 73 | VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const; | 76 | VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const; |
| 74 | 77 | ||