KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_io_sprint_layout.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 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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 <https://www.gnu.org/licenses/>.
18 *
19 * This file contains file format knowledge derived from the xlay project:
20 * https://github.com/sergey-raevskiy/xlay
21 * and the OpenBoardView project:
22 * https://github.com/OpenBoardView/OpenBoardView
23 */
24
25#ifndef PCB_IO_SPRINT_LAYOUT_H_
26#define PCB_IO_SPRINT_LAYOUT_H_
27
28#include <map>
29#include <memory>
30#include <string>
31#include <vector>
32
34#include <pcb_io/pcb_io.h>
35#include <pcb_io/pcb_io_mgr.h>
36
37class BOARD;
38class FOOTPRINT;
39
41{
42public:
44 {
45 return IO_BASE::IO_FILE_DESC( _HKI( "Sprint Layout board file" ), { "lay6", "lay" } );
46 }
47
49 {
50 return IO_BASE::IO_FILE_DESC( _HKI( "Sprint Layout macro file" ), { "lmk" } );
51 }
52
54 {
55 return IO_BASE::IO_FILE_DESC( _HKI( "Sprint Layout macro library" ), {}, { "lmk" }, false );
56 }
57
58 void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, bool aBestEfforts,
59 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
60
61 FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, bool aKeepUUID = false,
62 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
63
64 bool CanReadBoard( const wxString& aFileName ) const override;
65
66 BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
67 const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
68
69 std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
70
71 long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override { return 0; }
72
73 bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
74
76 ~PCB_IO_SPRINT_LAYOUT() override;
77
78private:
79 std::map<wxString, std::unique_ptr<FOOTPRINT>> m_loadedFootprints;
80};
81
82#endif // PCB_IO_SPRINT_LAYOUT_H_
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints() override
Return a container with the cached library footprints generated in the last call to Load.
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
bool CanReadBoard(const wxString &aFileName) const override
Checks if this PCB_IO can read the specified board file.
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override
Returns board file description for the PCB_IO.
const IO_BASE::IO_FILE_DESC GetLibraryFileDesc() const override
Get the descriptor for the individual library elements that this IO plugin operates on.
FOOTPRINT * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PC...
std::map< wxString, std::unique_ptr< FOOTPRINT > > m_loadedFootprints
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
PCB_IO(const wxString &aName)
Definition pcb_io.h:342
Plugin class for import plugins that support choosing a project.
Container for project specific data.
Definition project.h:62
#define _HKI(x)
Definition page_info.cpp:40
Container that describes file type info.
Definition io_base.h:43