aboutsummaryrefslogtreecommitdiff
path: root/src/Storage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Storage.cpp')
-rw-r--r--src/Storage.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Storage.cpp b/src/Storage.cpp
index f4732b8..effa70b 100644
--- a/src/Storage.cpp
+++ b/src/Storage.cpp
@@ -246,7 +246,9 @@ namespace QuickMedia {
void for_files_in_dir(const Path &path, FileIteratorCallback callback) {
try {
for(auto &p : std::filesystem::directory_iterator(path.data)) {
- if(!callback(p.path().string()))
+ std::error_code ec;
+ const FileType file_type = p.is_directory(ec) ? FileType::DIRECTORY : FileType::REGULAR;
+ if(!callback(p.path().string(), file_type))
break;
}
} catch(const std::filesystem::filesystem_error &err) {
@@ -285,7 +287,9 @@ namespace QuickMedia {
}
for(auto &p : paths) {
- if(!callback(p.path().string()))
+ std::error_code ec;
+ const FileType file_type = p.is_directory(ec) ? FileType::DIRECTORY : FileType::REGULAR;
+ if(!callback(p.path().string(), file_type))
break;
}
}
@@ -312,7 +316,9 @@ namespace QuickMedia {
}
for(auto &p : paths) {
- if(!callback(p.path().string()))
+ std::error_code ec;
+ const FileType file_type = p.is_directory(ec) ? FileType::DIRECTORY : FileType::REGULAR;
+ if(!callback(p.path().string(), file_type))
break;
}
}