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::vector<std::pair<std::string, std::tuple<std::string, bool>>>
59};
60
61
63{
64 std::string id;
65 std::string name;
66 std::string description;
67
68 std::time_t lastCached = 0;
69
70 std::vector<HTTP_LIB_PART> cachedParts;
71};
72
73
75{
76public:
77 HTTP_LIB_SETTINGS( const std::string& aFilename );
78
79 virtual ~HTTP_LIB_SETTINGS() {}
80
82
84 {
85 if( sourceType.compare( "REST_API" ) == 0 )
86 {
87 return HTTP_LIB_SOURCE_TYPE::REST_API;
88 }
89
90 return HTTP_LIB_SOURCE_TYPE::INVALID;
91 }
92
93 std::string getSupportedAPIVersion() { return api_version; }
94
95protected:
96 wxString getFileExt() const override;
97
98private:
99 std::string sourceType;
100 std::string api_version = "v1";
101};
102
103#endif //KICAD_HTTP_LIB_SETTINGS_H
std::string getSupportedAPIVersion()
wxString getFileExt() const override
virtual ~HTTP_LIB_SETTINGS()
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::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