Core: Update Stream interface

Add Open Mode to Stream level, Add IsReadable() and IsWritable()


Former-commit-id: 0da5fa798c0f3bd3bf1545cb57f6bc923b222de8
This commit is contained in:
Lynix
2015-11-17 13:19:44 +01:00
parent fb920f0016
commit 8371ce068f
14 changed files with 114 additions and 102 deletions

View File

@@ -0,0 +1,37 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
namespace Nz
{
inline Stream::Stream(UInt32 openMode) :
m_openMode(openMode),
m_streamOptions(0)
{
}
inline UInt32 Stream::GetOpenMode() const
{
return m_openMode;
}
inline UInt32 Stream::GetStreamOptions() const
{
return m_streamOptions;
}
inline bool Stream::IsReadable() const
{
return m_openMode & OpenMode_ReadOnly || m_openMode & OpenMode_ReadWrite;
}
inline bool Stream::IsWritable() const
{
return m_openMode & OpenMode_ReadWrite || m_openMode & OpenMode_WriteOnly;
}
inline void Stream::SetStreamOptions(UInt32 options)
{
m_streamOptions = options;
}
}