#include <unistd.h>
void DoSomething() {usleep(1e3);}
int main()
{
for (int i = 0; i < 1e3; i++)
{
pBar1.
Print(
static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
std::cout << " Progress bar with default constructor finished" << std::endl;
for (int i = 0; i < 1e3; i++)
{
pBar2.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
pBar2.Finish();
std::cout << " Progress bar with constructor that specified style finished" << std::endl;
for (int i = 0; i < 1e3; i++)
{
pBar3.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
pBar3.Finish();
std::cout << " Progress bar with constructor that specified style and text finished" << std::endl;
for (int i = 0; i < 1e3; i++)
{
pBar4.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
pBar4.Finish();
std::cout << " Progress bar with constructor that specified style, text, and color finished" << std::endl;
for (int i = 0; i < 1e3; i++)
{
pBar5.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
pBar5.Finish();
std::cout << " Progress bar with constructor for custom bar finished" << std::endl;
}
Contains declaration of class ProgressBar.
Class ProgressBar can be used used to print the progress in an ascii horizontal bar....
Definition PBar.hpp:34
void Print(const double progress)
Prints bar.
Definition PBar.cpp:115
void Finish()
Finishes the bar and clears it.
Definition PBar.cpp:127
const std::string GREEN
green text
Definition PBarColor.hpp:24
const std::string BOLD_MAGENTA
bold magenta text
Definition PBarColor.hpp:47