MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / mount

Method mount

lib/vfs/roland.cc:308–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 10

unmangleFilenameFunction · 0.85
sliceMethod · 0.80
putBlocksMethod · 0.80
read_8Method · 0.80
seekMethod · 0.45
readMethod · 0.45
findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected