From 6d90d99d12c6a1e7ec27831d93052a30c0e689b5 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 19 Mar 2018 23:00:37 -0500 Subject: FS: Implement DiskFileSystem's OpenDirectory interface. --- src/core/file_sys/disk_filesystem.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/core/file_sys/disk_filesystem.cpp') diff --git a/src/core/file_sys/disk_filesystem.cpp b/src/core/file_sys/disk_filesystem.cpp index e02b20faf..f620b7961 100644 --- a/src/core/file_sys/disk_filesystem.cpp +++ b/src/core/file_sys/disk_filesystem.cpp @@ -108,8 +108,17 @@ ResultCode Disk_FileSystem::RenameDirectory(const Path& src_path, const Path& de } ResultVal> Disk_FileSystem::OpenDirectory( - const Path& path) const { - return MakeResult>(std::make_unique()); + const std::string& path) const { + + std::string full_path = base_directory + path; + + if (!FileUtil::IsDirectory(full_path)) { + // TODO(Subv): Find the correct error code for this. + return ResultCode(-1); + } + + auto directory = std::make_unique(full_path); + return MakeResult>(std::move(directory)); } u64 Disk_FileSystem::GetFreeSpaceSize() const { -- cgit v1.2.3