26 lines
858 B
C++
26 lines
858 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <variant>
|
|
#include <unordered_map>
|
|
|
|
#include <rapidjson/document.h>
|
|
|
|
#include "Task.hpp"
|
|
|
|
namespace rj = rapidjson;
|
|
|
|
namespace daggy {
|
|
using ParameterValue = std::variant<std::string, std::vector<std::string>>;
|
|
using ParameterValues = std::unordered_map<std::string, ParameterValue>;
|
|
using Command = std::vector<std::string>;
|
|
|
|
ParameterValues parseParameters(const std::string & jsonSpec);
|
|
ParameterValues parseParameters(const rj::Document & spec);
|
|
std::vector<Task> buildTasks(const std::string & jsonSpec, const ParameterValues & parameters = {});
|
|
std::vector<Task> buildTasks(const rj::Document & spec, const ParameterValues & parameters = {});
|
|
|
|
std::vector<Command> expandCommands(const std::vector<std::string> & command, const ParameterValues & parameters);
|
|
}
|