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
21
#include <
jobs/jobs_output_folder.h
>
22
#include <wx/filename.h>
23
#include <
gestfich.h
>
24
25
JOBS_OUTPUT_FOLDER::JOBS_OUTPUT_FOLDER
() :
26
JOBS_OUTPUT_HANDLER
()
27
{
28
29
}
30
31
32
bool
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
52
void
JOBS_OUTPUT_FOLDER::FromJson
(
const
nlohmann::json& j )
53
{
54
m_outputPath
= j.value(
"output_path"
,
""
);
55
}
56
57
58
void
JOBS_OUTPUT_FOLDER::ToJson
( nlohmann::json& j )
const
59
{
60
j[
"output_path"
] =
m_outputPath
;
61
}
JOBS_OUTPUT_FOLDER::JOBS_OUTPUT_FOLDER
JOBS_OUTPUT_FOLDER()
Definition:
jobs_output_folder.cpp:25
JOBS_OUTPUT_FOLDER::FromJson
void FromJson(const nlohmann::json &j) override
Definition:
jobs_output_folder.cpp:52
JOBS_OUTPUT_FOLDER::ToJson
void ToJson(nlohmann::json &j) const override
Definition:
jobs_output_folder.cpp:58
JOBS_OUTPUT_FOLDER::HandleOutputs
bool HandleOutputs(const wxString &baseTempPath, const std::vector< JOB_OUTPUT > &aOutputsToHandle) override
Definition:
jobs_output_folder.cpp:32
JOBS_OUTPUT_HANDLER
Definition:
jobs_output.h:28
JOBS_OUTPUT_HANDLER::m_outputPath
wxString m_outputPath
Definition:
jobs_output.h:47
CopyDirectory
bool CopyDirectory(const wxString &aSourceDir, const wxString &aDestDir, wxString &aErrors)
Copy a directory and its contents to another directory.
Definition:
gestfich.cpp:377
gestfich.h
jobs_output_folder.h
src
common
jobs
jobs_output_folder.cpp
Generated on Fri Nov 22 2024 00:04:48 for KiCad PCB EDA Suite by
1.9.6