| 306 | } |
| 307 | |
| 308 | void mount() |
| 309 | { |
| 310 | init(); |
| 311 | |
| 312 | Bytes directory = getRolandBlock(0); |
| 313 | ByteReader br(directory); |
| 314 | br.seek(1); |
| 315 | if (br.read(13) != "ROLAND-GCRDOS") |
| 316 | throw BadFilesystemException(); |
| 317 | br.seek(32); |
| 318 | |
| 319 | std::map<std::string, std::shared_ptr<RolandDirent>> files; |
| 320 | for (int i = 0; i < _config.directory_entries(); i++) |
| 321 | { |
| 322 | Bytes direntBytes = br.read(32); |
| 323 | if (direntBytes[0] == 0) |
| 324 | { |
| 325 | int extent = direntBytes[15]; |
| 326 | std::string filename = |
| 327 | unmangleFilename(direntBytes.slice(1, 13)); |
| 328 | |
| 329 | std::shared_ptr<RolandDirent> de; |
| 330 | auto it = files.find(filename); |
| 331 | if (it == files.end()) |
| 332 | { |
| 333 | files[filename] = de = |
| 334 | std::make_shared<RolandDirent>(filename); |
| 335 | _dirents.push_back(de); |
| 336 | } |
| 337 | else |
| 338 | de = it->second; |
| 339 | |
| 340 | de->putBlocks(this, extent * 16, direntBytes); |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | br.seek(0xa00); |
| 345 | for (int i = 0; i < _filesystemBlocks; i++) |
| 346 | _allocationBitmap[i] = br.read_8(); |
| 347 | } |
| 348 | |
| 349 | std::shared_ptr<RolandDirent> findFileOrReturnNull( |
| 350 | const std::string filename) |
nothing calls this directly
no test coverage detected