A simple CLI progress bar. More...
A simple CLI progress bar.
Definition in file progress_bar.h.
Go to the source code of this file.
Data Structures | |
struct | progress_bar_t |
Progress bar descriptor. More... | |
#define | PROGRESS_BAR_LENGTH (25U) |
Progress bar maximum characters length. | |
#define | PROGRESS_BAR_FULL_CHARACTER "█" |
Progress bar character. | |
#define | PROGRESS_BAR_EMPTY_CHARACTER " " |
Progress bar empty character. | |
#define | PROGRESS_BAR_PREFIX_CHARACTER "|" |
Character displayed on the left of the progress bar. | |
#define | PROGRESS_BAR_SUFFIX_CHARACTER "|" |
Character displayed on the left of the progress bar. | |
#define | PROGRESS_BAR_PREFIX_MAX_LENGTH (32U) |
Progress bar prefix max length. | |
#define | PROGRESS_BAR_SUFFIX_MAX_LENGTH (32U) |
Progress bar suffix max length. | |
void | progress_bar_print (char *prefix, char *suffix, uint8_t value) |
Print a progress bar in the terminal. More... | |
void | progress_bar_update (progress_bar_t *progress_bar) |
Update the progress bar display in the terminal. More... | |
void | progress_bar_prepare_multi (uint8_t len) |
Prepare the output for displaying multiple progress bars. More... | |
void | progress_bar_update_multi (progress_bar_t *progress_bar_list, uint8_t len) |
Update all progress bar displays of the given progress bars list. More... | |
void progress_bar_prepare_multi | ( | uint8_t | len | ) |
Prepare the output for displaying multiple progress bars.
This function is just adding enough empty lines to give enough space to print the list of progress bars.
This function must be called only once and before starting the progress bar list updates with.
[in] | len | The length of the progress bar array |
void progress_bar_print | ( | char * | prefix, |
char * | suffix, | ||
uint8_t | value | ||
) |
Print a progress bar in the terminal.
[in] | prefix | String displayed on the left of the progress bar |
[in] | suffix | String displayed on the right of the progress bar |
[in] | value | Value of the progress bar |
void progress_bar_update | ( | progress_bar_t * | progress_bar | ) |
Update the progress bar display in the terminal.
[in] | progress_bar | Pointer to the progress bar descriptor |
void progress_bar_update_multi | ( | progress_bar_t * | progress_bar_list, |
uint8_t | len | ||
) |
Update all progress bar displays of the given progress bars list.
[in] | progress_bar_list | An array of progress bars |
[in] | len | The length of the progress bar array |