121 std::uint64_t completed_steps,
122 std::uint64_t total_steps
126 (completed_steps * 100)
127 / std::max<std::uint64_t>(total_steps, 1u)
146 [[nodiscard]]
int Get() const noexcept
166 void Set(
int percentage)
noexcept
183 [[nodiscard]] std::string
ToString() const noexcept
Percentage(std::uint64_t completed_steps, std::uint64_t total_steps) noexcept
Construct Percentage from completed and total steps.
Definition percentage.hpp:120
int m_percentage
Definition percentage.hpp:189
Percentage(int percentage=0) noexcept
Construct Percentage with a direct value.
Definition percentage.hpp:99
std::string ToString() const noexcept
Convert percentage to a human-readable string.
Definition percentage.hpp:183
int Get() const noexcept
Get the percentage value.
Definition percentage.hpp:146
void Set(int percentage) noexcept
Set a new percentage value.
Definition percentage.hpp:166
Utility components for the libmagicxx library.
Definition percentage.hpp:39
Root namespace for the libmagicxx library.