33 QStringList extensions;
34 extensions <<
"*.cpp" <<
"*.cxx" <<
"*.cc" <<
"*.c" <<
"*.c++" <<
"*.txx" <<
"*.tpp" <<
"*.ipp" <<
"*.ixx";
44 if (filters.contains(ext, Qt::CaseInsensitive))
52 QFileInfo inf(filepath);
62 const QStringList origNameFilters = dir.nameFilters();
63 dir.setNameFilters(filters);
65 dir.setFilter(QDir::Files | QDir::NoDotAndDotDot);
66 QFileInfoList items = dir.entryInfoList();
69 dir.setFilter(QDir::Files | QDir::NoDotAndDotDot);
70 QFileInfoList items = dir.entryInfoList();
73 dir.setNameFilters(origNameFilters);
74 dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
75 for (
const QFileInfo& item : dir.entryInfoList()) {
76 const QString path = item.canonicalFilePath();
84 for (
const QString& path : paths) {
98 QString name = QDir::fromNativeSeparators(item.filePath());
113 std::vector<std::string> ret;
114 std::transform(stringList.cbegin(), stringList.cend(), std::back_inserter(ret), [](
const QString& s) {
115 return s.toStdString();
129 for (
const QFileInfo& item :
mFileList) {
130 if (pathMatch.
match(QDir::fromNativeSeparators(item.filePath()).toStdString()))
132 QString canonical = QDir::fromNativeSeparators(item.canonicalFilePath());
133 if (!pathMatch.
match(canonical.toStdString()))
static bool filterMatches(const QFileInfo &inf)
Test if filename matches the filename extensions filtering.
static QStringList getDefaultFilters()
Return list of default filename extensions included.
void addFile(const QString &filepath)
Add filename to the list.
void addDirectory(const QString &directory, bool recursive=false)
Add files in the directory to the list.
QStringList getFileList() const
Return list of filenames (to check).
void addPathList(const QStringList &paths)
Add list of filenames and directories to the list.
QStringList applyExcludeList() const
Get filtered list of paths.
void addExcludeList(const QStringList &paths)
Add list of paths to exclusion list.
QStringList mExcludedPaths
Simple path matching for ignoring paths in CLI.
bool match(const std::string &path) const
Match path against list of masks.
static std::vector< std::string > toStdStringList(const QStringList &stringList)
static constexpr char Name[]