Core/Enum: Convert OpenMode and StreamOption to the new flags system
This commit is contained in:
@@ -55,12 +55,12 @@ namespace Nz
|
||||
return position.QuadPart;
|
||||
}
|
||||
|
||||
bool FileImpl::Open(const String& filePath, UInt32 mode)
|
||||
bool FileImpl::Open(const String& filePath, OpenModeFlags mode)
|
||||
{
|
||||
DWORD access = 0;
|
||||
DWORD shareMode = FILE_SHARE_READ;
|
||||
DWORD openMode = 0;
|
||||
|
||||
|
||||
if (mode & OpenMode_ReadOnly)
|
||||
{
|
||||
access |= GENERIC_READ;
|
||||
@@ -68,7 +68,7 @@ namespace Nz
|
||||
if (mode & OpenMode_MustExit || (mode & OpenMode_WriteOnly) == 0)
|
||||
openMode |= OPEN_EXISTING;
|
||||
}
|
||||
|
||||
|
||||
if (mode & OpenMode_WriteOnly)
|
||||
{
|
||||
if (mode & OpenMode_Append)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Nz
|
||||
bool EndOfFile() const;
|
||||
void Flush();
|
||||
UInt64 GetCursorPos() const;
|
||||
bool Open(const String& filePath, UInt32 mode);
|
||||
bool Open(const String& filePath, OpenModeFlags mode);
|
||||
std::size_t Read(void* buffer, std::size_t size);
|
||||
bool SetCursorPos(CursorPosition pos, Int64 offset);
|
||||
bool SetSize(UInt64 size);
|
||||
|
||||
Reference in New Issue
Block a user