| 104 | } |
| 105 | |
| 106 | Bytes getFile(const Path& path) override |
| 107 | { |
| 108 | HfsMount m(this); |
| 109 | if (path.size() == 0) |
| 110 | throw BadPathException(); |
| 111 | |
| 112 | std::vector<std::shared_ptr<Dirent>> results; |
| 113 | auto pathstr = ":" + path.to_str(":"); |
| 114 | HfsFile file(hfs_open(_vol, pathstr.c_str())); |
| 115 | if (!file) |
| 116 | throwError(); |
| 117 | |
| 118 | AppleSingle a; |
| 119 | |
| 120 | hfsdirent de; |
| 121 | hfs_fstat(file, &de); |
| 122 | a.creator = Bytes(de.u.file.creator); |
| 123 | a.type = Bytes(de.u.file.type); |
| 124 | |
| 125 | hfs_setfork(file, 0); |
| 126 | a.data = readBytes(file); |
| 127 | hfs_setfork(file, 1); |
| 128 | a.rsrc = readBytes(file); |
| 129 | |
| 130 | return a.render(); |
| 131 | } |
| 132 | |
| 133 | void putFile(const Path& path, const Bytes& bytes) override |
| 134 | { |
nothing calls this directly
no test coverage detected