UnitTests: Fix errors
Former-commit-id: fb2340e5c7c264193f1ac363d6387486215aef7e
This commit is contained in:
@@ -454,24 +454,24 @@ 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)
|
||||
/*!
|
||||
* \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");
|
||||
NazaraAssert(IsOpen(), "File is not open");
|
||||
NazaraAssert(IsWritable(), "File is not writable");
|
||||
|
||||
return m_impl->SetSize(size);
|
||||
}
|
||||
return m_impl->SetSize(size);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the file path
|
||||
|
||||
35
src/Nazara/Core/SerializationContext.cpp
Normal file
35
src/Nazara/Core/SerializationContext.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// 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
|
||||
|
||||
#include <Nazara/Core/SerializationContext.hpp>
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
|
||||
/*!
|
||||
* \ingroup core
|
||||
* \class Nz::SerializationContext
|
||||
* \brief Structure containing a serialization/unserialization context states
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Write bits to the stream (if any) and reset the current bit cursor
|
||||
|
||||
* \see ResetBitPosition
|
||||
*/
|
||||
void SerializationContext::FlushBits()
|
||||
{
|
||||
if (currentBitPos != 8)
|
||||
{
|
||||
ResetBitPosition();
|
||||
|
||||
// Serialize will reset the bit position
|
||||
if (!Serialize<UInt8>(*this, currentByte))
|
||||
NazaraWarning("Failed to flush bits");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
#define NAZARA_LOADERS_DDS_CONSTANTS_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Serialization.hpp>
|
||||
#include <Nazara/Core/SerializationContext.hpp>
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
|
||||
namespace Nz
|
||||
|
||||
Reference in New Issue
Block a user