2021-07-18 11:16:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Pomme::Files
|
|
|
|
{
|
|
|
|
struct ResourceMetadata;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Pomme::Memory
|
|
|
|
{
|
|
|
|
class BlockDescriptor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Ptr buf;
|
|
|
|
OSType magic;
|
|
|
|
Size size;
|
|
|
|
const Pomme::Files::ResourceMetadata* rezMeta;
|
|
|
|
|
|
|
|
BlockDescriptor(Size theSize);
|
|
|
|
|
|
|
|
~BlockDescriptor();
|
|
|
|
|
|
|
|
static BlockDescriptor* HandleToBlock(Handle h);
|
|
|
|
};
|
2021-07-18 13:33:01 +00:00
|
|
|
|
|
|
|
class DisposeHandleGuard
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DisposeHandleGuard(Handle theHandle)
|
|
|
|
: h(theHandle)
|
|
|
|
{}
|
|
|
|
|
|
|
|
~DisposeHandleGuard()
|
|
|
|
{
|
|
|
|
if (h)
|
|
|
|
DisposeHandle(h);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Handle h;
|
|
|
|
};
|
2021-07-18 11:16:43 +00:00
|
|
|
}
|