mirror of
https://github.com/AxioDL/LibCommon.git
synced 2026-03-30 11:47:23 -07:00
b4f413e935
Gets rid of the silly "Long" usage for 32-bit sizes
36 lines
816 B
C++
36 lines
816 B
C++
#include "CSerialVersion.h"
|
|
|
|
#include "Common/CFourCC.h"
|
|
#include "Common/FileIO/IInputStream.h"
|
|
#include "Common/FileIO/IOutputStream.h"
|
|
|
|
CSerialVersion::CSerialVersion() = default;
|
|
|
|
CSerialVersion::CSerialVersion(uint16 ArchiveVer, uint16 FileVer, EGame Game)
|
|
: mArchiveVersion(ArchiveVer)
|
|
, mFileVersion(FileVer)
|
|
, mGame(Game)
|
|
{
|
|
}
|
|
|
|
CSerialVersion::CSerialVersion(IInputStream& rInput)
|
|
{
|
|
Read(rInput);
|
|
}
|
|
|
|
void CSerialVersion::Read(IInputStream& rInput)
|
|
{
|
|
mArchiveVersion = rInput.ReadU16();
|
|
mFileVersion = rInput.ReadU16();
|
|
CFourCC GameID(rInput);
|
|
mGame = GameFrom4CC(GameID);
|
|
}
|
|
|
|
void CSerialVersion::Write(IOutputStream& rOutput)
|
|
{
|
|
rOutput.WriteUShort(mArchiveVersion);
|
|
rOutput.WriteUShort(mFileVersion);
|
|
CFourCC GameID = GameTo4CC(mGame);
|
|
GameID.Write(rOutput);
|
|
}
|