mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 21:35:46 +00:00
vfs: Add GetOrCreateDirectoryRelative method
This commit is contained in:
parent
ef3768f323
commit
bf33f80fae
3 changed files with 13 additions and 9 deletions
|
@ -462,4 +462,11 @@ bool VfsRawCopy(VirtualFile src, VirtualFile dest) {
|
|||
std::vector<u8> data = src->ReadAllBytes();
|
||||
return dest->WriteBytes(data, 0) == data.size();
|
||||
}
|
||||
|
||||
VirtualDir GetOrCreateDirectoryRelative(const VirtualDir& rel, std::string_view path) {
|
||||
const auto res = rel->GetDirectoryRelative(path);
|
||||
if (res == nullptr)
|
||||
return rel->CreateDirectoryRelative(path);
|
||||
return res;
|
||||
}
|
||||
} // namespace FileSys
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue