| 2066 | } |
| 2067 | |
| 2068 | void IGFD::FileManager::m_AddPath(const FileDialogInternal& vFileDialogInternal, const std::string& vPath, const std::string& vFileName, const FileType& vFileType) { |
| 2069 | if (!vFileType.isDir()) return; |
| 2070 | |
| 2071 | auto pInfos = FileInfos::create(); |
| 2072 | |
| 2073 | pInfos->filePath = vPath; |
| 2074 | pInfos->fileNameExt = vFileName; |
| 2075 | pInfos->fileNameExt_optimized = Utils::LowerCaseString(pInfos->fileNameExt); |
| 2076 | pInfos->fileType = vFileType; |
| 2077 | |
| 2078 | if (pInfos->fileNameExt.empty() || (pInfos->fileNameExt == "." && !vFileDialogInternal.filterManager.dLGFilters.empty())) { // filename empty or filename is the current dir '.' //-V807 |
| 2079 | return; |
| 2080 | } |
| 2081 | |
| 2082 | if (pInfos->fileNameExt != ".." && (vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_DontShowHiddenFiles) && pInfos->fileNameExt[0] == '.') { // dont show hidden files |
| 2083 | if (!vFileDialogInternal.filterManager.dLGFilters.empty() || (vFileDialogInternal.filterManager.dLGFilters.empty() && pInfos->fileNameExt != ".")) { // except "." if in directory mode //-V728 |
| 2084 | return; |
| 2085 | } |
| 2086 | } |
| 2087 | |
| 2088 | vFileDialogInternal.filterManager.FillFileStyle(pInfos); |
| 2089 | |
| 2090 | m_CompleteFileInfos(pInfos); |
| 2091 | |
| 2092 | if (m_CompleteFileInfosWithUserFileAttirbutes(vFileDialogInternal, pInfos)) { |
| 2093 | m_PathList.push_back(pInfos); |
| 2094 | } |
| 2095 | } |
| 2096 | |
| 2097 | void IGFD::FileManager::ScanDir(const FileDialogInternal& vFileDialogInternal, const std::string& vPath) { |
| 2098 | std::string path = vPath; |