34 #ifndef NEKTAR_LIBUTILITIES_PROGRESSBAR_HPP
35 #define NEKTAR_LIBUTILITIES_PROGRESSBAR_HPP
45 #define ISTTY _isatty(_fileno(stdout))
48 #define ISTTY isatty(fileno(stdout))
53 namespace LibUtilities
70 int lastprogress = -1)
72 std::cout.unsetf ( std::ios::floatfield );
75 float progress = position / float(goal);
76 int numeq = ceil(progress *49);
77 if(lastprogress == numeq)
86 cout << message <<
": ";
88 cout << setw(3) << ceil(100 * progress) <<
"% [";
89 for (
int j = 0; j < numeq; j++)
93 for (
int j = numeq; j < 49; j++)
104 if (
int(ceil(
double(100 * position / goal))) % 2 == 0)
106 cout <<
"." << flush;
115 #endif // NEKTAR_LIBUTILITIES_PROGRESSBAR_HPP
int PrintProgressbar(const int position, const int goal, const string message, int lastprogress=-1)
Prints a progressbar.