KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gestfich.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 (C) 2009-2014 Jerry Jacobs
5 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#pragma once
26
27#include <map>
28#include <kicommon.h>
29#include <wx/filename.h>
30#include <wx/process.h>
31#include <wx/zipstrm.h>
32
33
37#define UNIX_STRING_DIR_SEP wxT( "/" )
38#define WIN_STRING_DIR_SEP wxT( "\\" )
39
40/* Forward class declarations. */
41class EDA_LIST_DIALOG;
42
43
51KICOMMON_API bool OpenPDF( const wxString& file );
52
58KICOMMON_API void KiCopyFile( const wxString& aSrcPath, const wxString& aDestPath,
59 wxString& aErrors );
60
68KICOMMON_API void CopySexprFile( const wxString& aSrcPath, const wxString& aDestPath,
69 std::function<bool( const std::string& token, wxString& value )> aCallback,
70 wxString& aErrors );
71
82KICOMMON_API int ExecuteFile( const wxString& aEditorName,
83 const wxString& aFileName = wxEmptyString,
84 wxProcess* aCallback = nullptr, bool aFileForKicad = true );
85
91KICOMMON_API void QuoteString( wxString& string );
92
103KICOMMON_API wxString FindKicadFile( const wxString& shortname );
104
115KICOMMON_API extern wxString QuoteFullPath( wxFileName& fn, wxPathFormat format = wxPATH_NATIVE );
116
117
122KICOMMON_API bool RmDirRecursive( const wxString& aDirName, wxString* aErrors = nullptr );
123
131KICOMMON_API bool CopyDirectory( const wxString& aSourceDir, const wxString& aDestDir, wxString& aErrors );
132
133KICOMMON_API bool CopyFilesOrDirectory( const wxString& aSourceDir, const wxString& aDestDir, wxString& aErrors,
134 int& fileCopiedCount, const std::vector<wxString>& aExclusions );
135
144KICOMMON_API bool AddDirectoryToZip( wxZipOutputStream& aZip, const wxString& aSourceDir, wxString& aErrors,
145 const wxString& aParentDir = "" );
A dialog which shows:
KICOMMON_API bool CopyFilesOrDirectory(const wxString &aSourceDir, const wxString &aDestDir, wxString &aErrors, int &fileCopiedCount, const std::vector< wxString > &aExclusions)
Definition gestfich.cpp:486
KICOMMON_API wxString QuoteFullPath(wxFileName &fn, wxPathFormat format=wxPATH_NATIVE)
Quote return value of wxFileName::GetFullPath().
Definition gestfich.cpp:380
KICOMMON_API void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
Definition gestfich.cpp:292
KICOMMON_API bool OpenPDF(const wxString &file)
Run the PDF viewer and display a PDF file.
Definition gestfich.cpp:256
KICOMMON_API void QuoteString(wxString &string)
Add un " to the start and the end of string (if not already done).
Definition gestfich.cpp:50
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...
Definition gestfich.cpp:60
KICOMMON_API bool RmDirRecursive(const wxString &aDirName, wxString *aErrors=nullptr)
Remove the directory aDirName and all its contents including subdirectories and their files.
Definition gestfich.cpp:386
KICOMMON_API void CopySexprFile(const wxString &aSrcPath, const wxString &aDestPath, std::function< bool(const std::string &token, wxString &value)> aCallback, wxString &aErrors)
Definition gestfich.cpp:319
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.
Definition gestfich.cpp:145
KICOMMON_API bool CopyDirectory(const wxString &aSourceDir, const wxString &aDestDir, wxString &aErrors)
Copy a directory and its contents to another directory.
Definition gestfich.cpp:435
KICOMMON_API bool AddDirectoryToZip(wxZipOutputStream &aZip, const wxString &aSourceDir, wxString &aErrors, const wxString &aParentDir="")
Add a directory and its contents to a zip file.
Definition gestfich.cpp:622
#define KICOMMON_API
Definition kicommon.h:28