Refactoring vfs to remove a lot of duplicated code.

Progress on #294.
This commit is contained in:
Ben Vanik
2015-06-27 22:37:49 -07:00
parent 1ac19f1b08
commit 83872d8e8f
37 changed files with 877 additions and 1366 deletions

View File

@@ -45,7 +45,7 @@ bool VirtualFileSystem::UnregisterSymbolicLink(std::string path) {
return true;
}
std::unique_ptr<Entry> VirtualFileSystem::ResolvePath(const std::string& path) {
Entry* VirtualFileSystem::ResolvePath(std::string path) {
// Resolve relative paths
std::string normalized_path(xe::filesystem::CanonicalizePath(path));
@@ -88,15 +88,5 @@ std::unique_ptr<Entry> VirtualFileSystem::ResolvePath(const std::string& path) {
return nullptr;
}
X_STATUS VirtualFileSystem::Open(std::unique_ptr<Entry> entry,
KernelState* kernel_state, Mode mode,
bool async, XFile** out_file) {
auto result = entry->Open(kernel_state, mode, async, out_file);
if (XSUCCEEDED(result)) {
entry.release();
}
return result;
}
} // namespace vfs
} // namespace xe