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

Method readDirectoryBlock

lib/vfs/prodos.cc:99–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98 private:
99 uint16_t readDirectoryBlock(uint16_t block)
100 {
101 auto bytes = _fs->getLogicalBlock(block);
102 ByteReader br(bytes);
103 br.seek(2);
104 uint16_t nextBlock = br.read_le16();
105
106 int here;
107 if ((br.read_8() & 0xf0) >= 0xe0)
108 {
109 /* First block of a directory. */
110 br.seek(0x2b);
111 }
112 else
113 br.seek(4);
114
115 while (br.pos < 473)
116 {
117 Bytes de = br.read(0x27);
118 if ((de[0] & 0xf0) == 0)
119 continue;
120
121 dirents.push_back(std::make_shared<ProdosDirent>(de));
122 }
123
124 return nextBlock;
125 }
126
127 private:
128 ProdosFilesystem* _fs;

Callers

nothing calls this directly

Calls 6

getLogicalBlockMethod · 0.80
read_le16Method · 0.80
read_8Method · 0.80
seekMethod · 0.45
readMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected