#include "ElfFile.h"

CElfFile::CElfFile(Framework::CStream& stream)
: CElfFileContainer(stream)
#ifdef VIOPSF2_REMOVED
, CELF(GetFileContent())
#else
, CELF(GetFileContent(), GetFileContentSize())
#endif
{

}

CElfFile::~CElfFile()
{

}


CElfFileContainer::CElfFileContainer(Framework::CStream& input)
{
#ifdef VIOPSF2_REMOVED
	uint32 size = static_cast<uint32>(input.GetLength());
	m_content = new uint8[size];
	input.Read(m_content, size);
#else
	m_content_size = static_cast<uint32>(input.GetLength());
	m_content = new uint8[m_content_size];
	input.Read(m_content, m_content_size);
#endif
}

CElfFileContainer::~CElfFileContainer()
{
	delete [] m_content;
}

uint8* CElfFileContainer::GetFileContent() const
{
	return m_content;
}

#ifdef VIOPSF2_REMOVED
#else
uint32 CElfFileContainer::GetFileContentSize() const
{
	return m_content_size;
}
#endif