diff -r 000000000000 -r 03757ff74694 c++/ukazatele/barvicky.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c++/ukazatele/barvicky.cpp Sat Nov 19 22:29:10 2016 +0100 @@ -0,0 +1,29 @@ +#include +#include + +using namespace std; + +string obarvi (string text, int barva) { + string zacatek; + string konec; + + switch (barva) { + case BARVA_ZELENA : + zacatek = string("\033[22;32m"); + konec = string("\033[0m"); + break; + case BARVA_CERVENA : + zacatek = string("\033[22;31m"); + konec = string("\033[0m"); + break; + dafault: + zacatek = (""); + konec = (""); + } + + return zacatek + text + konec; +} + +string obarvi (const char * text, int barva) { + return obarvi(string(text), barva); +}