From 270c8516453a338465a37217f9f6a82bf07e579c Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 6 Aug 2014 02:34:26 +0400 Subject: [PATCH] vfsLocalDir::IsOpened() implemented --- Utilities/rFile.cpp | 5 +++++ Utilities/rFile.h | 1 + rpcs3/Emu/FS/vfsLocalDir.cpp | 7 +++++-- rpcs3/Emu/FS/vfsLocalDir.h | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Utilities/rFile.cpp b/Utilities/rFile.cpp index 47979233f9..83cad71cd0 100644 --- a/Utilities/rFile.cpp +++ b/Utilities/rFile.cpp @@ -318,6 +318,11 @@ bool rDir::Open(const std::string& path) return reinterpret_cast(handle)->Open(fmt::FromUTF8(path)); } +bool rDir::IsOpened() const +{ + return reinterpret_cast(handle)->IsOpened(); +} + bool rDir::GetFirst(std::string *filename) const { wxString str; diff --git a/Utilities/rFile.h b/Utilities/rFile.h index fb2be71fbb..7b596db7df 100644 --- a/Utilities/rFile.h +++ b/Utilities/rFile.h @@ -66,6 +66,7 @@ struct rDir rDir(const rDir& other) = delete; rDir(const std::string &path); bool Open(const std::string& path); + bool IsOpened() const; static bool Exists(const std::string &path); bool GetFirst(std::string *filename) const; bool GetNext(std::string *filename) const; diff --git a/rpcs3/Emu/FS/vfsLocalDir.cpp b/rpcs3/Emu/FS/vfsLocalDir.cpp index 69008fa03b..0c44144ab9 100644 --- a/rpcs3/Emu/FS/vfsLocalDir.cpp +++ b/rpcs3/Emu/FS/vfsLocalDir.cpp @@ -15,8 +15,6 @@ bool vfsLocalDir::Open(const std::string& path) if(!vfsDirBase::Open(path)) return false; - rDir dir; - if(!dir.Open(path)) return false; @@ -57,3 +55,8 @@ bool vfsLocalDir::Remove(const std::string& path) { return rRmdir(path); } + +bool vfsLocalDir::IsOpened() const +{ + return dir.IsOpened() && vfsDirBase::IsOpened(); +} diff --git a/rpcs3/Emu/FS/vfsLocalDir.h b/rpcs3/Emu/FS/vfsLocalDir.h index 4120b12f41..c914f0c7c8 100644 --- a/rpcs3/Emu/FS/vfsLocalDir.h +++ b/rpcs3/Emu/FS/vfsLocalDir.h @@ -5,6 +5,7 @@ class vfsLocalDir : public vfsDirBase { private: u32 m_pos; + rDir dir; public: vfsLocalDir(vfsDevice* device); @@ -15,4 +16,5 @@ public: virtual bool Create(const std::string& path) override; virtual bool Rename(const std::string& from, const std::string& to) override; virtual bool Remove(const std::string& path) override; + virtual bool IsOpened() const override; }; \ No newline at end of file