27#include <wx/filename.h>
28#include <wx/process.h>
29#include <wx/zipstrm.h>
35#define UNIX_STRING_DIR_SEP wxT( "/" )
36#define WIN_STRING_DIR_SEP wxT( "\\" )
67 std::function<
bool(
const std::string& token, wxString& value )> aCallback,
81 const wxString& aFileName = wxEmptyString,
82 wxProcess* aCallback =
nullptr,
bool aFileForKicad =
true );
130 const std::vector<wxString>& aOverwriteExclusions, wxString& aErrors );
133 wxString& aErrors, std::vector<wxString>& aPathsWritten );
144 const wxString& aParentDir =
"" );
163 const wxString& aFileSpec = wxEmptyString,
164 int aFlags = wxDIR_DEFAULT );
178 int aFlags = wxDIR_DIRS );
KICOMMON_API bool CopyFilesOrDirectory(const wxString &aSourceDir, const wxString &aDestDir, bool aAllowOverwrite, wxString &aErrors, std::vector< wxString > &aPathsWritten)
KICOMMON_API wxString QuoteFullPath(wxFileName &fn, wxPathFormat format=wxPATH_NATIVE)
Quote return value of wxFileName::GetFullPath().
KICOMMON_API bool CopyDirectory(const wxString &aSourceDir, const wxString &aDestDir, const std::vector< wxString > &aOverwriteExclusions, wxString &aErrors)
Copy a directory and its contents to another directory.
KICOMMON_API void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
KICOMMON_API bool OpenPDF(const wxString &file)
Run the PDF viewer and display a PDF file.
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 short...
KICOMMON_API void CollectSubdirsLoopSafe(const wxString &aRoot, wxArrayString &aDirs, int aFlags=wxDIR_DIRS)
Recursively collect every subdirectory under aRoot using the same loop detection as CollectFilesLoopS...
KICOMMON_API void CollectFilesLoopSafe(const wxString &aRoot, wxArrayString &aFiles, const wxString &aFileSpec=wxEmptyString, int aFlags=wxDIR_DEFAULT)
Recursively collect every file under aRoot, deduplicating subdirectories by their resolved path.
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 void CopySexprFile(const wxString &aSrcPath, const wxString &aDestPath, std::function< bool(const std::string &token, wxString &value)> aCallback, 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 bool AddDirectoryToZip(wxZipOutputStream &aZip, const wxString &aSourceDir, wxString &aErrors, const wxString &aParentDir="")
Add a directory and its contents to a zip file.