2016-03-08 22:39:21 +00:00
|
|
|
// #include "term.h"
|
2016-03-06 21:51:07 +00:00
|
|
|
|
|
|
|
/* [1] Operations terminal
|
|
|
|
=========================================================*/
|
|
|
|
void clear(){ // efface l'ecran
|
|
|
|
cout << "\033[H\033[2J";
|
|
|
|
}
|
|
|
|
|
|
|
|
void setfont(const TERM_COLOR c, const TERM_STYLE s){
|
|
|
|
cout << "\033[" << s << ";" << c << "m";
|
2016-03-09 13:23:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void err(string msg){
|
|
|
|
// On affiche le WARNING
|
|
|
|
setfont(RED, BOLD);
|
|
|
|
cout << "/!\\ ";
|
|
|
|
|
|
|
|
// On affiche le message d'erreur
|
|
|
|
setfont(RED);
|
|
|
|
cout << msg << endl;
|
|
|
|
|
|
|
|
// On attends l'appui sur une touche
|
|
|
|
setfont();
|
|
|
|
sleep(1);
|
2016-03-06 21:51:07 +00:00
|
|
|
}
|