c++/parameter-lister/info/globalcode/parameterLister/TerminalOutputModule.h
author František Kučera <franta-hg@frantovo.cz>
Sun, 11 Sep 2016 00:00:21 +0200
changeset 26 6e5c4e267ddb
parent 16 65f51abd5fb8
child 28 bfef9f34e438
permissions -rw-r--r--
c++: some colors + start script
     1 #ifndef TERMINALOUTPUTMODULE_H
     2 #define TERMINALOUTPUTMODULE_H
     3 
     4 #include <iostream>
     5 #include <sstream>
     6 
     7 #include "OutputModule.h"
     8 
     9 namespace info {
    10 namespace globalcode {
    11 namespace parameterLister {
    12 
    13 using namespace std;
    14 
    15 class TerminalOutputModule : public OutputModule {
    16 public:
    17 	virtual int process(ostream &output, string &command, vector<string> &args);
    18 private:
    19 
    20 	const int RED = 31;
    21 	const int GREEN = 32;
    22 	const int BLUE = 34;
    23 
    24 	string colorize(int foreground, string text) {
    25 		//return "\033[" + "32" + "m" + text + "\033[39m";
    26 		ostringstream fgStream;
    27 		fgStream << foreground;
    28 		return "\033[" + fgStream.str() + "m" + text + "\033[39m";
    29 	}
    30 
    31 	// tabulky: http://www.rubydoc.info/gems/terminal-table/1.4.2/frames
    32 };
    33 
    34 }
    35 }
    36 }
    37 
    38 #endif /* TERMINALOUTPUTMODULE_H */
    39