LibrePCB Developers Documentation
archiveoutputjob.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_CORE_ARCHIVEOUTPUTJOB_H
21#define LIBREPCB_CORE_ARCHIVEOUTPUTJOB_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "outputjob.h"
27
28#include <optional/tl/optional.hpp>
29
30#include <QtCore>
31#include <QtGui>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38/*******************************************************************************
39 * Class ArchiveOutputJob
40 ******************************************************************************/
41
45class ArchiveOutputJob final : public OutputJob {
46 Q_DECLARE_TR_FUNCTIONS(ArchiveOutputJob)
47
48public:
49 // Constructors / Destructor
50 ArchiveOutputJob() noexcept;
51 ArchiveOutputJob(const ArchiveOutputJob& other) noexcept;
52 explicit ArchiveOutputJob(const SExpression& node);
53 virtual ~ArchiveOutputJob() noexcept;
54
55 // Getters
56 virtual QString getTypeTr() const noexcept override;
57 virtual QIcon getTypeIcon() const noexcept override;
58 virtual QSet<Uuid> getDependencies() const noexcept override;
59 const QMap<Uuid, QString>& getInputJobs() const noexcept {
60 return mInputJobs;
61 }
62 const QString& getOutputPath() const noexcept { return mOutputPath; }
63
64 // Setters
65 void setInputJobs(const QMap<Uuid, QString>& input) noexcept;
66 void setOutputPath(const QString& path) noexcept;
67
68 // General Methods
69 static QString getTypeName() noexcept { return "archive"; }
70 static QString getTypeTrStatic() noexcept {
71 return tr("Archive") % " (*.zip)";
72 }
73 virtual void removeDependency(const Uuid& jobUuid) override;
74 virtual std::shared_ptr<OutputJob> cloneShared() const noexcept override;
75
76 // Operator Overloadings
77 ArchiveOutputJob& operator=(const ArchiveOutputJob& rhs) = delete;
78
79private: // Methods
80 virtual void serializeDerived(SExpression& root) const override;
81 virtual bool equals(const OutputJob& rhs) const noexcept override;
82
83private: // Data
84 QMap<Uuid, QString> mInputJobs;
85 QString mOutputPath;
86};
87
88/*******************************************************************************
89 * End of File
90 ******************************************************************************/
91
92} // namespace librepcb
93
94#endif
File archiving (e.g. to ZIP) output job.
Definition: archiveoutputjob.h:45
virtual QString getTypeTr() const noexcept override
Definition: archiveoutputjob.cpp:70
void setOutputPath(const QString &path) noexcept
Definition: archiveoutputjob.cpp:93
const QMap< Uuid, QString > & getInputJobs() const noexcept
Definition: archiveoutputjob.h:59
virtual bool equals(const OutputJob &rhs) const noexcept override
Definition: archiveoutputjob.cpp:129
static QString getTypeName() noexcept
Definition: archiveoutputjob.h:69
QMap< Uuid, QString > mInputJobs
Job UUID, destination path.
Definition: archiveoutputjob.h:84
virtual void removeDependency(const Uuid &jobUuid) override
Definition: archiveoutputjob.cpp:104
static QString getTypeTrStatic() noexcept
Definition: archiveoutputjob.h:70
QString mOutputPath
Definition: archiveoutputjob.h:85
virtual QSet< Uuid > getDependencies() const noexcept override
Definition: archiveoutputjob.cpp:78
virtual ~ArchiveOutputJob() noexcept
Definition: archiveoutputjob.cpp:63
virtual QIcon getTypeIcon() const noexcept override
Definition: archiveoutputjob.cpp:74
virtual void serializeDerived(SExpression &root) const override
Definition: archiveoutputjob.cpp:118
void setInputJobs(const QMap< Uuid, QString > &input) noexcept
Definition: archiveoutputjob.cpp:86
const QString & getOutputPath() const noexcept
Definition: archiveoutputjob.h:62
ArchiveOutputJob() noexcept
Definition: archiveoutputjob.cpp:39
virtual std::shared_ptr< OutputJob > cloneShared() const noexcept override
Definition: archiveoutputjob.cpp:110
Base class for all output job types.
Definition: outputjob.h:50
The SExpression class.
Definition: sexpression.h:69
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
Definition: occmodel.cpp:77