mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
DirectoryBlob: Create a DiscContent class for use in m_virtual_disc
This commit is contained in:
@ -4,9 +4,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -22,6 +23,30 @@ class IOFile;
|
||||
|
||||
namespace DiscIO
|
||||
{
|
||||
class DiscContent
|
||||
{
|
||||
public:
|
||||
DiscContent(u64 offset, u64 size, const std::string& path);
|
||||
|
||||
// Provided because it's convenient when searching for DiscContent in an std::set
|
||||
explicit DiscContent(u64 offset);
|
||||
|
||||
u64 GetOffset() 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 !(*this == other); }
|
||||
bool operator<(const DiscContent& other) const { return m_offset < other.m_offset; }
|
||||
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); }
|
||||
private:
|
||||
u64 m_offset;
|
||||
u64 m_size = 0;
|
||||
std::string m_path;
|
||||
};
|
||||
|
||||
class DirectoryBlobReader : public BlobReader
|
||||
{
|
||||
public:
|
||||
@ -70,7 +95,7 @@ private:
|
||||
|
||||
std::string m_root_directory;
|
||||
|
||||
std::map<u64, std::string> m_virtual_disk;
|
||||
std::set<DiscContent> m_virtual_disc;
|
||||
|
||||
bool m_is_wii = false;
|
||||
|
||||
|
Reference in New Issue
Block a user