LibrePCB Developers Documentation
packagecategory.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_PACKAGECATEGORY_H
21#define LIBREPCB_CORE_PACKAGECATEGORY_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "librarycategory.h"
27
28#include <QtCore>
29
30#include <memory>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37/*******************************************************************************
38 * Class PackageCategory
39 ******************************************************************************/
40
44class PackageCategory final : public LibraryCategory {
45 Q_OBJECT
46
47public:
48 // Constructors / Destructor
49 PackageCategory() = delete;
50 PackageCategory(const PackageCategory& other) = delete;
51 PackageCategory(const Uuid& uuid, const Version& version,
52 const QString& author, const ElementName& name_en_US,
53 const QString& description_en_US,
54 const QString& keywords_en_US);
55 ~PackageCategory() noexcept;
56
57 // Operator Overloadings
58 PackageCategory& operator=(const PackageCategory& rhs) = delete;
59
60 // Static Methods
61 static std::unique_ptr<PackageCategory> open(
62 std::unique_ptr<TransactionalDirectory> directory,
63 bool abortBeforeMigration = false);
64 static QString getShortElementName() noexcept {
65 return QStringLiteral("pkgcat");
66 }
67 static QString getLongElementName() noexcept {
68 return QStringLiteral("package_category");
69 }
70
71private: // Methods
72 PackageCategory(std::unique_ptr<TransactionalDirectory> directory,
73 const SExpression& root);
74};
75
76/*******************************************************************************
77 * End of File
78 ******************************************************************************/
79
80} // namespace librepcb
81
82#endif
The LibraryCategory class extends the LibraryBaseElement class with some attributes and methods which...
Definition: librarycategory.h:43
The PackageCategory class.
Definition: packagecategory.h:44
~PackageCategory() noexcept
Definition: packagecategory.cpp:53
static QString getLongElementName() noexcept
Definition: packagecategory.h:67
PackageCategory(const PackageCategory &other)=delete
static std::unique_ptr< PackageCategory > open(std::unique_ptr< TransactionalDirectory > directory, bool abortBeforeMigration=false)
Definition: packagecategory.cpp:60
static QString getShortElementName() noexcept
Definition: packagecategory.h:64
The SExpression class.
Definition: sexpression.h:69
Helper class to access a subdirectory of TransactionalFileSystem.
Definition: transactionaldirectory.h:51
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84