c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.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 "TerminalOutputModule.h"
     2 #include "terminalCodes/TerminalCodes.h"
     3 
     4 namespace info {
     5 namespace globalcode {
     6 namespace parameterLister {
     7 
     8 int TerminalOutputModule::process(std::ostream &output, std::string &command, std::vector<std::string> &args) {
     9 	using namespace std;
    10 	
    11 	terminalCodes::Modifier fgGreen(terminalCodes::FG_GREEN);
    12 	terminalCodes::Modifier fgReset(terminalCodes::FG_DEFAULT);
    13 	
    14 	output << fgGreen << "<terminalOutputModule>" << fgReset << endl;
    15 	
    16 	for (int i = 0; i < args.size(); i++) {
    17 		string s = args[i];
    18 		output << i + 1 << ":" << s.length() << " = \"" << s << "\"" << endl;
    19 	}
    20 	
    21 	output << fgGreen << "</terminalOutputModule>" << fgReset << endl;
    22 	
    23 	return 0;
    24 }
    25 
    26 }
    27 }
    28 }
    29