#include <ProgressCounter.hpp>
A text based progress counter.
◆ ProgressCounter() [1/2]
| ProgressCounter::ProgressCounter |
( |
| ) |
|
Initializes a progress counter with range 0 - 100.
◆ ProgressCounter() [2/2]
| ProgressCounter::ProgressCounter |
( |
size_t |
max, |
|
|
size_t |
counter = 0 |
|
) |
| |
Initializes a progress counter with a custom range.
- Parameters
-
| max | The maximum value the counter can reach. |
| counter | The initial value of the counter. |
◆ getCounter()
| size_t ProgressCounter::getCounter |
( |
| ) |
const |
- Returns
- size_t The counter's current value.
◆ getMaxElements()
| size_t ProgressCounter::getMaxElements |
( |
| ) |
const |
- Returns
- size_t The maximum value the counter can reach.
◆ getPercent()
| float ProgressCounter::getPercent |
( |
| ) |
const |
- Returns
- float The counter's current percentage.
◆ getString()
| std::string ProgressCounter::getString |
( |
| ) |
const |
- Returns
- std::string Returns the current percentage formatted as a string as it would be printed by the class.
◆ increment()
| void ProgressCounter::increment |
( |
| ) |
|
Increments the counter by one.
◆ print()
| void ProgressCounter::print |
( |
| ) |
const |
Prints the new percentage, if it has changed.
◆ reset()
| void ProgressCounter::reset |
( |
| ) |
|
Resets the counter to zero
◆ setCounter()
| void ProgressCounter::setCounter |
( |
size_t |
counter | ) |
|
Sets the counter to a new value.
- Parameters
-
| counter | The counter's new value. |
◆ setMaximum()
| void ProgressCounter::setMaximum |
( |
size_t |
maxElements | ) |
|
Sets a new maximum value for the counter.
- Parameters
-
| maxElements | The maximum value the counter can reach. |
The documentation for this class was generated from the following files: