Loading...
Searching...
No Matches
MissingFiles.hpp
1#pragma once
2#include <Process/FileOperation.hpp>
3
4#include <QHash>
5#include <QMultiHash>
6#include <QString>
7
8#include <score_lib_process_export.h>
9
10#include <vector>
11
12namespace score
13{
14struct DocumentContext;
15}
16
17namespace Process
18{
19
28SCORE_LIB_PROCESS_EXPORT
29FileReport scanMissingFiles(const score::DocumentContext& ctx);
30
39class SCORE_LIB_PROCESS_EXPORT FileIndex
40{
41public:
48 void scan(const QString& folder, int maxFiles = 250000);
49
53 std::vector<QString> candidates(const QString& missingPath, qint64 size = -1) const;
54
55 int fileCount() const noexcept { return int(m_byName.size()); }
56 bool truncated() const noexcept { return m_truncated; }
57 const QString& root() const noexcept { return m_root; }
58
59private:
60 QString m_root;
62 QMultiHash<QString, QString> m_byName;
63 bool m_truncated{};
64};
65
77SCORE_LIB_PROCESS_EXPORT
79 const score::DocumentContext& ctx, const QHash<QString, QString>& chosen);
80}
An index of the files under a folder, used to relink by name.
Definition MissingFiles.hpp:40
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:99
FileReport scanMissingFiles(const score::DocumentContext &ctx)
Everything the document references and cannot find right now.
Definition MissingFiles.cpp:14
Base toolkit upon which the software is built.
Definition Application.cpp:116
Definition FileOperation.hpp:78
Definition DocumentContext.hpp:18