swap output module logic
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 05 May 2015 22:27:59 +0200
changeset 1825a73772efbd
parent 17 6d5ee720386c
child 19 48a3c9c50937
swap output module logic
c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp
c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.cpp
     1.1 --- a/c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp	Tue May 05 22:21:20 2015 +0200
     1.2 +++ b/c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp	Tue May 05 22:27:59 2015 +0200
     1.3 @@ -1,5 +1,3 @@
     1.4 -#include <algorithm>
     1.5 -
     1.6  #include "OutputModule.h"
     1.7  #include "terminalCodes/TerminalCodes.h"
     1.8  
     1.9 @@ -15,9 +13,10 @@
    1.10  
    1.11  	output << "<outputModule>" << endl;
    1.12  
    1.13 -	for_each(args.begin(), args.end(), [&output, command, fgGreen, fgReset](string s) {
    1.14 -		output << fgGreen << command << fgReset << ": " << s << endl;
    1.15 -	});
    1.16 +	for (int i = 0; i < args.size(); i++) {
    1.17 +		string s = args[i];
    1.18 +		output << i + 1 << ":" << s.length() << " = \"" << s << "\"" << endl;
    1.19 +	}
    1.20  
    1.21  	output << "</outputModule>" << endl;
    1.22  	
     2.1 --- a/c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.cpp	Tue May 05 22:21:20 2015 +0200
     2.2 +++ b/c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.cpp	Tue May 05 22:27:59 2015 +0200
     2.3 @@ -1,3 +1,5 @@
     2.4 +#include <algorithm>
     2.5 +
     2.6  #include "TerminalOutputModule.h"
     2.7  #include "terminalCodes/TerminalCodes.h"
     2.8  
     2.9 @@ -13,10 +15,9 @@
    2.10  	
    2.11  	output << fgGreen << "<terminalOutputModule>" << fgReset << endl;
    2.12  	
    2.13 -	for (int i = 0; i < args.size(); i++) {
    2.14 -		string s = args[i];
    2.15 -		output << i + 1 << ":" << s.length() << " = \"" << s << "\"" << endl;
    2.16 -	}
    2.17 +	for_each(args.begin(), args.end(), [&output, command, fgGreen, fgReset](string s) {
    2.18 +		output << fgGreen << command << fgReset << ": " << s << endl;
    2.19 +	});
    2.20  	
    2.21  	output << fgGreen << "</terminalOutputModule>" << fgReset << endl;
    2.22