c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp
author František Kučera <franta-hg@frantovo.cz>
Mon, 04 May 2015 00:29:17 +0200
changeset 14 d81d0a119e76
parent 12 fde958908539
child 16 65f51abd5fb8
permissions -rw-r--r--
use ostream from module arguments instead of std:cout
     1 #include <algorithm>
     2 
     3 #include "OutputModule.h"
     4 #include "terminalCodes/TerminalCodes.h"
     5 
     6 namespace info {
     7 namespace globalcode {
     8 namespace parameterLister {
     9 
    10 void OutputModule::process(std::ostream &output, std::string &command, std::vector<std::string> &args) {
    11 	terminalCodes::Modifier fgGreen(terminalCodes::FG_GREEN);
    12 	terminalCodes::Modifier fgReset(terminalCodes::FG_DEFAULT);
    13 
    14 	using namespace std;
    15 
    16 	output << "<outputModule>" << 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 << "</outputModule>" << endl;
    23 }
    24 
    25 
    26 }
    27 }
    28 }
    29