LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bomcsvwriter.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_BOMCSVWRITER_H
21 #define LIBREPCB_BOMCSVWRITER_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include <QtCore>
27 
28 /*******************************************************************************
29  * Namespace / Forward Declarations
30  ******************************************************************************/
31 namespace librepcb {
32 
33 class Bom;
34 class FilePath;
35 
36 /*******************************************************************************
37  * Class BomCsvWriter
38  ******************************************************************************/
39 
43 class BomCsvWriter final {
44  Q_DECLARE_TR_FUNCTIONS(BomCsvWriter)
45 
46 public:
47  // Constructors / Destructor
48  BomCsvWriter() noexcept;
49  BomCsvWriter(const BomCsvWriter& other) = delete;
50  ~BomCsvWriter() noexcept;
51 
52  // General Methods
53  QList<QStringList> toStringList(const Bom& bom) noexcept;
54  QString toString(const Bom& bom) noexcept;
55  void writeToFile(const Bom& bom, const FilePath& csvFp);
56 
57  // Operator Overloadings
58  BomCsvWriter& operator=(const BomCsvWriter& rhs) = delete;
59 
60 private:
61  static QString cleanStr(const QString& str) noexcept;
62 };
63 
64 /*******************************************************************************
65  * End of File
66  ******************************************************************************/
67 
68 } // namespace librepcb
69 
70 #endif // LIBREPCB_BOMCSVWRITER_H
The Bom class represents a bill of materials list.
Definition: bom.h:90
static QString cleanStr(const QString &str) noexcept
Definition: bomcsvwriter.cpp:82
QString toString(const Bom &bom) noexcept
Definition: bomcsvwriter.cpp:66
BomCsvWriter() noexcept
Definition: bomcsvwriter.cpp:39
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:127
QList< QStringList > toStringList(const Bom &bom) noexcept
Definition: bomcsvwriter.cpp:49
void writeToFile(const Bom &bom, const FilePath &csvFp)
Definition: bomcsvwriter.cpp:74
The BomCsvWriter class.
Definition: bomcsvwriter.h:43
~BomCsvWriter() noexcept
Definition: bomcsvwriter.cpp:42
BomCsvWriter & operator=(const BomCsvWriter &rhs)=delete