C_CPP/src/helpers/AnsiConsole.h
Johannes Theiner 5b458386ac 05_OO: in mehrere Dateien aufgeteilt
Signed-off-by: Johannes Theiner <j.theiner@live.de>
2018-10-26 13:31:39 +02:00

37 lines
641 B
C++

#ifndef C_C_ANSICONSOLE_H
#define C_C_ANSICONSOLE_H
#include <iostream>
enum class Colors {
BLACK = 30,
RED = 31,
GREEN = 32,
YELLOW = 33,
BLUE = 34,
MAGENTA = 35,
CYAN = 36,
WHITE = 37
};
class AnsiConsole {
// protected:
// can only be used by members of AnsiConsole and its
// derived classes
protected:
void hideCursor();
void showCursor();
void pushCursorPos();
void popCursorPos();
public:
AnsiConsole();
~AnsiConsole();
void clearScreen();
void printText(int x, int y, std::string text, Colors color=Colors::BLUE);
};
extern AnsiConsole ansiConsole;
#endif