Simple progress bar for console output. More...
#include <global.h>
Public Member Functions | |
ProgressBar (size_t total, int width=50, bool enable=true, const std::string &progress_message="Progress") | |
Constructor for ProgressBar. | |
void | update () |
Update progress bar by one step. | |
void | update (size_t step_number) |
Update progress bar to a specific step. | |
void | finish () |
Finish the progress bar and ensure it shows 100%. | |
void | setEnabled (bool enable) |
Enable or disable the progress bar. | |
bool | isEnabled () const |
Check if progress bar is enabled. | |
void | disableMessages () |
Disable all progress bar output. | |
helios::ProgressBar::ProgressBar | ( | size_t | total, |
int | width = 50 , |
||
bool | enable = true , |
||
const std::string & | progress_message = "Progress" |
||
) |
Constructor for ProgressBar.
[in] | total | Total number of steps expected |
[in] | width | Width of the progress bar in characters (default: 50) |
[in] | enable | Whether to enable progress bar display (default: true) |
[in] | progress_message | Custom message to display (default: "Progress") |
Definition at line 390 of file global.cpp.
void helios::ProgressBar::finish | ( | ) |
Finish the progress bar and ensure it shows 100%.
Definition at line 447 of file global.cpp.
bool helios::ProgressBar::isEnabled | ( | ) | const |
Check if progress bar is enabled.
Definition at line 458 of file global.cpp.
void helios::ProgressBar::setEnabled | ( | bool | enable | ) |
Enable or disable the progress bar.
[in] | enable | True to enable, false to disable |
Definition at line 454 of file global.cpp.
void helios::ProgressBar::update | ( | ) |
Update progress bar by one step.
Definition at line 393 of file global.cpp.
void helios::ProgressBar::update | ( | size_t | step_number | ) |
Update progress bar to a specific step.
[in] | step_number | Current step number (0-based) |
Definition at line 418 of file global.cpp.