Add stream buffering (WIP)
This commit is contained in:
@@ -59,16 +59,6 @@ namespace Nz
|
||||
return m_pos >= m_size;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the position of the cursor
|
||||
* \return Position of the cursor
|
||||
*/
|
||||
|
||||
UInt64 MemoryView::GetCursorPos() const
|
||||
{
|
||||
return m_pos;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the size of the raw memory
|
||||
* \return Size of the memory
|
||||
@@ -79,20 +69,6 @@ namespace Nz
|
||||
return m_size;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the position of the cursor
|
||||
* \return true
|
||||
*
|
||||
* \param offset Offset according to the beginning of the stream
|
||||
*/
|
||||
|
||||
bool MemoryView::SetCursorPos(UInt64 offset)
|
||||
{
|
||||
m_pos = std::min(offset, m_size);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Flushes the stream
|
||||
*/
|
||||
@@ -121,6 +97,28 @@ namespace Nz
|
||||
return readSize;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the position of the cursor
|
||||
* \return true
|
||||
*
|
||||
* \param offset Offset according to the beginning of the stream
|
||||
*/
|
||||
bool MemoryView::SeekStreamCursor(UInt64 offset)
|
||||
{
|
||||
m_pos = std::min(offset, m_size);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the position of the cursor
|
||||
* \return Position of the cursor
|
||||
*/
|
||||
UInt64 MemoryView::TellStreamCursor() const
|
||||
{
|
||||
return m_pos;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Writes blocks
|
||||
* \return Number of blocks written
|
||||
|
||||
Reference in New Issue
Block a user