Low overhead C++ progress bar with a friendly interface
The pbar
library is very easy to use,
with a simple constructor ProgressBar(${description}, ${total})
and you're ready to go.
Updating the bar is as easy as the construction process, update(${number})
increases/decreases the bar to whatever number you want.
there are example codes in the examples/
directory, see Install for more information.
#include "pbar.hpp"
using namespace pbar;
int main() {
ProgressBar progressbar("outer", 10);
for (int i = 0; i != 10; ++i) {
progressbar.update();
}
}
#include "pbar.hpp"
using namespace pbar;
constexpr int test_size1 = 10;
constexpr int test_size2 = 10000000;
int main() {
ProgressBar progressbar1("outer", test_size1, true);
for (int i = 0; i != test_size1; ++i) {
ProgressBar progressbar2("inner", test_size2, true);
for (int j = 0; j != test_size2; ++j) {
progressbar2.update();
}
progressbar1.update();
}
}
CMake is the official build system.
- C++11 or higher
- Ansi-Escape library for terminal render control
- CMake 3.5 or higher
mkdir build; cd build/
# Config and build
cmake .. && make driver
# execute example
./examples/driver