From f622661da16d5724a778f87c5be46fe9be8a6412 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 12 Jun 2019 20:08:03 +0300 Subject: [PATCH] Add a statement to specify multiple arguments at once for a generator --- source/sourcegenerator.cpp | 6 ++++++ source/sourcegenerator.h | 1 + 2 files changed, 7 insertions(+) diff --git a/source/sourcegenerator.cpp b/source/sourcegenerator.cpp index c7a4f92..5123f09 100644 --- a/source/sourcegenerator.cpp +++ b/source/sourcegenerator.cpp @@ -88,6 +88,7 @@ SourceGenerator::Loader::Loader(SourceGenerator &sg): ConditionalLoader(sg.package, format("%s/%s", sg.package.get_name(), sg.tag)) { add("argument", &Loader::argument); + add("arguments", &Loader::arguments); add("command", &Loader::command); add("in_suffix", &Loader::in_suffix); add("out_argument", &SourceGenerator::out_argument); @@ -100,6 +101,11 @@ void SourceGenerator::Loader::argument(const string &a) obj.arguments.push_back(a); } +void SourceGenerator::Loader::arguments(const vector &a) +{ + obj.arguments.insert(obj.arguments.end(), a.begin(), a.end()); +} + void SourceGenerator::Loader::command(const string &c) { if(c.find('/')!=string::npos) diff --git a/source/sourcegenerator.h b/source/sourcegenerator.h index 69a4180..b0c8d4b 100644 --- a/source/sourcegenerator.h +++ b/source/sourcegenerator.h @@ -16,6 +16,7 @@ public: private: void argument(const std::string &); + void arguments(const std::vector &); void command(const std::string &); void in_suffix(const std::string &); void out_argument(const std::string &); -- 2.45.2