mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Finish clearing out std::vector from PortabilityLayer
This commit is contained in:
@@ -1,28 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __PL_MACFILEMEM_H__
|
||||
#define __PL_MACFILEMEM_H__
|
||||
|
||||
#include "DataTypes.h"
|
||||
#include "MacFileInfo.h"
|
||||
#include "ScopedArray.h"
|
||||
#include "GpVector.h"
|
||||
|
||||
struct IGpAllocator;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class MacFileMem
|
||||
{
|
||||
public:
|
||||
MacFileMem(const uint8_t *dataFork, const uint8_t *resourceFork, const char* comment, const MacFileInfo &fileInfo);
|
||||
~MacFileMem();
|
||||
|
||||
const MacFileInfo &FileInfo() const;
|
||||
const uint8_t *DataFork() const;
|
||||
const uint8_t *ResourceFork() const;
|
||||
const char *Comment() const;
|
||||
const char *Comment() const;
|
||||
|
||||
static MacFileMem *Create(IGpAllocator *alloc, const uint8_t *dataFork, const uint8_t *resourceFork, const char* comment, const MacFileInfo &fileInfo);
|
||||
void Destroy();
|
||||
|
||||
private:
|
||||
ScopedArray<uint8_t> m_data;
|
||||
MacFileInfo m_info;
|
||||
MacFileMem(IGpAllocator *alloc, const MacFileInfo &fileInfo);
|
||||
~MacFileMem();
|
||||
|
||||
bool Init(const uint8_t *dataFork, const uint8_t *resourceFork, const char* comment);
|
||||
|
||||
GpVector<uint8_t> m_data;
|
||||
MacFileInfo m_info;
|
||||
IGpAllocator *m_alloc;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,18 +40,16 @@ namespace PortabilityLayer
|
||||
|
||||
inline const uint8_t *MacFileMem::DataFork() const
|
||||
{
|
||||
return m_data;
|
||||
return m_data.Buffer();
|
||||
}
|
||||
|
||||
inline const uint8_t *MacFileMem::ResourceFork() const
|
||||
{
|
||||
return m_data + m_info.m_dataForkSize;
|
||||
return m_data.Buffer() + m_info.m_dataForkSize;
|
||||
}
|
||||
|
||||
inline const char *MacFileMem::Comment() const
|
||||
{
|
||||
return reinterpret_cast<const char*>(m_data + m_info.m_dataForkSize + m_info.m_resourceForkSize);
|
||||
return reinterpret_cast<const char*>(m_data.Buffer() + m_info.m_dataForkSize + m_info.m_resourceForkSize);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user