KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_io_easyedapro_v3.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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef PCB_IO_EASYEDAPRO_V3_H_
25#define PCB_IO_EASYEDAPRO_V3_H_
26
28#include <pcb_io/pcb_io.h>
29
30#include <memory>
31
32namespace EASYEDAPRO
33{
34class V3_DOC_PARSER;
35}
36
37
39{
40public:
43
45 {
46 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Pro v3 project" ), { "epro2" } );
47 }
48
50 {
51 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Pro v3 files" ), { "elibz2" } );
52 }
53
54 bool CanReadBoard( const wxString& aFileName ) const override;
55
56 bool CanReadLibrary( const wxString& aFileName ) const override;
57
58 BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
59 const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
60
61 long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
62
63 void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, bool aBestEfforts,
64 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
65
66 FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, bool aKeepUUID = false,
67 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
68
69 bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
70
71private:
72 const EASYEDAPRO::V3_DOC_PARSER& getCachedLibraryParser( const wxString& aLibraryPath ) const;
73
74 mutable wxString m_cachedLibraryPath;
75 mutable long long m_cachedLibraryTimestamp = -1;
76 mutable std::unique_ptr<EASYEDAPRO::V3_DOC_PARSER> m_cachedLibraryParser;
77};
78
79
80#endif // PCB_IO_EASYEDAPRO_V3_H_
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
Parses EasyEDA Pro v3 .epro2 archives.
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
std::unique_ptr< EASYEDAPRO::V3_DOC_PARSER > m_cachedLibraryParser
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
bool CanReadBoard(const wxString &aFileName) const override
Checks if this PCB_IO can read the specified board file.
~PCB_IO_EASYEDAPRO_V3() override
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
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.
const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override
Returns board file description for the PCB_IO.
const EASYEDAPRO::V3_DOC_PARSER & getCachedLibraryParser(const wxString &aLibraryPath) const
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...
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:63
#define _HKI(x)
Definition page_info.cpp:40
Container that describes file type info.
Definition io_base.h:43