this repo has no description
1#ifndef RESOURCEFILE_H
2#define RESOURCEFILE_H
3
4#include <memory>
5#include <iosfwd>
6#include <string>
7
8#include "ResType.h"
9#include "ResourceFork.h"
10
11class ResourceFile
12{
13public:
14 enum class Format
15 {
16 autodetect,
17#ifdef __APPLE__
18 real,
19#endif
20 macbin,
21 diskimage,
22 basilisk,
23 applesingle,
24 underscore_appledouble,
25 percent_appledouble
26 };
27
28 bool read(std::string path, Format f = Format::autodetect);
29 bool write(std::string path, Format f = Format::autodetect);
30 bool read(std::istream& in, Format f);
31 bool write(std::ostream& in, Format f);
32 static bool hasPlainDataFork(Format f);
33 bool hasPlainDataFork();
34 Format getFormat() { return format; }
35
36 static bool isSingleFork(Format f);
37
38 ResType type;
39 ResType creator;
40 Resources resources;
41 std::string data;
42
43private:
44 bool assign(std::string path, Format f = Format::autodetect);
45 bool read();
46 bool write();
47
48 std::string pathstring;
49 std::string filename;
50 Format format = Format::autodetect;
51};
52
53#endif // RESOURCEFILE_H