MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / m_CompleteFileInfos

Method m_CompleteFileInfos

external/ImGuiFileDialog/ImGuiFileDialog.cpp:2322–2357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2320}
2321
2322void IGFD::FileManager::m_CompleteFileInfos(const std::shared_ptr<FileInfos>& vInfos) {
2323 if (!vInfos.use_count()) return;
2324
2325 if ((vInfos->fileNameExt == ".") || // current dir (special case, not really a dir or a file)
2326 (vInfos->fileNameExt == "..")) { // last dir (special case, not really a dir or a file)
2327 return;
2328 }
2329
2330 // _stat struct :
2331 // dev_t st_dev; /* ID of device containing file */
2332 // ino_t st_ino; /* inode number */
2333 // mode_t st_mode; /* protection */
2334 // nlink_t st_nlink; /* number of hard links */
2335 // uid_t st_uid; /* user ID of owner */
2336 // gid_t st_gid; /* group ID of owner */
2337 // dev_t st_rdev; /* device ID (if special file) */
2338 // off_t st_size; /* total size, in bytes */
2339 // blksize_t st_blksize; /* blocksize for file system I/O */
2340 // blkcnt_t st_blocks; /* number of 512B blocks allocated */
2341 // time_t st_atime; /* time of last access - not sure out of ntfs */
2342 // time_t st_mtime; /* time of last modification - not sure out of ntfs */
2343 // time_t st_ctime; /* time of last status change - not sure out of ntfs */
2344
2345 std::string fpn;
2346
2347 // FIXME: so the condition is always true?
2348 if (vInfos->fileType.isFile() || vInfos->fileType.isLinkToUnknown() || vInfos->fileType.isDir()) {
2349 fpn = vInfos->filePath + IGFD::Utils::GetPathSeparator() + vInfos->fileNameExt;
2350 }
2351
2352 m_FileSystemPtr->GetFileDateAndSize(fpn, vInfos->fileType, vInfos->fileModifDate, vInfos->fileSize);
2353
2354 if (!vInfos->fileType.isDir()) {
2355 vInfos->formatedFileSize = IGFD::Utils::FormatFileSize(vInfos->fileSize);
2356 }
2357}
2358
2359void IGFD::FileManager::m_RemoveFileNameInSelection(const std::string& vFileName) {
2360 m_SelectedFileNames.erase(vFileName);

Callers

nothing calls this directly

Calls 4

isFileMethod · 0.80
isLinkToUnknownMethod · 0.80
isDirMethod · 0.80
GetFileDateAndSizeMethod · 0.80

Tested by

no test coverage detected