diff options
Diffstat (limited to 'source/modules/asura-utils/io/file_system.cpp')
-rw-r--r-- | source/modules/asura-utils/io/file_system.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/modules/asura-utils/io/file_system.cpp b/source/modules/asura-utils/io/file_system.cpp index 20f3cb2..f68bad6 100644 --- a/source/modules/asura-utils/io/file_system.cpp +++ b/source/modules/asura-utils/io/file_system.cpp @@ -23,7 +23,7 @@ namespace AsuraEngine Filesystem::~Filesystem() { - if (mInited) //PHYSFS_isInit + if (m_Inited) //PHYSFS_isInit PHYSFS_deinit(); } @@ -32,12 +32,12 @@ namespace AsuraEngine if (!PHYSFS_init(arg0)) throw Exception("Failed to initialize filesystem: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); - mInited = true; + m_Inited = true; } bool Filesystem::Mount(const std::string& locpath, const std::string& montpoint/* = "/"*/, bool prepend /*= false*/) { - if (!mInited) + if (!m_Inited) return false; return PHYSFS_mount(locpath.c_str(), montpoint.c_str(), !prepend); @@ -45,11 +45,11 @@ namespace AsuraEngine bool Filesystem::Mount(DataBuffer* db, const std::string& archivename, const std::string& mountpoint /*= "/"*/, bool prepend /*= false*/) { - if (!mInited) + if (!m_Inited) return false; if (PHYSFS_mountMemory(db->GetData(), db->GetSize(), nullptr, archivename.c_str(), mountpoint.c_str(), !prepend)) { - mMountData[archivename] = db; + m_MountData[archivename] = db; return true; } return false; @@ -57,14 +57,14 @@ namespace AsuraEngine bool Filesystem::Unmount(const std::string& locpath) { - if (!mInited) + if (!m_Inited) return false; // ǹ鵵ӳɾ - auto datait = mMountData.find(locpath); - if (datait != mMountData.end() && PHYSFS_unmount(locpath.c_str()) != 0) + auto datait = m_MountData.find(locpath); + if (datait != m_MountData.end() && PHYSFS_unmount(locpath.c_str()) != 0) { - mMountData.erase(datait); + m_MountData.erase(datait); return true; } @@ -73,7 +73,7 @@ namespace AsuraEngine bool Filesystem::Unmount(DataBuffer* db) { - for (const auto& dp : mMountData) + for (const auto& dp : m_MountData) { if (dp.second == db) { @@ -85,7 +85,7 @@ namespace AsuraEngine bool Filesystem::GetMountPoint(const std::string& locpath, ASURA_OUT std::string& mountpoint) { - if (!mInited) + if (!m_Inited) return false; const char* point = PHYSFS_getMountPoint(locpath.c_str()); if (point != nullptr) @@ -98,7 +98,7 @@ namespace AsuraEngine void Filesystem::SetWriteDirectory(const std::string locpath) { - if (!mInited) + if (!m_Inited) return; if (!PHYSFS_setWriteDir(locpath.c_str())) throw Exception("Failed to set write directory %s", locpath.c_str()); @@ -116,7 +116,7 @@ namespace AsuraEngine bool Filesystem::NewDirectory(const std::string& path) { - if (!mInited) + if (!m_Inited) return false; if (!PHYSFS_getWriteDir()) return false; @@ -159,7 +159,7 @@ namespace AsuraEngine bool Filesystem::Remove(const std::string& path) { - if (!mInited) + if (!m_Inited) return false; if (PHYSFS_getWriteDir() == 0) return false; @@ -172,7 +172,7 @@ namespace AsuraEngine bool Filesystem::GetFileInfo(const std::string& filepath, ASURA_OUT FileInfo* info) { - if (!mInited) + if (!m_Inited) return false; PHYSFS_Stat stat = {}; |