ClearLine PICoutManipulator
git-svn-id: svn://db.shs.com.ru/pip@66 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -138,6 +138,27 @@ PICout PICout::operator <<(const PICoutAction v) {
|
||||
SetConsoleCursorInfo(__Private__::hOut, &curinfo);
|
||||
#else
|
||||
printf("\e[?25l");
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case PICoutManipulators::ClearLine:
|
||||
if (!PICout::buffer_) {
|
||||
#ifdef WINDOWS
|
||||
GetConsoleScreenBufferInfo(__Private__::hOut, &sbi);
|
||||
coord = sbi.dwCursorPosition;
|
||||
int dx = coord.X;
|
||||
coord.X = 0;
|
||||
SetConsoleCursorPosition(__Private__::hOut, coord);
|
||||
if (dx > 0) {
|
||||
char * line = new char[dx + 1];
|
||||
memset(line, ' ', dx);
|
||||
line[dx] = 0;
|
||||
printf("%s", line);
|
||||
delete line;
|
||||
}
|
||||
SetConsoleCursorPosition(__Private__::hOut, coord);
|
||||
#else
|
||||
printf("\e[0G\e[K");
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user