77 lines
1.5 KiB
C++
77 lines
1.5 KiB
C++
#ifndef _SAMPLE_GENERICCHUNK_HPP_
|
|
#define _SAMPLE_GENERICCHUNK_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
#ifndef _COMMON_GLOBALDATA_HPP_
|
|
#include <common/gdata.hpp>
|
|
#endif
|
|
#ifndef _COMMON_MEMFILE_HPP_
|
|
#include <common/memfile.hpp>
|
|
#endif
|
|
#ifndef _COMMON_OPENFILE_HPP_
|
|
#include <common/openfile.hpp>
|
|
#endif
|
|
#ifndef _SAMPLE_CHUNKID_HPP_
|
|
#include <sample/chunkid.hpp>
|
|
#endif
|
|
|
|
class GenericChunk : public GlobalData<BYTE>
|
|
{
|
|
public:
|
|
GenericChunk(void);
|
|
GenericChunk(const GenericChunk &someGenericChunk);
|
|
virtual ~GenericChunk();
|
|
GenericChunk &operator=(const GenericChunk &someGenericChunk);
|
|
bool operator==(const GenericChunk &someGenericChunk)const;
|
|
bool write(MemFile &memFile)const;
|
|
bool read(FileHandle &handle);
|
|
const ChunkID &chunkID(void)const;
|
|
DWORD chunkLength(void)const;
|
|
private:
|
|
ChunkID mChunkID;
|
|
};
|
|
|
|
inline
|
|
GenericChunk::GenericChunk(void)
|
|
{
|
|
}
|
|
|
|
inline
|
|
GenericChunk::GenericChunk(const GenericChunk &someGenericChunk)
|
|
{
|
|
*this=someGenericChunk;
|
|
}
|
|
|
|
inline
|
|
GenericChunk::~GenericChunk()
|
|
{
|
|
}
|
|
|
|
inline
|
|
GenericChunk &GenericChunk::operator=(const GenericChunk &someGenericChunk)
|
|
{
|
|
mChunkID=someGenericChunk.mChunkID;
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
bool GenericChunk::operator==(const GenericChunk &someGenericChunk)const
|
|
{
|
|
return (mChunkID==someGenericChunk.mChunkID&&
|
|
(GlobalData<BYTE>&)*this==(GlobalData<BYTE>&)someGenericChunk);
|
|
}
|
|
|
|
inline
|
|
DWORD GenericChunk::chunkLength(void)const
|
|
{
|
|
return mChunkID.size()+size()+sizeof(DWORD);
|
|
}
|
|
|
|
inline
|
|
const ChunkID &GenericChunk::chunkID(void)const
|
|
{
|
|
return mChunkID;
|
|
}
|
|
#endif
|