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 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef KICAD_HTTP_LIB_SETTINGS_H
21#define KICAD_HTTP_LIB_SETTINGS_H
22
24#include <ctime>
25
26
28{
31};
32
33
35{
37 std::string root_url;
38 std::string api_version;
39 std::string token;
42};
43
44
46{
47 std::string id;
48 std::string name;
49 std::string symbolIdStr;
50
51 bool exclude_from_bom = false;
52 bool exclude_from_board = false;
53 bool exclude_from_sim = false;
54
55 std::time_t lastCached = 0;
56
57 std::map<std::string, std::tuple<std::string, bool>> fields;
58};
59
60
62{
63 std::string id;
64 std::string name;
65
66 std::time_t lastCached = 0;
67
68 std::vector<HTTP_LIB_PART> cachedParts;
69};
70
71
73{
74public:
75 HTTP_LIB_SETTINGS( const std::string& aFilename );
76
77 virtual ~HTTP_LIB_SETTINGS() {}
78
80
82 {
83 if( sourceType.compare( "REST_API" ) == 0 )
84 {
85 return HTTP_LIB_SOURCE_TYPE::REST_API;
86 }
87
88 return HTTP_LIB_SOURCE_TYPE::INVALID;
89 }
90
91 std::string getSupportedAPIVersion() { return api_version; }
92
93protected:
94 wxString getFileExt() const override;
95
96private:
97 std::string sourceType;
98 std::string api_version = "v1";
99};
100
101#endif //KICAD_HTTP_LIB_SETTINGS_H
std::string getSupportedAPIVersion()
wxString getFileExt() const override
virtual ~HTTP_LIB_SETTINGS()
std::string api_version
std::string sourceType
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::time_t lastCached
std::string name
std::string symbolIdStr
std::string id
std::time_t lastCached
std::map< std::string, std::tuple< std::string, bool > > fields
additional generic fields
HTTP_LIB_SOURCE_TYPE type
std::string api_version
std::string root_url