Command.h
branchv_0
changeset 11 3798b6bc9aea
child 24 c31fdd965028
equal deleted inserted replaced
10:77593735b057 11:3798b6bc9aea
       
     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 }