use ostream from module arguments instead of std:cout
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 04 May 2015 00:29:17 +0200
changeset 14d81d0a119e76
parent 13 9180ee5128c5
child 15 09adb33465e4
use ostream from module arguments instead of std:cout
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	Mon May 04 00:28:47 2015 +0200
     1.2 +++ b/c++/parameter-lister/info/globalcode/parameterLister/OutputModule.cpp	Mon May 04 00:29:17 2015 +0200
     1.3 @@ -15,10 +15,10 @@
     1.4  
     1.5  	output << "<outputModule>" << endl;
     1.6  
     1.7 -	for_each(args.begin(), args.end(), [command, fgGreen, fgReset](string s) {
     1.8 -		cout << fgGreen << command << fgReset << ": " << s << endl;
     1.9 +	for_each(args.begin(), args.end(), [&output, command, fgGreen, fgReset](string s) {
    1.10 +		output << fgGreen << command << fgReset << ": " << s << endl;
    1.11  	});
    1.12 -	
    1.13 +
    1.14  	output << "</outputModule>" << endl;
    1.15  }
    1.16  
     2.1 --- a/c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.cpp	Mon May 04 00:28:47 2015 +0200
     2.2 +++ b/c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.cpp	Mon May 04 00:29:17 2015 +0200
     2.3 @@ -10,7 +10,7 @@
     2.4  	
     2.5  	for (int i = 0; i < args.size(); i++) {
     2.6  		string s = args[i];
     2.7 -		cout << i + 1 << ":" << s.length() << " = \"" << s << "\"" << endl;
     2.8 +		output << i + 1 << ":" << s.length() << " = \"" << s << "\"" << endl;
     2.9  	}
    2.10  	
    2.11  	output << "</terminalOutputModule>" << endl;