20#ifndef LIBREPCB_CORE_WORKSPACELIBRARYSCANNER_H
21#define LIBREPCB_CORE_WORKSPACELIBRARYSCANNER_H
26#include "../fileio/filepath.h"
39class WorkspaceLibraryDbWriter;
58 const FilePath& dbFilePath)
noexcept;
81 void run() noexcept override;
84 QList<std::shared_ptr<
Library>>& libs) noexcept;
88 const QList<std::shared_ptr<
Library>>& libs);
89 template <typename ElementType>
91 const QStringList& dirs,
int libId);
92 template <typename ElementType>
94 const ElementType& element);
95 template <typename ElementType>
97 const ElementType& element);
98 template <typename ElementType>
100 const ElementType& element);
101 template <typename ElementType>
103 const ElementType& element);
104 template <typename ElementType>
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
The Library class represents a library directory.
Definition: library.h:46
The SQLiteDatabase class.
Definition: sqlitedatabase.h:43
Database write functions for librepcb::WorkspaceLibraryDb.
Definition: workspacelibrarydbwriter.h:57
The WorkspaceLibraryScanner class.
Definition: workspacelibraryscanner.h:52
void run() noexcept override
Definition: workspacelibraryscanner.cpp:93
~WorkspaceLibraryScanner() noexcept
Definition: workspacelibraryscanner.cpp:68
void scanProgressUpdate(int percent)
int addElementsToDb(WorkspaceLibraryDbWriter &writer, const FilePath &libPath, const QStringList &dirs, int libId)
Definition: workspacelibraryscanner.cpp:272
std::unique_ptr< ElementType > openAndMigrate(const FilePath &fp)
Definition: workspacelibraryscanner.cpp:401
void scanFailed(QString errorMsg)
volatile bool mAbort
Definition: workspacelibraryscanner.h:111
void scanSucceeded(int elementCount)
void scanLibraryListUpdated(int libraryCount)
QSemaphore mSemaphore
Definition: workspacelibraryscanner.h:110
void startScan() noexcept
Definition: workspacelibraryscanner.cpp:85
void getLibrariesOfDirectory(const QString &root, QList< std::shared_ptr< Library > > &libs) noexcept
Definition: workspacelibraryscanner.cpp:193
void scan() noexcept
Definition: workspacelibraryscanner.cpp:108
int addElementToDb(WorkspaceLibraryDbWriter &writer, int libId, const ElementType &element)
Definition: workspacelibraryscanner.cpp:295
const FilePath mDbFilePath
Path to the SQLite database file.
Definition: workspacelibraryscanner.h:109
void addTranslationsToDb(WorkspaceLibraryDbWriter &writer, int elementId, const ElementType &element)
Definition: workspacelibraryscanner.cpp:370
void addToCategories(WorkspaceLibraryDbWriter &writer, int elementId, const ElementType &element)
Definition: workspacelibraryscanner.cpp:382
int getProgressPercent() const noexcept
Definition: workspacelibraryscanner.h:63
WorkspaceLibraryScanner(const WorkspaceLibraryScanner &other)=delete
QHash< FilePath, int > updateLibraries(SQLiteDatabase &db, WorkspaceLibraryDbWriter &writer, const QList< std::shared_ptr< Library > > &libs)
Definition: workspacelibraryscanner.cpp:214
void addResourcesToDb(WorkspaceLibraryDbWriter &writer, int elementId, const ElementType &element)
Definition: workspacelibraryscanner.cpp:391
int mLastProgressPercent
Definition: workspacelibraryscanner.h:112
const FilePath mLibrariesPath
Path to workspace libraries directory.
Definition: workspacelibraryscanner.h:108
WorkspaceLibraryScanner(const FilePath &librariesPath, const FilePath &dbFilePath) noexcept
Definition: workspacelibraryscanner.cpp:49
Definition: occmodel.cpp:77