KiCad PCB EDA Suite
Loading...
Searching...
No Matches
library_table_parser.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 * @author Jon Evans <[email protected]>
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef LIBRARY_TABLE_PARSER_H
22#define LIBRARY_TABLE_PARSER_H
23
24#include <filesystem>
25#include <optional>
26#include <string>
27#include <vector>
28
29#include <tl/expected.hpp>
30#include <wx/wx.h>
32
34{
35 std::string nickname;
36 std::string uri;
37 std::string type;
38 std::string options;
39 std::string description;
40 bool disabled = false;
41 bool hidden = false;
42};
43
48{
49 std::string version;
51 std::vector<LIBRARY_TABLE_ROW_IR> rows;
52};
53
55{
56 wxString description;
57 size_t line = 0;
58 size_t column = 0;
59};
60
62{
63public:
65
66 tl::expected<LIBRARY_TABLE_IR, LIBRARY_PARSE_ERROR> Parse( const std::filesystem::path& aPath );
67
68 tl::expected<LIBRARY_TABLE_IR, LIBRARY_PARSE_ERROR> ParseBuffer( const std::string& aBuffer );
69
70private:
71
72};
73
74#endif //LIBRARY_TABLE_PARSER_H
tl::expected< LIBRARY_TABLE_IR, LIBRARY_PARSE_ERROR > ParseBuffer(const std::string &aBuffer)
tl::expected< LIBRARY_TABLE_IR, LIBRARY_PARSE_ERROR > Parse(const std::filesystem::path &aPath)
#define KICOMMON_API
Definition kicommon.h:28
LIBRARY_TABLE_TYPE
The intermediate representation that a library table is parsed into.
std::vector< LIBRARY_TABLE_ROW_IR > rows
LIBRARY_TABLE_TYPE type