KiCad PCB EDA Suite
Loading...
Searching...
No Matches
jobs_output_folder.cpp
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) 2024 Mark Roszko <[email protected]>
5 * Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
22#include <wx/filename.h>
23#include <gestfich.h>
24
27{
28
29}
30
31
32bool JOBS_OUTPUT_FOLDER::HandleOutputs( const wxString& baseTempPath,
33 const std::vector<JOB_OUTPUT>& aOutputsToHandle )
34{
35 bool success = true;
36 if( !wxFileName::Mkdir( m_outputPath, wxS_DIR_DEFAULT ) )
37 {
38 return false;
39 }
40
41 wxString errors;
42 if( !CopyDirectory( baseTempPath, m_outputPath, errors ) )
43 {
44 success = false;
45 }
46
47 return success;
48
49}
50
51
52void JOBS_OUTPUT_FOLDER::FromJson( const nlohmann::json& j )
53{
54 m_outputPath = j.value( "output_path", "" );
55}
56
57
58void JOBS_OUTPUT_FOLDER::ToJson( nlohmann::json& j ) const
59{
60 j["output_path"] = m_outputPath;
61}
void FromJson(const nlohmann::json &j) override
void ToJson(nlohmann::json &j) const override
bool HandleOutputs(const wxString &baseTempPath, const std::vector< JOB_OUTPUT > &aOutputsToHandle) override
wxString m_outputPath
Definition: jobs_output.h:47
bool CopyDirectory(const wxString &aSourceDir, const wxString &aDestDir, wxString &aErrors)
Copy a directory and its contents to another directory.
Definition: gestfich.cpp:377