mirror of
https://github.com/libAthena/athena.git
synced 2025-12-09 05:27:50 +00:00
* Fix styling
This commit is contained in:
@@ -71,6 +71,7 @@ bool FileWriter::isLittleEndian() const
|
||||
void FileWriter::open()
|
||||
{
|
||||
m_fileHandle = fopen(m_filename.c_str(), "w+b");
|
||||
|
||||
if (!m_fileHandle)
|
||||
THROW_FILE_NOT_FOUND_EXCEPTION(m_filename);
|
||||
|
||||
@@ -141,6 +142,7 @@ void FileWriter::writeBit(bool val)
|
||||
m_bitValid = false;
|
||||
|
||||
fseeko64(m_fileHandle, m_bytePosition, (int)SeekOrigin::Begin);
|
||||
|
||||
if (fwrite(&m_currentByte, 1, 1, m_fileHandle) != sizeof(atInt8))
|
||||
THROW_IO_EXCEPTION("Unable to data to file");
|
||||
}
|
||||
@@ -149,6 +151,7 @@ void FileWriter::seekBit(int bit)
|
||||
{
|
||||
if (bit < 0 || bit > 7)
|
||||
THROW_INVALID_OPERATION_EXCEPTION("bit must be >= 0 and <= 7");
|
||||
|
||||
m_bitShift = bit;
|
||||
m_bitValid = true;
|
||||
}
|
||||
@@ -283,8 +286,10 @@ void FileWriter::writeString(const std::string& val)
|
||||
m_bitValid = false;
|
||||
|
||||
char term = '\0';
|
||||
|
||||
if (fwrite(val.c_str(), 1, val.length(), m_fileHandle) != val.length())
|
||||
THROW_IO_EXCEPTION("Unable to write to stream");
|
||||
|
||||
if (fwrite(&term, 1, 1, m_fileHandle) != 1)
|
||||
THROW_IO_EXCEPTION("Unable to write to stream");
|
||||
}
|
||||
@@ -311,6 +316,7 @@ void FileWriter::fill(atInt8 byte, atUint64 len)
|
||||
{
|
||||
if (!isOpen())
|
||||
THROW_INVALID_OPERATION_EXCEPTION("File not open for writing");
|
||||
|
||||
fwrite(&byte, 1, len, m_fileHandle);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user