Core/OpenMode: Rename ReadOnly/WriteOnly to Read/Write
This commit is contained in:
@@ -98,13 +98,13 @@ namespace Nz
|
||||
Defer, //< Defers file opening until a read/write operation is performed on it
|
||||
Lock, //< Prevents file modification by other handles while it's open
|
||||
MustExist, //< Fails if the file doesn't exists, even if opened in write mode
|
||||
ReadOnly, //< Allows read operations
|
||||
Read, //< Allows read operations
|
||||
Text, //< Opens in text mode (converts system line endings from/to \n)
|
||||
Truncate, //< Creates the file if it doesn't exist and empties it otherwise
|
||||
Unbuffered, //< Each read/write operations are performed directly using system calls (very slow)
|
||||
WriteOnly, //< Allows write operations, creates the file if it doesn't exist
|
||||
Write, //< Allows write operations, creates the file if it doesn't exist
|
||||
|
||||
Max = WriteOnly
|
||||
Max = Write
|
||||
};
|
||||
|
||||
template<>
|
||||
@@ -115,7 +115,7 @@ namespace Nz
|
||||
|
||||
using OpenModeFlags = Flags<OpenMode>;
|
||||
|
||||
constexpr OpenModeFlags OpenMode_ReadWrite = OpenMode::ReadOnly | OpenMode::WriteOnly;
|
||||
constexpr OpenModeFlags OpenMode_ReadWrite = OpenMode::Read | OpenMode::Write;
|
||||
|
||||
enum class ParameterType
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Nz
|
||||
{
|
||||
if (!file.IsOpen())
|
||||
{
|
||||
if (!file.Open(OpenMode::ReadOnly))
|
||||
if (!file.Open(OpenMode::Read))
|
||||
{
|
||||
NazaraErrorFmt("failed to load resource: unable to open \"{0}\"", filePath);
|
||||
return nullptr;
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Nz
|
||||
{
|
||||
File file(filePath);
|
||||
|
||||
if (!file.Open(OpenMode::WriteOnly | OpenMode::Truncate))
|
||||
if (!file.Open(OpenMode::Write | OpenMode::Truncate))
|
||||
{
|
||||
NazaraErrorFmt("failed to save to file: unable to open \"{0}\" in write mode", filePath);
|
||||
return false;
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace Nz
|
||||
|
||||
inline bool Stream::IsReadable() const
|
||||
{
|
||||
return m_openMode.Test(OpenMode::ReadOnly);
|
||||
return m_openMode.Test(OpenMode::Read);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -169,7 +169,7 @@ namespace Nz
|
||||
*/
|
||||
inline bool Stream::IsWritable() const
|
||||
{
|
||||
return m_openMode.Test(OpenMode::WriteOnly);
|
||||
return m_openMode.Test(OpenMode::Write);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Nz
|
||||
class NAZARA_CORE_API VirtualDirectoryFilesystemResolver : public VirtualDirectoryResolver
|
||||
{
|
||||
public:
|
||||
inline VirtualDirectoryFilesystemResolver(std::filesystem::path physicalPath, OpenModeFlags fileOpenMode = OpenMode::ReadOnly | OpenMode::Defer);
|
||||
inline VirtualDirectoryFilesystemResolver(std::filesystem::path physicalPath, OpenModeFlags fileOpenMode = OpenMode::Read | OpenMode::Defer);
|
||||
VirtualDirectoryFilesystemResolver(const VirtualDirectoryFilesystemResolver&) = delete;
|
||||
VirtualDirectoryFilesystemResolver(VirtualDirectoryFilesystemResolver&&) = delete;
|
||||
~VirtualDirectoryFilesystemResolver() = default;
|
||||
|
||||
Reference in New Issue
Block a user