VFS::CopyFile implemented

This commit is contained in:
Nekotekina 2015-04-13 17:46:10 +03:00
parent 94b3cdf9e7
commit 16fe7919a0
5 changed files with 90 additions and 12 deletions

View file

@ -7,6 +7,7 @@
#include "Emu/System.h"
#undef CreateFile
#undef CopyFile
std::vector<std::string> simplify_path_blocks(const std::string& path)
{
@ -297,6 +298,21 @@ bool VFS::RenameDir(const std::string& ps3_path_from, const std::string& ps3_pat
return false;
}
bool VFS::CopyFile(const std::string& ps3_path_from, const std::string& ps3_path_to, bool overwrite) const
{
std::string path_from, path_to;
if (vfsDevice* dev = GetDevice(ps3_path_from, path_from))
{
if (vfsDevice* dev_ = GetDevice(ps3_path_to, path_to))
{
return rCopy(path_from, path_to, overwrite);
}
}
return false;
}
vfsDevice* VFS::GetDevice(const std::string& ps3_path, std::string& path) const
{
auto try_get_device = [this, &path](const std::string& ps3_path) -> vfsDevice*