yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

registration: Add GetEntryUnparsed methods

Returns the file before calling parser on it.
This commit is contained in:
Zach Hilman 2018-08-16 17:07:37 -04:00
parent 13524578b6
commit 8b52d6682a
2 changed files with 15 additions and 0 deletions

View File

@ -262,6 +262,18 @@ bool RegisteredCache::HasEntry(RegisteredCacheEntry entry) const {
return GetEntryRaw(entry) != nullptr; return GetEntryRaw(entry) != nullptr;
} }
VirtualFile RegisteredCache::GetEntryUnparsed(u64 title_id, ContentRecordType type) const {
const auto id = GetNcaIDFromMetadata(title_id, type);
if (id == boost::none)
return nullptr;
return GetFileAtID(id.get());
}
VirtualFile RegisteredCache::GetEntryUnparsed(RegisteredCacheEntry entry) const {
return GetEntryUnparsed(entry.title_id, entry.type);
}
VirtualFile RegisteredCache::GetEntryRaw(u64 title_id, ContentRecordType type) const { VirtualFile RegisteredCache::GetEntryRaw(u64 title_id, ContentRecordType type) const {
const auto id = GetNcaIDFromMetadata(title_id, type); const auto id = GetNcaIDFromMetadata(title_id, type);
if (id == boost::none) if (id == boost::none)

View File

@ -69,6 +69,9 @@ public:
bool HasEntry(u64 title_id, ContentRecordType type) const; bool HasEntry(u64 title_id, ContentRecordType type) const;
bool HasEntry(RegisteredCacheEntry entry) const; bool HasEntry(RegisteredCacheEntry entry) const;
VirtualFile GetEntryUnparsed(u64 title_id, ContentRecordType type) const;
VirtualFile GetEntryUnparsed(RegisteredCacheEntry entry) const;
VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const; VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const;
VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const; VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const;