KiCad PCB EDA Suite
Loading...
Searching...
No Matches
remote_symbol_import_utils.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 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 REMOTE_SYMBOL_IMPORT_UTILS_H
21#define REMOTE_SYMBOL_IMPORT_UTILS_H
22
23#include <cstdint>
24#include <vector>
25
26#include <wx/filename.h>
27#include <wx/string.h>
28
29class SCH_EDIT_FRAME;
30enum class LIBRARY_TABLE_TYPE;
31
32
37wxString SanitizeRemoteFileComponent( const wxString& aValue, const wxString& aDefault,
38 bool aLower = false );
39
44wxString RemoteLibraryPrefix();
45
49bool WriteRemoteBinaryFile( const wxFileName& aOutput, const std::vector<uint8_t>& aPayload,
50 wxString& aError );
51
56bool EnsureRemoteDestinationRoot( wxFileName& aOutDir, wxString& aError );
57
62bool EnsureRemoteLibraryEntry( LIBRARY_TABLE_TYPE aTableType, const wxFileName& aLibraryPath,
63 const wxString& aNickname, bool aGlobalTable, bool aStrict,
64 wxString& aError );
65
69bool PlaceRemoteDownloadedSymbol( SCH_EDIT_FRAME* aFrame, const wxString& aNickname,
70 const wxString& aLibItemName, wxString& aError );
71
72#endif // REMOTE_SYMBOL_IMPORT_UTILS_H
Schematic editor (Eeschema) main window.
LIBRARY_TABLE_TYPE
bool PlaceRemoteDownloadedSymbol(SCH_EDIT_FRAME *aFrame, const wxString &aNickname, const wxString &aLibItemName, wxString &aError)
Place a symbol from a remote download into the schematic editor.
bool EnsureRemoteLibraryEntry(LIBRARY_TABLE_TYPE aTableType, const wxFileName &aLibraryPath, const wxString &aNickname, bool aGlobalTable, bool aStrict, wxString &aError)
Add or update a library table entry for a remote download library.
bool WriteRemoteBinaryFile(const wxFileName &aOutput, const std::vector< uint8_t > &aPayload, wxString &aError)
Write binary data to a file, creating parent directories as needed.
bool EnsureRemoteDestinationRoot(wxFileName &aOutDir, wxString &aError)
Resolve and create the configured destination root directory for remote symbol downloads.
wxString RemoteLibraryPrefix()
Return the configured (or default) library prefix for remote downloads, sanitized for use as a filena...
wxString SanitizeRemoteFileComponent(const wxString &aValue, const wxString &aDefault, bool aLower=false)
Replace non-alphanumeric characters (other than _ - .) with underscores.