|
KiCad PCB EDA Suite
|
Go to the source code of this file.
Macros | |
| #define | UNIX_STRING_DIR_SEP wxT( "/" ) |
| #define | WIN_STRING_DIR_SEP wxT( "\\" ) |
Functions | |
| KICOMMON_API bool | OpenPDF (const wxString &file) |
| Run the PDF viewer and display a PDF file. | |
| KICOMMON_API void | KiCopyFile (const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors) |
| KICOMMON_API int | ExecuteFile (const wxString &aEditorName, const wxString &aFileName=wxEmptyString, wxProcess *aCallback=nullptr, bool aFileForKicad=true) |
| Call the executable file aEditorName with the parameter aFileName. | |
| KICOMMON_API void | QuoteString (wxString &string) |
| Add un " to the start and the end of string (if not already done). | |
| KICOMMON_API 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. | |
| KICOMMON_API wxString | QuoteFullPath (wxFileName &fn, wxPathFormat format=wxPATH_NATIVE) |
| Quote return value of wxFileName::GetFullPath(). | |
| KICOMMON_API bool | RmDirRecursive (const wxString &aDirName, wxString *aErrors=nullptr) |
| Remove the directory aDirName and all its contents including subdirectories and their files. | |
| KICOMMON_API bool | CopyDirectory (const wxString &aSourceDir, const wxString &aDestDir, wxString &aErrors) |
| Copy a directory and its contents to another directory. | |
| KICOMMON_API bool | CopyFilesOrDirectory (const wxString &aSourceDir, const wxString &aDestDir, wxString &aErrors, int &fileCopiedCount, const std::vector< wxString > &aExclusions) |
| KICOMMON_API bool | AddDirectoryToZip (wxZipOutputStream &aZip, const wxString &aSourceDir, wxString &aErrors, const wxString &aParentDir="") |
| Add a directory and its contents to a zip file. | |
| #define UNIX_STRING_DIR_SEP wxT( "/" ) |
Definition at line 37 of file gestfich.h.
Referenced by GetAssociatedDocument(), PGM_BASE::InitPgm(), and PCB_EDIT_FRAME::OpenProjectFiles().
| #define WIN_STRING_DIR_SEP wxT( "\\" ) |
Definition at line 38 of file gestfich.h.
Referenced by GetAssociatedDocument(), PGM_BASE::InitPgm(), and PCB_EDIT_FRAME::OpenProjectFiles().
| KICOMMON_API bool AddDirectoryToZip | ( | wxZipOutputStream & | aZip, |
| const wxString & | aSourceDir, | ||
| wxString & | aErrors, | ||
| const wxString & | aParentDir = "" ) |
Add a directory and its contents to a zip file.
| aZip | is the zip file to add to. |
| aSourceDir | is the directory to add. |
| aErrors | is a string to append any errors to. |
| aParentDir | is the parent directory to add to the zip file. |
Definition at line 547 of file gestfich.cpp.
References _, and AddDirectoryToZip().
Referenced by AddDirectoryToZip(), and JOBS_OUTPUT_ARCHIVE::HandleOutputs().
| KICOMMON_API bool CopyDirectory | ( | const wxString & | aSourceDir, |
| const wxString & | aDestDir, | ||
| wxString & | aErrors ) |
Copy a directory and its contents to another directory.
| aSourceDir | is the directory to copy. |
| aDestDir | is the directory to copy to. |
| aErrors | is a string to append any errors to. |
Definition at line 360 of file gestfich.cpp.
References _, and CopyDirectory().
Referenced by CopyDirectory(), and JOBS_OUTPUT_FOLDER::HandleOutputs().
| KICOMMON_API bool CopyFilesOrDirectory | ( | const wxString & | aSourceDir, |
| const wxString & | aDestDir, | ||
| wxString & | aErrors, | ||
| int & | fileCopiedCount, | ||
| const std::vector< wxString > & | aExclusions ) |
Definition at line 411 of file gestfich.cpp.
References _, and CopyFilesOrDirectory().
Referenced by CopyFilesOrDirectory(), and JOBS_RUNNER::runSpecialCopyFiles().
| KICOMMON_API int ExecuteFile | ( | const wxString & | aEditorName, |
| const wxString & | aFileName = wxEmptyString, | ||
| wxProcess * | aCallback = nullptr, | ||
| bool | aFileForKicad = true ) |
Call the executable file aEditorName with the parameter aFileName.
| [in] | aEditorName | is the full filename for the binary. |
| [in] | aFileName | is the full filename of the file to open. |
| [in] | aCallback | a wxProcess* for the call. |
| aFileForKicad | a boolean to flag if aFileName runs with a KiCad binary. In this case aFileName is a shortname and FindKicadFile() is called to return the path. In the other case, aFileName is a full file name (passed prefixed with the path). |
Definition at line 143 of file gestfich.cpp.
References _, DisplayErrorMessage(), and FindKicadFile().
Referenced by COMMON_CONTROL::Execute(), DIALOG_CONFIG_EQUFILES::OnEditEquFile(), DIALOG_BOM::OnEditGenerator(), SCH_EDIT_FRAME::OnOpenPcbnew(), PROJECT_TREE_PANE::onOpenSelectedFileWithTextEditor(), FOOTPRINT_EDITOR_CONTROL::OpenWithTextEditor(), SYMBOL_EDITOR_CONTROL::OpenWithTextEditor(), BOARD_EDITOR_CONTROL::ShowEeschema(), and GERBVIEW_INSPECTION_TOOL::ShowSource().
| KICOMMON_API 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 58 of file gestfich.cpp.
References arrayDim(), PGM_BASE::GetExecutablePath(), PGM_BASE::GetKicadEnvVariable(), and Pgm().
Referenced by KICAD_MANAGER_FRAME::DoWithAcceptedFiles(), ExecuteFile(), API_HANDLER_COMMON::handleGetKiCadBinaryPath(), API_PLUGIN_MANAGER::InvokeAction(), and API_PLUGIN_MANAGER::processNextJob().
| KICOMMON_API void KiCopyFile | ( | const wxString & | aSrcPath, |
| const wxString & | aDestPath, | ||
| wxString & | aErrors ) |
| aSrcPath | is the full filename of the source. | |
| [in] | aDestPath | is the full filename of the target. |
| [out] | aErrors | a wxString to append any errors to. |
Definition at line 290 of file gestfich.cpp.
References _.
Referenced by MIGRATION_TRAVERSER::OnFile(), PROJECT_TREE_TRAVERSER::OnFile(), GERBV::IFACE::SaveFileAs(), PCB::IFACE::SaveFileAs(), PGE::IFACE::SaveFileAs(), SCH::IFACE::SaveFileAs(), PCB_EDIT_FRAME::SavePcbCopy(), and PCB_EDIT_FRAME::SavePcbFile().
| KICOMMON_API bool OpenPDF | ( | const wxString & | file | ) |
Run the PDF viewer and display a PDF file.
| file | the PDF file to open. |
| true | if PDF viewer found. |
| false | if no PDF viewer found. |
Definition at line 254 of file gestfich.cpp.
References _, DisplayErrorMessage(), PGM_BASE::GetPdfBrowserName(), LaunchExternal(), Pgm(), and PGM_BASE::ReadPdfBrowserInfos().
Referenced by PROJECT_TREE_ITEM::Activate(), and GetAssociatedDocument().
|
extern |
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 305 of file gestfich.cpp.
| KICOMMON_API 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 48 of file gestfich.cpp.
| KICOMMON_API bool RmDirRecursive | ( | const wxString & | aDirName, |
| wxString * | aErrors = nullptr ) |
Remove the directory aDirName and all its contents including subdirectories and their files.
Definition at line 311 of file gestfich.cpp.
Referenced by LIBGIT_BACKEND::RemoveVCS(), and DIALOG_GIT_REPOSITORY::~DIALOG_GIT_REPOSITORY().