prakhar1989 / Progress Cpp
Licence: mit
A flexible ASCII progress-bar for C++
Stars: ✭ 81
Labels
Projects that are alternatives of or similar to Progress Cpp
Nitroshare Desktop
Network file transfer application for Windows, OS X, & Linux
Stars: ✭ 1,150 (+1319.75%)
Mutual labels: cmake
Didi challenge ros
Roslaunch to visualize a rosbag file from Udacity (DiDi Challenge)
Stars: ✭ 69 (-14.81%)
Mutual labels: cmake
Openssl Cmake
Build OpenSSL with CMake on MacOS, Win32, Win64 and cross compile for Android, IOS
Stars: ✭ 76 (-6.17%)
Mutual labels: cmake
Gr Elster
A GNU Radio block that decodes packets transmitted by Elster R2S smart meters
Stars: ✭ 78 (-3.7%)
Mutual labels: cmake
Findtbb
CMake find module for Intel Threading Building Blocks
Stars: ✭ 77 (-4.94%)
Mutual labels: cmake
Magnum Bootstrap
Bootstrap projects for Magnum C++11/C++14 graphics engine
Stars: ✭ 69 (-14.81%)
Mutual labels: cmake
Tristeon3d
A 3D Engine built by two Game Engineering students.
Stars: ✭ 68 (-16.05%)
Mutual labels: cmake
Llvm Amdgpu Assembler Extra
LLVM AMDGPU Assembler Helper Tools
Stars: ✭ 80 (-1.23%)
Mutual labels: cmake
Helloworld
A C++ Hello World project, using CMake, and GitHub Actions
Stars: ✭ 77 (-4.94%)
Mutual labels: cmake
Progress-CPP
A flexible ASCII progress bar for your console based C++ projects.
Usage
Progress is a header-only library and can be used by simply including the ProgressBar.hpp
header file.
The bar takes the following options at initialization
- Limit: the total number of ticks that need to be completed
- Width: width of the bar
- Complete Char: the character to indicate completion (defaults to
=
) - Incomplete Char: the character to indicate pending. (defaults to ' ')
#include "ProgressBar.hpp"
int main() {
const int limit = 10000;
// initialize the bar
ProgressBar progressBar(limit, 70);
for (int i = 0; i < limit; i++) {
// record the tick
++progressBar;
// display the bar
progressBar.display();
}
// tell the bar to finish
progressBar.done();
}
The above code results in the following output
[===================> ] 29% 0.821s
Example
Refer to example.cpp file for an example usage. To run it,
$ mkdir build && cd build
$ cmake ..
$ make
$ ./ProgressBar
Or without cmake
$ g++ -O3 -I. main.cpp -Wall -std=c++11 -o ProgressBar
$ ./ProgressBar
CMake configuration
Cmake and project layout is inspired by github.com/TheLartians/ModernCppStarter.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].