KiCad PCB EDA Suite
|
#include <wx/filename.h>
#include <wx/process.h>
Go to the source code of this file.
Macros | |
#define | UNIX_STRING_DIR_SEP wxT( "/" ) |
#define | WIN_STRING_DIR_SEP wxT( "\\" ) |
Functions | |
bool | OpenPDF (const wxString &file) |
Run the PDF viewer and display a PDF file. More... | |
void | OpenFile (const wxString &file) |
void | KiCopyFile (const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors) |
int | ExecuteFile (const wxString &aEditorName, const wxString &aFileName=wxEmptyString, wxProcess *aCallback=nullptr) |
Call the executable file aEditorName with the parameter aFileName. More... | |
void | QuoteString (wxString &string) |
Add un " to the start and the end of string (if not already done). More... | |
wxString | FindKicadFile (const wxString &shortname) |
Search the executable file shortname in KiCad binary path and return full file name if found or shortname if the kicad binary path is kicad/bin. More... | |
wxString | QuoteFullPath (wxFileName &fn, wxPathFormat format=wxPATH_NATIVE) |
Quote return value of wxFileName::GetFullPath(). More... | |
bool | RmDirRecursive (const wxString &aDirName, wxString *aErrors=nullptr) |
Removes the directory aDirName and all its contents including subdirectories and their files. More... | |
#define UNIX_STRING_DIR_SEP wxT( "/" ) |
Definition at line 35 of file gestfich.h.
#define WIN_STRING_DIR_SEP wxT( "\\" ) |
Definition at line 36 of file gestfich.h.
int ExecuteFile | ( | const wxString & | aEditorName, |
const wxString & | aFileName = wxEmptyString , |
||
wxProcess * | aCallback = nullptr |
||
) |
Call the executable file aEditorName with the parameter aFileName.
Definition at line 120 of file gestfich.cpp.
References _, DisplayError(), and FindKicadFile().
Referenced by KICAD_MANAGER_CONTROL::Execute(), DIALOG_CONFIG_EQUFILES::OnEditEquFile(), DIALOG_BOM::OnEditGenerator(), SCH_EDIT_FRAME::OnOpenPcbnew(), PROJECT_TREE_PANE::onOpenSelectedFileWithTextEditor(), PCB_EDIT_FRAME::RunEeschema(), and GERBVIEW_INSPECTION_TOOL::ShowSource().
wxString FindKicadFile | ( | const wxString & | shortname | ) |
Search the executable file shortname in KiCad binary path and return full file name if found or shortname if the kicad binary path is kicad/bin.
The binary path is found from:
Definition at line 55 of file gestfich.cpp.
References arrayDim(), and Pgm().
Referenced by KICAD_MANAGER_FRAME::DoWithAcceptedFiles(), and ExecuteFile().
void KiCopyFile | ( | const wxString & | aSrcPath, |
const wxString & | aDestPath, | ||
wxString & | aErrors | ||
) |
aSrcPath | is the full filename of the source. |
aDestPath | is the full filename of the target |
aErrors | a wxString to append any errors to |
Definition at line 278 of file gestfich.cpp.
References _.
Referenced by MIGRATION_TRAVERSER::OnFile(), SAVE_AS_TRAVERSER::OnFile(), SCH::IFACE::SaveFileAs(), GERBV::IFACE::SaveFileAs(), PGE::IFACE::SaveFileAs(), PCB::IFACE::SaveFileAs(), PCB_EDIT_FRAME::SavePcbCopy(), and PCB_EDIT_FRAME::SavePcbFile().
void OpenFile | ( | const wxString & | file | ) |
Definition at line 259 of file gestfich.cpp.
Referenced by PROJECT_TREE_ITEM::Activate().
bool OpenPDF | ( | const wxString & | file | ) |
Run the PDF viewer and display a PDF file.
file | the PDF file to open. |
Definition at line 223 of file gestfich.cpp.
References _, DisplayError(), LaunchExternal(), and Pgm().
Referenced by PROJECT_TREE_ITEM::Activate(), and GetAssociatedDocument().
wxString QuoteFullPath | ( | wxFileName & | fn, |
wxPathFormat | format = wxPATH_NATIVE |
||
) |
Quote return value of wxFileName::GetFullPath().
This allows file name paths with spaces to be used as parameters to ProcessExecute function calls.
fn | is the filename to wrap. |
format | if provided, can be used to transform the nature of the wrapped filename to another platform. |
Definition at line 293 of file gestfich.cpp.
void QuoteString | ( | wxString & | string | ) |
Add un " to the start and the end of string (if not already done).
string | string to modify. |
Definition at line 45 of file gestfich.cpp.
bool RmDirRecursive | ( | const wxString & | aDirName, |
wxString * | aErrors = nullptr |
||
) |
Removes the directory aDirName and all its contents including subdirectories and their files.
Definition at line 299 of file gestfich.cpp.
Referenced by PROJECT_TREE_PANE::onGitRemoveVCS(), and DIALOG_GIT_REPOSITORY::~DIALOG_GIT_REPOSITORY().