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