35 virtual void FromJson(
const nlohmann::json& j )
const = 0;
37 virtual void ToJson( nlohmann::json& j ) = 0;
43template <
typename ValueType>
48 JOB_PARAM(
const std::string& aJsonPath, ValueType* aPtr,
49 ValueType aDefault ) :
54 virtual void FromJson(
const nlohmann::json& j )
const override
70 JOB_OUTPUT( wxString outputPath ) { m_outputPath = outputPath; }
81 JOB(
const std::string& aType,
bool aOutputIsDirectory );
85 const std::string&
GetType()
const {
return m_type; };
87 const std::map<wxString, wxString>&
GetVarOverrides()
const {
return m_varOverrides; }
91 m_varOverrides = aVarOverrides;
94 virtual void FromJson(
const nlohmann::json& j );
95 virtual void ToJson( nlohmann::json& j )
const;
97 virtual wxString GetDescription();
112 m_outputs.emplace_back( aOutputPath );
115 void SetTempOutputDirectory(
const wxString& aBase );
118 void SetOutputPath(
const wxString& aPath );
120 wxString GetFullOutputPath()
const;
122 bool OutputPathFullSpecified()
const;
virtual void ToJson(nlohmann::json &j)=0
virtual void FromJson(const nlohmann::json &j) const =0
virtual ~JOB_PARAM_BASE()=default
JOB_PARAM(const std::string &aJsonPath, ValueType *aPtr, ValueType aDefault)
virtual void ToJson(nlohmann::json &j) override
virtual void FromJson(const nlohmann::json &j) const override
An simple container class that lets us dispatch output jobs to kifaces.
void SetVarOverrides(const std::map< wxString, wxString > &aVarOverrides)
std::vector< JOB_PARAM_BASE * > m_params
const std::vector< JOB_OUTPUT > & GetOutputs()
void AddOutput(wxString aOutputPath)
const std::vector< JOB_PARAM_BASE * > & GetParams()
wxString m_tempOutputDirectory
std::vector< JOB_OUTPUT > m_outputs
bool m_outputPathIsDirectory
const std::string & GetType() const
std::map< wxString, wxString > m_varOverrides
const std::map< wxString, wxString > & GetVarOverrides() const
wxString GetOutputPath() const
void ClearExistingOutputs()
KICOMMON_API void to_json(nlohmann::json &j, const JOB &f)
KICOMMON_API void from_json(const nlohmann::json &j, JOB &f)
JOB_OUTPUT(wxString outputPath)