c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp
author František Kučera <franta-hg@frantovo.cz>
Mon, 04 May 2015 00:12:33 +0200
changeset 11 870b868b6b57
parent 9 598a575ae57f
child 12 fde958908539
permissions -rw-r--r--
move formatting logic to output modules
     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 OutputModule::OutputModule() {
    11 }
    12 
    13 OutputModule::OutputModule(const OutputModule& orig) {
    14 }
    15 
    16 OutputModule::~OutputModule() {
    17 }
    18 
    19 void OutputModule::process(std::ostream &output, std::string &command, std::vector<std::string> &args) {
    20 	terminalCodes::Modifier fgGreen(terminalCodes::FG_GREEN);
    21 	terminalCodes::Modifier fgReset(terminalCodes::FG_DEFAULT);
    22 
    23 	using namespace std;
    24 
    25 	output << "<outputModule>" << endl;
    26 
    27 	for_each(args.begin(), args.end(), [command, fgGreen, fgReset](string s) {
    28 		cout << fgGreen << command << fgReset << ": " << s << endl;
    29 	});
    30 	
    31 	output << "</outputModule>" << endl;
    32 }
    33 
    34 
    35 }
    36 }
    37 }
    38