1.3.49
 
Loading...
Searching...
No Matches
helios::ProgressBar Class Reference

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.
 

Detailed Description

Simple progress bar for console output.

Definition at line 781 of file global.h.

Constructor & Destructor Documentation

◆ ProgressBar()

helios::ProgressBar::ProgressBar ( size_t  total,
int  width = 50,
bool  enable = true,
const std::string &  progress_message = "Progress" 
)

Constructor for ProgressBar.

Parameters
[in]totalTotal number of steps expected
[in]widthWidth of the progress bar in characters (default: 50)
[in]enableWhether to enable progress bar display (default: true)
[in]progress_messageCustom message to display (default: "Progress")

Definition at line 390 of file global.cpp.

Member Function Documentation

◆ finish()

void helios::ProgressBar::finish ( )

Finish the progress bar and ensure it shows 100%.

Definition at line 447 of file global.cpp.

◆ isEnabled()

bool helios::ProgressBar::isEnabled ( ) const

Check if progress bar is enabled.

Returns
True if enabled, false otherwise

Definition at line 458 of file global.cpp.

◆ setEnabled()

void helios::ProgressBar::setEnabled ( bool  enable)

Enable or disable the progress bar.

Parameters
[in]enableTrue to enable, false to disable

Definition at line 454 of file global.cpp.

◆ update() [1/2]

void helios::ProgressBar::update ( )

Update progress bar by one step.

Definition at line 393 of file global.cpp.

◆ update() [2/2]

void helios::ProgressBar::update ( size_t  step_number)

Update progress bar to a specific step.

Parameters
[in]step_numberCurrent step number (0-based)

Definition at line 418 of file global.cpp.


The documentation for this class was generated from the following files: