| 2032 | } |
| 2033 | |
| 2034 | void IGFD::FileManager::m_AddFile(const FileDialogInternal& vFileDialogInternal, const std::string& vPath, const std::string& vFileName, const FileType& vFileType) { |
| 2035 | auto pInfos = FileInfos::create(); |
| 2036 | |
| 2037 | pInfos->filePath = vPath; |
| 2038 | pInfos->fileNameExt = vFileName; |
| 2039 | pInfos->fileNameExt_optimized = Utils::LowerCaseString(pInfos->fileNameExt); |
| 2040 | pInfos->fileType = vFileType; |
| 2041 | |
| 2042 | if (pInfos->fileNameExt.empty() || (pInfos->fileNameExt == "." && !vFileDialogInternal.filterManager.dLGFilters.empty())) { // filename empty or filename is the current dir '.' //-V807 |
| 2043 | return; |
| 2044 | } |
| 2045 | |
| 2046 | if (pInfos->fileNameExt != ".." && (vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_DontShowHiddenFiles) && pInfos->fileNameExt[0] == '.') { // dont show hidden files |
| 2047 | if (!vFileDialogInternal.filterManager.dLGFilters.empty() || (vFileDialogInternal.filterManager.dLGFilters.empty() && pInfos->fileNameExt != ".")) { // except "." if in directory mode //-V728 |
| 2048 | return; |
| 2049 | } |
| 2050 | } |
| 2051 | |
| 2052 | if (pInfos->FinalizeFileTypeParsing(vFileDialogInternal.filterManager.GetSelectedFilter().count_dots)) { |
| 2053 | if (!vFileDialogInternal.filterManager.IsCoveredByFilters(*pInfos.get(), // |
| 2054 | (vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_CaseInsensitiveExtentionFiltering) != 0)) { |
| 2055 | return; |
| 2056 | } |
| 2057 | } |
| 2058 | |
| 2059 | vFileDialogInternal.filterManager.FillFileStyle(pInfos); |
| 2060 | |
| 2061 | m_CompleteFileInfos(pInfos); |
| 2062 | |
| 2063 | if (m_CompleteFileInfosWithUserFileAttirbutes(vFileDialogInternal, pInfos)) { |
| 2064 | m_FileList.push_back(pInfos); |
| 2065 | } |
| 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; |
nothing calls this directly
no test coverage detected