2#include <Process/FileOperation.hpp>
8#include <score_lib_process_export.h>
20struct DocumentContext;
34SCORE_LIB_PROCESS_EXPORT
52 void scan(
const QString& folder,
FileScan* progress =
nullptr);
56 std::vector<QString> candidates(
const QString& missingPath, qint64 size = -1)
const;
58 int fileCount()
const noexcept {
return int(m_byName.size()); }
59 const QString& root()
const noexcept {
return m_root; }
64 QMultiHash<QString, QString> m_byName;
84 static std::shared_ptr<FileScan>
85 start(
const QString& folder, QObject* context,
OnFinished onFinished);
87 void cancel() noexcept { m_cancelled.store(
true, std::memory_order_relaxed); }
88 bool cancelled() const noexcept
90 return m_cancelled.load(std::memory_order_relaxed);
93 int filesSeen() const noexcept {
return m_filesSeen.load(std::memory_order_relaxed); }
95 QString currentFolder()
const;
97 const QString& root() const noexcept {
return m_root; }
100 friend class FileIndex;
101 void fileSeen() noexcept { m_filesSeen.fetch_add(1, std::memory_order_relaxed); }
102 void setCurrentFolder(
const QString& folder);
105 mutable std::mutex m_mutex;
106 QString m_currentFolder;
107 std::atomic_int m_filesSeen{};
108 std::atomic_bool m_cancelled{};
122SCORE_LIB_PROCESS_EXPORT
Definition MissingFiles.hpp:48
A folder walk running on the task pool, and the handle to it.
Definition MissingFiles.hpp:75
std::function< void(FileIndex, bool cancelled)> OnFinished
Called on context's thread when the walk ends, cancelled or not.
Definition MissingFiles.hpp:78
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
FileReport relinkFiles(const score::DocumentContext &ctx, const QHash< QString, QString > &chosen)
Repoint references at the files they were found at.
Definition MissingFiles.cpp:165
FileReport scanMissingFiles(const score::DocumentContext &ctx)
Everything the document references and cannot find right now.
Definition MissingFiles.cpp:19
Base toolkit upon which the software is built.
Definition Application.cpp:83
Definition DocumentContext.hpp:18