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

Method ScanDir

ImGuiFileDialog.cpp:2097–2120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2095}
2096
2097void IGFD::FileManager::ScanDir(const FileDialogInternal& vFileDialogInternal, const std::string& vPath) {
2098 std::string path = vPath;
2099
2100 if (m_CurrentPathDecomposition.empty()) {
2101 SetCurrentDir(path);
2102 }
2103
2104 if (!m_CurrentPathDecomposition.empty()) {
2105#ifdef _IGFD_WIN_
2106 if (path == fsRoot) {
2107 path += IGFD::Utils::GetPathSeparator();
2108 }
2109#endif // _IGFD_WIN_
2110
2111 ClearFileLists();
2112
2113 const auto& files = m_FileSystemPtr->ScanDirectory(path);
2114 for (const auto& file : files) {
2115 m_AddFile(vFileDialogInternal, path, file.fileNameExt, file.fileType);
2116 }
2117
2118 m_SortFields(vFileDialogInternal, m_FileList, m_FilteredFileList);
2119 }
2120}
2121
2122void IGFD::FileManager::m_ScanDirForPathSelection(const FileDialogInternal& vFileDialogInternal, const std::string& vPath) {
2123 std::string path = vPath;

Callers 1

DisplayMethod · 0.80

Calls 2

emptyMethod · 0.80
ScanDirectoryMethod · 0.45

Tested by

no test coverage detected