2014-10-31 00:16:47 +00:00
|
|
|
#ifndef RESOURCEFILE_H
|
|
|
|
#define RESOURCEFILE_H
|
|
|
|
|
|
|
|
#include <memory>
|
2017-10-08 20:23:08 +00:00
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
|
2014-10-31 00:16:47 +00:00
|
|
|
#include "ResType.h"
|
|
|
|
#include "ResourceFork.h"
|
|
|
|
|
|
|
|
class ResourceFile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum class Format
|
|
|
|
{
|
|
|
|
autodetect,
|
|
|
|
#ifdef __APPLE__
|
|
|
|
real,
|
|
|
|
#endif
|
|
|
|
macbin,
|
|
|
|
diskimage,
|
|
|
|
basilisk,
|
2014-11-07 23:53:36 +00:00
|
|
|
applesingle,
|
2017-04-24 23:17:45 +00:00
|
|
|
underscore_appledouble,
|
2017-09-23 19:02:22 +00:00
|
|
|
percent_appledouble
|
2014-10-31 00:16:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ResourceFile();
|
|
|
|
ResourceFile(std::string path, Format f = Format::autodetect);
|
|
|
|
~ResourceFile();
|
|
|
|
|
|
|
|
bool assign(std::string path, Format f = Format::autodetect);
|
|
|
|
|
2017-10-08 20:23:08 +00:00
|
|
|
bool read(std::istream& in, Format f);
|
|
|
|
bool write(std::ostream& in, Format f);
|
|
|
|
|
2014-10-31 00:16:47 +00:00
|
|
|
bool read();
|
|
|
|
bool write();
|
|
|
|
|
2017-10-04 00:03:26 +00:00
|
|
|
static bool hasPlainDataFork(Format f);
|
|
|
|
bool hasPlainDataFork();
|
|
|
|
|
2017-10-08 20:23:08 +00:00
|
|
|
static bool isSingleFork(Format f);
|
|
|
|
|
2014-10-31 00:16:47 +00:00
|
|
|
std::string pathstring;
|
2017-10-08 20:23:08 +00:00
|
|
|
std::string filename;
|
2014-10-31 00:16:47 +00:00
|
|
|
Format format;
|
|
|
|
ResType type;
|
|
|
|
ResType creator;
|
|
|
|
Resources resources;
|
|
|
|
std::string data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RESOURCEFILE_H
|