c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp
author František Kučera <franta-hg@frantovo.cz>
Tue, 05 May 2015 22:19:24 +0200
changeset 16 65f51abd5fb8
parent 14 d81d0a119e76
child 18 25a73772efbd
permissions -rw-r--r--
chooseOutputModule
     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 int 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 	return 0;
    25 }
    26 
    27 
    28 }
    29 }
    30 }
    31