LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
symbolconverter.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_SYMBOLCONVERTER_H
21 #define LIBREPCB_EAGLEIMPORT_SYMBOLCONVERTER_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 Symbol;
38 }
39 
40 namespace librepcb {
41 
42 namespace library {
43 class Symbol;
44 }
45 
46 namespace eagleimport {
47 
48 class ConverterDb;
49 
50 /*******************************************************************************
51  * Class SymbolConverter
52  ******************************************************************************/
53 
57 class SymbolConverter final {
58 public:
59  // Constructors / Destructor
60  SymbolConverter() = delete;
61  SymbolConverter(const SymbolConverter& other) = delete;
62  SymbolConverter(const parseagle::Symbol& symbol, ConverterDb& db) noexcept;
63  ~SymbolConverter() noexcept;
64 
65  // General Methods
66  std::unique_ptr<library::Symbol> generate() const;
67 
68  // Operator Overloadings
69  SymbolConverter& operator=(const SymbolConverter& rhs) = delete;
70 
71 private:
72  QString createDescription() const noexcept;
73  static GraphicsLayerName convertSchematicLayer(int eagleLayerId);
74 
75  const parseagle::Symbol& mSymbol;
77 };
78 
79 /*******************************************************************************
80  * End of File
81  ******************************************************************************/
82 
83 } // namespace eagleimport
84 } // namespace librepcb
85 
86 #endif // LIBREPCB_EAGLEIMPORT_SYMBOLCONVERTER_H
The SymbolConverter class.
Definition: symbolconverter.h:57
static GraphicsLayerName convertSchematicLayer(int eagleLayerId)
Definition: symbolconverter.cpp:161
QString createDescription() const noexcept
Definition: symbolconverter.cpp:152
std::unique_ptr< library::Symbol > generate() const
Definition: symbolconverter.cpp:55
SymbolConverter & operator=(const SymbolConverter &rhs)=delete
type_safe::constrained_type< QString, GraphicsLayerNameConstraint, GraphicsLayerNameVerifier > GraphicsLayerName
Definition: graphicslayername.h:78
~SymbolConverter() noexcept
Definition: symbolconverter.cpp:48
The ConverterDb class.
Definition: converterdb.h:47
const parseagle::Symbol & mSymbol
Definition: symbolconverter.h:75
ConverterDb & mDb
Definition: symbolconverter.h:76