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

Method toDirent

lib/vfs/fatfs.cc:212–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210
211private:
212 std::shared_ptr<Dirent> toDirent(FILINFO& filinfo, const Path& parent)
213 {
214 auto dirent = std::make_shared<Dirent>();
215 dirent->filename = toUpper(filinfo.fname);
216 dirent->path = parent;
217 dirent->path.push_back(dirent->filename);
218 dirent->length = filinfo.fsize;
219 dirent->file_type =
220 (filinfo.fattrib & AM_DIR) ? TYPE_DIRECTORY : TYPE_FILE;
221 dirent->mode = modeToString(filinfo.fattrib);
222
223 dirent->attributes[Filesystem::FILENAME] = filinfo.fname;
224 dirent->attributes[Filesystem::LENGTH] = std::to_string(filinfo.fsize);
225 dirent->attributes[Filesystem::FILE_TYPE] =
226 (filinfo.fattrib & AM_DIR) ? "dir" : "file";
227 dirent->attributes[Filesystem::MODE] = modeToString(filinfo.fattrib);
228 return dirent;
229 }
230
231public:
232 DRESULT diskRead(BYTE* buffer, LBA_t sector, UINT count)

Callers

nothing calls this directly

Calls 4

toUpperFunction · 0.85
to_stringFunction · 0.85
modeToStringFunction · 0.70
push_backMethod · 0.45

Tested by

no test coverage detected