c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp
author František Kučera <franta-hg@frantovo.cz>
Tue, 05 May 2015 22:27:59 +0200
changeset 18 25a73772efbd
parent 16 65f51abd5fb8
child 19 48a3c9c50937
permissions -rw-r--r--
swap output module logic
     1 #include "OutputModule.h"
     2 #include "terminalCodes/TerminalCodes.h"
     3 
     4 namespace info {
     5 namespace globalcode {
     6 namespace parameterLister {
     7 
     8 int OutputModule::process(std::ostream &output, std::string &command, std::vector<std::string> &args) {
     9 	terminalCodes::Modifier fgGreen(terminalCodes::FG_GREEN);
    10 	terminalCodes::Modifier fgReset(terminalCodes::FG_DEFAULT);
    11 
    12 	using namespace std;
    13 
    14 	output << "<outputModule>" << 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 << "</outputModule>" << endl;
    22 	
    23 	return 0;
    24 }
    25 
    26 
    27 }
    28 }
    29 }
    30