Pomme/src/PommeMemory.h

42 lines
526 B
C
Raw Normal View History

#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;
};
}