c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.cpp
author František Kučera <franta-hg@frantovo.cz>
Tue, 05 May 2015 22:27:59 +0200
changeset 18 25a73772efbd
parent 16 65f51abd5fb8
child 20 0684883953ba
permissions -rw-r--r--
swap output module logic
     1 #include <algorithm>
     2 
     3 #include "TerminalOutputModule.h"
     4 #include "terminalCodes/TerminalCodes.h"
     5 
     6 namespace info {
     7 namespace globalcode {
     8 namespace parameterLister {
     9 
    10 int TerminalOutputModule::process(std::ostream &output, std::string &command, std::vector<std::string> &args) {
    11 	using namespace std;
    12 	
    13 	terminalCodes::Modifier fgGreen(terminalCodes::FG_GREEN);
    14 	terminalCodes::Modifier fgReset(terminalCodes::FG_DEFAULT);
    15 	
    16 	output << fgGreen << "<terminalOutputModule>" << fgReset << endl;
    17 	
    18 	for_each(args.begin(), args.end(), [&output, command, fgGreen, fgReset](string s) {
    19 		output << fgGreen << command << fgReset << ": " << s << endl;
    20 	});
    21 	
    22 	output << fgGreen << "</terminalOutputModule>" << fgReset << endl;
    23 	
    24 	return 0;
    25 }
    26 
    27 }
    28 }
    29 }
    30