[Kernel] Added Support For: XFileRenameInformation

This commit is contained in:
Gliniak
2024-01-29 22:03:58 +01:00
parent 8b14b4bbc4
commit 74b52711a3
11 changed files with 134 additions and 64 deletions

View File

@@ -133,5 +133,22 @@ void Entry::Touch() {
// TODO(benvanik): update timestamps.
}
void Entry::Rename(const std::filesystem::path file_path) {
std::vector<std::string_view> splitted_path =
xe::utf8::split_path(xe::path_to_utf8(file_path));
splitted_path.erase(splitted_path.begin());
const std::string guest_path_without_root =
xe::utf8::join_guest_paths(splitted_path);
RenameEntryInternal(guest_path_without_root);
absolute_path_ = xe::utf8::join_guest_paths(device_->mount_path(),
guest_path_without_root);
path_ = guest_path_without_root;
name_ = xe::path_to_utf8(file_path.filename());
}
} // namespace vfs
} // namespace xe