Thu, 09 Mar 2017 12:50:14 +0200
Laid groundwork for library collection support.
#pragma once #include <QDir> #include "main.h" /* * Models a collection of libraries. A library is a folder containing directories named "p" and * "parts" that contains part and subpart files. */ class LibraryCollection { public: enum FileType { Part, Subpart, Primitive, HighResolutionPrimitive, LowResolutionPrimitive, }; struct FileSpec { QString name; FileType type; }; QString find(QString relativePath) const; QString find(const QString& name, FileType type) const; QString find(const FileSpec& spec) const; static const QStringList directoryNames; private: class SubdirectoryNotFoundError : public std::exception {}; struct Library { QDir path; QString name; QDir subdirectory(FileType type) const; static QString subdirectoryName(FileType type); }; QVector<Library> m_libraries; };