Play-/Source/ElfFile.h
Jean-Philip Desjardins 1d9c425663 Refactor ELF support.
Allow ELF32/ELF64 to coexist and allow ElfView to load both.
2022-07-22 17:10:27 -04:00

32 lines
576 B
C++

#pragma once
#include "ELF.h"
#include "Stream.h"
class CElfFileContainer
{
public:
CElfFileContainer(Framework::CStream&);
virtual ~CElfFileContainer();
uint8* GetFileContent() const;
private:
uint8* m_content;
};
template <typename ElfType>
class CElfFile : protected CElfFileContainer, public ElfType
{
public:
CElfFile(Framework::CStream& stream)
: CElfFileContainer(stream)
, ElfType(GetFileContent())
{
}
virtual ~CElfFile() = default;
};
typedef CElfFile<CELF32> CElf32File;
typedef CElfFile<CELF64> CElf64File;