This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

22
sample/GenChnk.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include <sample/GenChnk.hpp>
bool GenericChunk::write(MemFile &memFile)const
{
DWORD lengthData(size());
if(!mChunkID.write(memFile))return false;
if(!memFile.write((char*)&lengthData,sizeof(lengthData)))return false;
if(!memFile.write((char*)(BYTE*)&(((GlobalData<BYTE>&)*this).operator[](0)),lengthData))return false;
return true;
}
bool GenericChunk::read(FileHandle &handle)
{
DWORD lengthData;
mChunkID.read(handle);
if(!handle.read((BYTE*)&lengthData,sizeof(lengthData)))return false;
size(lengthData);
if(!handle.read(&(((GlobalData<BYTE>&)*this).operator[](0)),lengthData))return false;
return true;
}