38 std::uint64_t completed_steps,
39 std::uint64_t total_steps
43 (completed_steps * 100)
44 / std::max<std::uint64_t>(total_steps, 1u)
54 [[nodiscard]]
int get() const noexcept
74 [[nodiscard]] std::string
to_string() const noexcept
Represents a value in the range [0, 100].
Definition percentage.hpp:20
percentage(int percentage=0) noexcept
Construct percentage with a given value.
Definition percentage.hpp:27
void set(int percentage) noexcept
Set the percentage value.
Definition percentage.hpp:64
percentage(std::uint64_t completed_steps, std::uint64_t total_steps) noexcept
Construct percentage from completed and total steps.
Definition percentage.hpp:37
std::string to_string() const noexcept
Convert percentage to string.
Definition percentage.hpp:74
int get() const noexcept
Definition percentage.hpp:54
int m_percentage
Definition percentage.hpp:80