EHS/src/io/RIFF_Chunk.cpp

52 lines
756 B
C++
Raw Normal View History

2024-02-05 22:25:30 -08:00
#include "ehs/io/RIFF_Chunk.h"
namespace ehs
{
RIFF_Chunk::RIFF_Chunk()
: hashId(0)
{
}
RIFF_Chunk::RIFF_Chunk(const Str_8& id, const Serializer<>& data)
: id(id), hashId(id.Hash_64()), data(data)
{
}
Str_8 RIFF_Chunk::GetId() const
{
return id;
}
UInt_64 RIFF_Chunk::GetHashId() const
{
return hashId;
}
Serializer<> RIFF_Chunk::GetData() const
{
return data;
}
bool RIFF_Chunk::IsValid() const
{
return hashId;
}
RIFF_Chunk::RIFF_Chunk(const RIFF_Chunk& chunk)
: id(chunk.id), hashId(chunk.hashId), data(chunk.data)
{
}
RIFF_Chunk& RIFF_Chunk::operator=(const RIFF_Chunk& chunk)
{
if (this == &chunk)
return *this;
id = chunk.id;
hashId = chunk.hashId;
data = chunk.data;
return *this;
}
}