@@ -35,12 +35,12 @@ VfsEntryType VfsFilesystem::GetEntryType(std::string_view path_) const {
3535 return VfsEntryType::None;
3636}
3737
38- VirtualFile VfsFilesystem::OpenFile (std::string_view path_, OpenMode perms) {
38+ VirtualFile VfsFilesystem::OpenFile (std::string_view path_, VirtualFileOpenMode perms) {
3939 const auto path = Common::FS::SanitizePath (path_);
4040 return root->GetFileRelative (path);
4141}
4242
43- VirtualFile VfsFilesystem::CreateFile (std::string_view path_, OpenMode perms) {
43+ VirtualFile VfsFilesystem::CreateFile (std::string_view path_, VirtualFileOpenMode perms) {
4444 const auto path = Common::FS::SanitizePath (path_);
4545 return root->CreateFileRelative (path);
4646}
@@ -53,17 +53,17 @@ VirtualFile VfsFilesystem::CopyFile(std::string_view old_path_, std::string_view
5353 if (Common::FS::GetParentPath (old_path) == Common::FS::GetParentPath (new_path)) {
5454 if (!root->Copy (Common::FS::GetFilename (old_path), Common::FS::GetFilename (new_path)))
5555 return nullptr ;
56- return OpenFile (new_path, OpenMode ::ReadWrite);
56+ return OpenFile (new_path, VirtualFileOpenMode ::ReadWrite);
5757 }
5858
5959 // Do it using RawCopy. Non-default impls are encouraged to optimize this.
60- const auto old_file = OpenFile (old_path, OpenMode ::Read);
60+ const auto old_file = OpenFile (old_path, VirtualFileOpenMode ::Read);
6161 if (old_file == nullptr )
6262 return nullptr ;
63- auto new_file = OpenFile (new_path, OpenMode ::Read);
63+ auto new_file = OpenFile (new_path, VirtualFileOpenMode ::Read);
6464 if (new_file != nullptr )
6565 return nullptr ;
66- new_file = CreateFile (new_path, OpenMode ::Write);
66+ new_file = CreateFile (new_path, VirtualFileOpenMode ::Write);
6767 if (new_file == nullptr )
6868 return nullptr ;
6969 if (!VfsRawCopy (old_file, new_file))
@@ -86,18 +86,18 @@ VirtualFile VfsFilesystem::MoveFile(std::string_view old_path, std::string_view
8686
8787bool VfsFilesystem::DeleteFile (std::string_view path_) {
8888 const auto path = Common::FS::SanitizePath (path_);
89- auto parent = OpenDirectory (Common::FS::GetParentPath (path), OpenMode ::Write);
89+ auto parent = OpenDirectory (Common::FS::GetParentPath (path), VirtualFileOpenMode ::Write);
9090 if (parent == nullptr )
9191 return false ;
9292 return parent->DeleteFile (Common::FS::GetFilename (path));
9393}
9494
95- VirtualDir VfsFilesystem::OpenDirectory (std::string_view path_, OpenMode perms) {
95+ VirtualDir VfsFilesystem::OpenDirectory (std::string_view path_, VirtualFileOpenMode perms) {
9696 const auto path = Common::FS::SanitizePath (path_);
9797 return root->GetDirectoryRelative (path);
9898}
9999
100- VirtualDir VfsFilesystem::CreateDirectory (std::string_view path_, OpenMode perms) {
100+ VirtualDir VfsFilesystem::CreateDirectory (std::string_view path_, VirtualFileOpenMode perms) {
101101 const auto path = Common::FS::SanitizePath (path_);
102102 return root->CreateDirectoryRelative (path);
103103}
@@ -107,13 +107,13 @@ VirtualDir VfsFilesystem::CopyDirectory(std::string_view old_path_, std::string_
107107 const auto new_path = Common::FS::SanitizePath (new_path_);
108108
109109 // Non-default impls are highly encouraged to provide a more optimized version of this.
110- auto old_dir = OpenDirectory (old_path, OpenMode ::Read);
110+ auto old_dir = OpenDirectory (old_path, VirtualFileOpenMode ::Read);
111111 if (old_dir == nullptr )
112112 return nullptr ;
113- auto new_dir = OpenDirectory (new_path, OpenMode ::Read);
113+ auto new_dir = OpenDirectory (new_path, VirtualFileOpenMode ::Read);
114114 if (new_dir != nullptr )
115115 return nullptr ;
116- new_dir = CreateDirectory (new_path, OpenMode ::Write);
116+ new_dir = CreateDirectory (new_path, VirtualFileOpenMode ::Write);
117117 if (new_dir == nullptr )
118118 return nullptr ;
119119
@@ -148,7 +148,7 @@ VirtualDir VfsFilesystem::MoveDirectory(std::string_view old_path, std::string_v
148148
149149bool VfsFilesystem::DeleteDirectory (std::string_view path_) {
150150 const auto path = Common::FS::SanitizePath (path_);
151- auto parent = OpenDirectory (Common::FS::GetParentPath (path), OpenMode ::Write);
151+ auto parent = OpenDirectory (Common::FS::GetParentPath (path), VirtualFileOpenMode ::Write);
152152 if (parent == nullptr )
153153 return false ;
154154 return parent->DeleteSubdirectoryRecursive (Common::FS::GetFilename (path));
0 commit comments