Core: Update Stream interface
Add Open Mode to Stream level, Add IsReadable() and IsWritable() Former-commit-id: 0da5fa798c0f3bd3bf1545cb57f6bc923b222de8
This commit is contained in:
@@ -18,7 +18,8 @@ namespace Nz
|
||||
|
||||
void FileImpl::Close()
|
||||
{
|
||||
close(m_fileDescriptor);
|
||||
if (m_fileDescriptor != -1)
|
||||
close(m_fileDescriptor);
|
||||
}
|
||||
|
||||
bool FileImpl::EndOfFile() const
|
||||
@@ -48,7 +49,7 @@ namespace Nz
|
||||
return static_cast<UInt64>(position);
|
||||
}
|
||||
|
||||
bool FileImpl::Open(const String& filePath, unsigned int mode)
|
||||
bool FileImpl::Open(const String& filePath, UInt32 mode)
|
||||
{
|
||||
int flags;
|
||||
mode_t permissions = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Nz
|
||||
bool EndOfFile() const;
|
||||
void Flush();
|
||||
UInt64 GetCursorPos() const;
|
||||
bool Open(const String& filePath, unsigned int mode);
|
||||
bool Open(const String& filePath, UInt32 mode);
|
||||
std::size_t Read(void* buffer, std::size_t size);
|
||||
bool SetCursorPos(CursorPosition pos, Int64 offset);
|
||||
std::size_t Write(const void* buffer, std::size_t size);
|
||||
|
||||
Reference in New Issue
Block a user