mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Implement fs::file::get_id()
File descripor ID with 2 provided ways to compare between them: 1. is_mirror_of(): Test if identical: For example: when LHS writes one byte to a file at X offset, RHS file be able to read that exact byte at X offset) 2. is_coherent_with(): Test if both files point to the same file: For example: if a file descriptor pointing to the complete file exists and is being truncated to 0 bytes from non- -zero size state: this has to affect both RHS and LHS files.
This commit is contained in:
parent
e27e6c0b2d
commit
eecadab387
4 changed files with 152 additions and 0 deletions
|
|
@ -143,4 +143,11 @@ public:
|
|||
}
|
||||
|
||||
u64 size() override { return file_size; }
|
||||
|
||||
fs::file_id get_id() override
|
||||
{
|
||||
fs::file_id id = edata_file.get_id();
|
||||
id.type.insert(0, "EDATADecrypter: "sv);
|
||||
return id;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -641,6 +641,18 @@ struct lv2_file::file_view : fs::file_base
|
|||
{
|
||||
return m_file->file.size();
|
||||
}
|
||||
|
||||
fs::file_id get_id() override
|
||||
{
|
||||
fs::file_id id = m_file->file.get_id();
|
||||
|
||||
be_t<u64> off = m_off;
|
||||
const auto ptr = reinterpret_cast<u8*>(&off);
|
||||
|
||||
id.data.insert(id.data.end(), ptr, ptr + sizeof(off));
|
||||
id.type.insert(0, "lv2_file::file_view: "sv);
|
||||
return id;
|
||||
}
|
||||
};
|
||||
|
||||
fs::file lv2_file::make_view(const std::shared_ptr<lv2_file>& _file, u64 offset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue