Pomme/src/PommeFiles.h

44 lines
744 B
C
Raw Normal View History

2020-11-11 20:06:52 +00:00
#pragma once
#include "PommeTypes.h"
#include <iostream>
#include <map>
#include "CompilerSupport/filesystem.h"
namespace Pomme::Files
{
struct ResourceMetadata
{
short forkRefNum;
OSType type;
SInt16 id;
Byte flags;
SInt32 size;
2022-11-22 19:38:24 +00:00
std::streamoff dataOffset;
2020-11-11 20:06:52 +00:00
std::string name;
};
struct ResourceFork
{
SInt16 fileRefNum;
std::map<ResType, std::map<SInt16, ResourceMetadata> > resourceMap;
};
void Init();
bool IsRefNumLegal(short refNum);
bool IsStreamOpen(short refNum);
bool IsStreamPermissionAllowed(short refNum, char perm);
std::iostream& GetStream(short refNum);
const FSSpec& GetSpec(short refNum);
2020-11-11 20:06:52 +00:00
void CloseStream(short refNum);
FSSpec HostPathToFSSpec(const fs::path& fullPath);
}