Example that shows different ways to use ProgressBar
#include <unistd.h>
void DoSomething() {usleep(1e3);}
int main()
{
std::cout << "Default constuctor" << std::endl;
for (int i = 0; i < 1e3; i++)
{
pbar1.
Print(
static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
std::cout << "Use predefined style" << std::endl;
for (int i = 0; i < 1e3; i++)
{
pbar2.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
for (int i = 0; i < 1e3; i++)
{
pbar3.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
for (int i = 0; i < 1e3; i++)
{
pbar4.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
for (int i = 0; i < 1e3; i++)
{
pbar5.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
}
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
const std::string GREEN
green text
Definition PBarColor.hpp:25
const std::string BOLD_MAGENTA
bold magenta text
Definition PBarColor.hpp:48