Moved scanner specific code from core

This commit is contained in:
emeric
2025-07-19 11:39:57 +02:00
parent 1236969516
commit 97866d6143
4 changed files with 61 additions and 81 deletions
-11
View File
@@ -20,9 +20,7 @@
#pragma once
#include <filesystem>
#include <functional>
#include <span>
#include <system_error>
#include <Wt/WDateTime.h>
@@ -32,15 +30,6 @@ namespace lms::core::pathUtils
// Create it if needed
bool ensureDirectory(const std::filesystem::path& dir);
struct FileInfo
{
Wt::WDateTime lastWriteTime; // Last write time of the file since Epoch
std::uint64_t fileSize{}; // Size of the file in bytes
};
using ExploreFileCallback = std::function<bool(std::error_code, const std::filesystem::path&, const FileInfo* fileInfo)>;
// returns false if aborted by user
bool exploreFilesRecursive(const std::filesystem::path& directory, ExploreFileCallback cb, const std::filesystem::path* excludeDirFileName = {});
// Check if file's extension is one of provided extensions
bool hasFileAnyExtension(const std::filesystem::path& file, std::span<const std::filesystem::path> extensions);