mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
Possibly fixes sys_fs_rmdir and other cases of directory removal. Make sure the directory with deleted files always becomes empty. For this purpose, temp files are moved to the root of the device.
31 lines
911 B
C++
31 lines
911 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace vfs
|
|
{
|
|
// Mount VFS device
|
|
bool mount(std::string_view vpath, std::string_view path);
|
|
|
|
// Convert VFS path to fs path, optionally listing directories mounted in it
|
|
std::string get(std::string_view vpath, std::vector<std::string>* out_dir = nullptr);
|
|
|
|
// Escape VFS path by replacing non-portable characters with surrogates
|
|
std::string escape(std::string_view path);
|
|
|
|
// Invert escape operation
|
|
std::string unescape(std::string_view path);
|
|
|
|
// Functions in this namespace operate on host filepaths, similar to fs::
|
|
namespace host
|
|
{
|
|
// Call fs::rename with retry on access error
|
|
bool rename(const std::string& from, const std::string& to, bool overwrite);
|
|
|
|
// Delete file without deleting its contents, emulated with MoveFileEx on Windows
|
|
bool unlink(const std::string& path, const std::string& dev_root);
|
|
}
|
|
}
|