DirectoryBlob: Lookup DiscContents by offset + size instead of offset

This simplifies DiscContentContainer::Read.
This commit is contained in:
JosJuice
2017-08-01 19:04:33 +02:00
parent d6260e02ce
commit 1b1a75ee3a
2 changed files with 9 additions and 8 deletions

View File

@ -42,12 +42,13 @@ public:
explicit DiscContent(u64 offset);
u64 GetOffset() const;
u64 GetEndOffset() const;
u64 GetSize() const;
bool Read(u64* offset, u64* length, u8** buffer) const;
bool operator==(const DiscContent& other) const { return m_offset == other.m_offset; }
bool operator==(const DiscContent& other) const { return GetEndOffset() == other.GetEndOffset(); }
bool operator!=(const DiscContent& other) const { return !(*this == other); }
bool operator<(const DiscContent& other) const { return m_offset < other.m_offset; }
bool operator<(const DiscContent& other) const { return GetEndOffset() < other.GetEndOffset(); }
bool operator>(const DiscContent& other) const { return other < *this; }
bool operator<=(const DiscContent& other) const { return !(*this < other); }
bool operator>=(const DiscContent& other) const { return !(*this > other); }