MCPcopy Create free account
hub / github.com/aiekick/ImGuiFileDialog / m_AddPath

Method m_AddPath

ImGuiFileDialog.cpp:2068–2095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2066}
2067
2068void 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
2097void IGFD::FileManager::ScanDir(const FileDialogInternal& vFileDialogInternal, const std::string& vPath) {
2098 std::string path = vPath;

Callers

nothing calls this directly

Calls 2

isDirMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected