c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.cpp
author František Kučera <franta-hg@frantovo.cz>
Sun, 11 Sep 2016 00:00:21 +0200
changeset 26 6e5c4e267ddb
parent 20 0684883953ba
child 28 bfef9f34e438
permissions -rw-r--r--
c++: some colors + start script
     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(), [this, &output, command, fgGreen, fgReset](string s) {
    19 		output << fgGreen << colorize(RED, command) << fgReset << ": " << escapeValue(s, true) << endl;
    20 	});
    21 	
    22 	output << fgGreen << "<<< terminalOutputModule" << fgReset << endl;
    23 	
    24 	return 0;
    25 }
    26 
    27 }
    28 }
    29 }
    30