LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
packageconverter.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_EAGLEIMPORT_PACKAGECONVERTER_H
21 #define LIBREPCB_EAGLEIMPORT_PACKAGECONVERTER_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
27 
28 #include <QtCore>
29 
30 #include <memory>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 
36 namespace parseagle {
37 class Package;
38 }
39 
40 namespace librepcb {
41 
42 namespace library {
43 class Package;
44 }
45 
46 namespace eagleimport {
47 
48 class ConverterDb;
49 
50 /*******************************************************************************
51  * Class PackageConverter
52  ******************************************************************************/
53 
57 class PackageConverter final {
58 public:
59  // Constructors / Destructor
60  PackageConverter() = delete;
61  PackageConverter(const PackageConverter& other) = delete;
62  PackageConverter(const parseagle::Package& package, ConverterDb& db) noexcept;
63  ~PackageConverter() noexcept;
64 
65  // General Methods
66  std::unique_ptr<library::Package> generate() const;
67 
68  // Operator Overloadings
69  PackageConverter& operator=(const PackageConverter& rhs) = delete;
70 
71 private:
72  QString createDescription() const noexcept;
73  static GraphicsLayerName convertBoardLayer(int eagleLayerId);
74 
75  const parseagle::Package& mPackage;
77 };
78 
79 /*******************************************************************************
80  * End of File
81  ******************************************************************************/
82 
83 } // namespace eagleimport
84 } // namespace librepcb
85 
86 #endif // LIBREPCB_EAGLEIMPORT_PACKAGECONVERTER_H
QString createDescription() const noexcept
Definition: packageconverter.cpp:221
type_safe::constrained_type< QString, GraphicsLayerNameConstraint, GraphicsLayerNameVerifier > GraphicsLayerName
Definition: graphicslayername.h:78
The ConverterDb class.
Definition: converterdb.h:47
ConverterDb & mDb
Definition: packageconverter.h:76
const parseagle::Package & mPackage
Definition: packageconverter.h:75
std::unique_ptr< library::Package > generate() const
Definition: packageconverter.cpp:56
The PackageConverter class.
Definition: packageconverter.h:57
PackageConverter & operator=(const PackageConverter &rhs)=delete
~PackageConverter() noexcept
Definition: packageconverter.cpp:49
static GraphicsLayerName convertBoardLayer(int eagleLayerId)
Definition: packageconverter.cpp:230