Core/File: Add OpenMode::Defer

This commit is contained in:
SirLynix
2023-03-03 13:14:28 +01:00
parent 36d7e98299
commit 6bf4304817
4 changed files with 45 additions and 3 deletions

View File

@@ -33,6 +33,20 @@ namespace Nz
{
return Nz::ComputeHash(hash, File(filePath));
}
inline bool File::CheckFileOpening()
{
if (m_openMode.Test(OpenMode::Defer))
{
if (!Open(m_filePath, m_openMode & ~OpenMode::Defer))
{
NazaraError("failed to open file");
return false;
}
}
return true;
}
}
#include <Nazara/Core/DebugOff.hpp>