header-based read/write optimizations

This commit is contained in:
Jack Andersen
2015-06-30 23:28:40 -10:00
parent 2b37765eff
commit a63da8db2f
10 changed files with 124 additions and 352 deletions

View File

@@ -33,26 +33,6 @@ FileWriter::~FileWriter()
close();
}
void FileWriter::setEndian(Endian endian)
{
m_endian = endian;
}
Endian FileWriter::endian() const
{
return m_endian;
}
bool FileWriter::isBigEndian() const
{
return (m_endian == Endian::BigEndian);
}
bool FileWriter::isLittleEndian() const
{
return (m_endian == Endian::LittleEndian);
}
void FileWriter::open(bool overwrite)
{
if (overwrite)
@@ -77,11 +57,6 @@ void FileWriter::close()
return;
}
bool FileWriter::isOpen() const
{
return m_fileHandle != NULL;
}
void FileWriter::seek(atInt64 pos, SeekOrigin origin)
{
if (fseeko64(m_fileHandle, pos, (int)origin) != 0)
@@ -150,11 +125,6 @@ void FileWriter::writeUByte(atUint8 val)
THROW_IO_EXCEPTION("Unable to write to stream");
}
void FileWriter::writeByte(atInt8 val)
{
writeUByte(val);
}
void FileWriter::writeUBytes(const atUint8* data, atUint64 len)
{
if (!isOpen())
@@ -166,11 +136,6 @@ void FileWriter::writeUBytes(const atUint8* data, atUint64 len)
THROW_IO_EXCEPTION("Unable to write to stream");
}
void FileWriter::writeBytes(const atInt8* data, atUint64 len)
{
writeUBytes((atUint8*)data, len);
}
void FileWriter::writeUint16(atUint16 val)
{
if (!isOpen())
@@ -185,11 +150,6 @@ void FileWriter::writeUint16(atUint16 val)
THROW_IO_EXCEPTION("Unable to write to stream");
}
void FileWriter::writeInt16(atInt16 val)
{
writeUint16(val);
}
void FileWriter::writeUint32(atUint32 val)
{
if (!isOpen())
@@ -204,11 +164,6 @@ void FileWriter::writeUint32(atUint32 val)
THROW_IO_EXCEPTION("Unable to write to stream");
}
void FileWriter::writeInt32(atInt32 val)
{
writeUint32(val);
}
void FileWriter::writeUint64(atUint64 val)
{
if (!isOpen())
@@ -223,11 +178,6 @@ void FileWriter::writeUint64(atUint64 val)
THROW_IO_EXCEPTION("Unable to write to stream");
}
void FileWriter::writeInt64(atInt64 val)
{
writeUint64(val);
}
void FileWriter::writeDouble(double val)
{
if (!isOpen())
@@ -256,11 +206,6 @@ void FileWriter::writeFloat(float val)
THROW_IO_EXCEPTION("Unable to write to stream");
}
void FileWriter::writeBool(bool val)
{
writeByte(val);
}
void FileWriter::writeVec3f(atVec3f vec)
{
if (!isOpen())
@@ -420,10 +365,5 @@ void FileWriter::fill(atInt8 byte, atUint64 len)
fwrite(&byte, 1, len, m_fileHandle);
}
void FileWriter::fill(atUint8 byte, atUint64 len)
{
fill((atInt8)byte, len);
}
}
} // Athena