Core/File: Add SetSize method (currently missing Posix implementation!)

Former-commit-id: c9ffb545485d90940d620e94fd25a7256d62ab58
This commit is contained in:
Lynix
2016-04-29 14:20:22 +02:00
parent e5a7bd52dd
commit 019c1f4a36
4 changed files with 47 additions and 0 deletions

View File

@@ -454,6 +454,25 @@ namespace Nz
return true;
}
/*!
* \brief Sets the size of the file
* \return true if the file size has correctly changed
*
* \param size The size the file should have after this call
*
* \remark The cursor position is not affected by this call
* \remark The file must be open in write mode
*/
bool File::SetSize(UInt64 size)
{
NazaraLock(m_mutex)
NazaraAssert(IsOpen(), "File is not open");
NazaraAssert(IsWritable(), "File is not writable");
return m_impl->SetSize(size);
}
/*!
* \brief Sets the file path
* \return A reference to this