KiCad PCB EDA Suite
Loading...
Searching...
No Matches
http_lib_settings.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 (C) 2023 Andre F. K. Iwers <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
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 KICAD_HTTP_LIB_SETTINGS_H
22#define KICAD_HTTP_LIB_SETTINGS_H
23
25#include <ctime>
26
27
29{
32};
33
34
36{
38 std::string root_url;
39 std::string api_version;
40 std::string token;
43};
44
45
47{
48 std::string id;
49 std::string name;
50 std::string symbolIdStr;
51
52 bool exclude_from_bom = false;
53 bool exclude_from_board = false;
54 bool exclude_from_sim = false;
55
56 std::time_t lastCached = 0;
57
58 std::vector<std::pair<std::string, std::tuple<std::string, bool>>>
60};
61
62
64{
65 std::string id;
66 std::string name;
67 std::string description;
68
69 std::time_t lastCached = 0;
70
71 std::vector<HTTP_LIB_PART> cachedParts;
72};
73
74
76{
77public:
78 HTTP_LIB_SETTINGS( const std::string& aFilename );
79
80 virtual ~HTTP_LIB_SETTINGS() {}
81
83
85 {
86 if( sourceType.compare( "REST_API" ) == 0 )
87 {
88 return HTTP_LIB_SOURCE_TYPE::REST_API;
89 }
90
91 return HTTP_LIB_SOURCE_TYPE::INVALID;
92 }
93
94 std::string getSupportedAPIVersion() { return api_version; }
95
96protected:
97 wxString getFileExt() const override;
98
99private:
100 std::string sourceType;
101 std::string api_version = "v1";
102};
103
104#endif //KICAD_HTTP_LIB_SETTINGS_H
std::string getSupportedAPIVersion()
wxString getFileExt() const override
virtual ~HTTP_LIB_SETTINGS()
HTTP_LIB_SOURCE m_Source
HTTP_LIB_SOURCE_TYPE get_HTTP_LIB_SOURCE_TYPE()
HTTP_LIB_SOURCE_TYPE
std::string id
id of category
std::vector< HTTP_LIB_PART > cachedParts
std::string name
name of category
std::string description
description of category
std::time_t lastCached
std::string name
std::string symbolIdStr
std::string id
std::time_t lastCached
std::vector< std::pair< std::string, std::tuple< std::string, bool > > > fields
additional generic fields
HTTP_LIB_SOURCE_TYPE type
std::string api_version
std::string root_url