KiCad PCB EDA Suite
Loading...
Searching...
No Matches
remote_symbol_import_utils.cpp File Reference
#include "remote_symbol_import_utils.h"
#include <common.h>
#include <eeschema_settings.h>
#include <lib_symbol.h>
#include <libraries/library_manager.h>
#include <pgm_base.h>
#include <remote_provider_settings.h>
#include <sch_edit_frame.h>
#include <sch_symbol.h>
#include <settings/settings_manager.h>
#include <tool/tool_manager.h>
#include <tools/sch_actions.h>
#include <wx/ffile.h>
#include <wx/filefn.h>
#include <wx/intl.h>

Go to the source code of this file.

Functions

wxString SanitizeRemoteFileComponent (const wxString &aValue, const wxString &aDefault, bool aLower)
 Replace non-alphanumeric characters (other than _ - .) with underscores.
 
wxString RemoteLibraryPrefix ()
 Return the configured (or default) library prefix for remote downloads, sanitized for use as a filename component.
 
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.
 
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 PlaceRemoteDownloadedSymbol (SCH_EDIT_FRAME *aFrame, const wxString &aNickname, const wxString &aLibItemName, wxString &aError)
 Place a symbol from a remote download into the schematic editor.
 

Function Documentation

◆ EnsureRemoteDestinationRoot()

◆ EnsureRemoteLibraryEntry()

bool EnsureRemoteLibraryEntry ( LIBRARY_TABLE_TYPE aTableType,
const wxFileName & aLibraryPath,
const wxString & aNickname,
bool aGlobalTable,
bool aStrict,
wxString & aError )

◆ PlaceRemoteDownloadedSymbol()

◆ RemoteLibraryPrefix()

◆ SanitizeRemoteFileComponent()

wxString SanitizeRemoteFileComponent ( const wxString & aValue,
const wxString & aDefault,
bool aLower = false )

Replace non-alphanumeric characters (other than _ - .) with underscores.

Returns aDefault when aValue is empty after trimming.

Definition at line 39 of file remote_symbol_import_utils.cpp.

References result.

Referenced by PANEL_REMOTE_SYMBOL::cookieFilePath(), REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receive3DModel(), PANEL_REMOTE_SYMBOL::receiveFootprint(), PANEL_REMOTE_SYMBOL::receiveSPICEModel(), PANEL_REMOTE_SYMBOL::receiveSymbol(), and RemoteLibraryPrefix().

◆ WriteRemoteBinaryFile()

bool WriteRemoteBinaryFile ( const wxFileName & aOutput,
const std::vector< uint8_t > & aPayload,
wxString & aError )

Write binary data to a file, creating parent directories as needed.

Definition at line 71 of file remote_symbol_import_utils.cpp.

References _.

Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receive3DModel(), PANEL_REMOTE_SYMBOL::receiveFootprint(), and PANEL_REMOTE_SYMBOL::receiveSPICEModel().