c++/parameter-lister/info/globalcode/parameterLister/terminalCodes/TerminalCodes.h
changeset 5 1581a99ab33f
parent 3 a6b5eb87350b
child 11 870b868b6b57
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/c++/parameter-lister/info/globalcode/parameterLister/terminalCodes/TerminalCodes.h	Sun May 03 18:08:40 2015 +0200
     1.3 @@ -0,0 +1,41 @@
     1.4 +#ifndef COLORZ_H
     1.5 +#define	COLORZ_H
     1.6 +
     1.7 +#include <ostream>
     1.8 +
     1.9 +namespace info {
    1.10 +namespace globalcode {
    1.11 +namespace parameterLister {
    1.12 +namespace terminalCodes {
    1.13 +
    1.14 +enum Code {
    1.15 +	FG_RED = 31,
    1.16 +	FG_GREEN = 32,
    1.17 +	FG_BLUE = 34,
    1.18 +	FG_DEFAULT = 39,
    1.19 +	BG_RED = 41,
    1.20 +	BG_GREEN = 42,
    1.21 +	BG_BLUE = 44,
    1.22 +	BG_DEFAULT = 49
    1.23 +};
    1.24 +
    1.25 +class Modifier {
    1.26 +	Code code;
    1.27 +public:
    1.28 +
    1.29 +	Modifier(Code code) : code(code) {
    1.30 +	}
    1.31 +
    1.32 +	friend std::ostream&
    1.33 +	operator<<(std::ostream& os, const Modifier& mod) {
    1.34 +		return os << "\033[" << mod.code << "m";
    1.35 +	}
    1.36 +};
    1.37 +
    1.38 +}
    1.39 +}
    1.40 +}
    1.41 +}
    1.42 +
    1.43 +#endif	/* COLORZ_H */
    1.44 +