equal
deleted
inserted
replaced
|
1 #pragma once |
|
2 |
|
3 #include <cstdlib> |
|
4 #include <iostream> |
|
5 #include <string> |
|
6 #include <vector> |
|
7 #include <algorithm> |
|
8 |
|
9 |
|
10 namespace relpipe { |
|
11 namespace in { |
|
12 namespace cli { |
|
13 |
|
14 class Command { |
|
15 public: |
|
16 virtual ~Command() = default; |
|
17 |
|
18 /** |
|
19 * Processes the inputs (stream + arguments) and generates output in the relational pipes format. |
|
20 * |
|
21 * @param input usually STDIN, may not be used if all data are passed as CLI arguments |
|
22 * @param output usually STDOUT, relational data is passed here |
|
23 * @param command command name, usualy not needed, may be significant if the same Command instance is used for several commands |
|
24 * @param arguments CLI arguments containing data or parameters (format is specific to each command) |
|
25 */ |
|
26 virtual void process(std::istream& input, std::ostream& output, const relpipe::writer::string_t& command, const std::vector<relpipe::writer::string_t> &arguments) = 0; |
|
27 |
|
28 }; |
|
29 |
|
30 } |
|
31 } |
|
32 } |