16 using namespace indicators;
20 constexpr size_t kReservedColumns = 9;
25 if (prefix.size() + kReservedColumns >= kMaxWidth) {
26 throw std::invalid_argument(
27 "ProgressBar prefix is too long: prefix.size()=" + std::to_string(prefix.size()) +
28 " leaves no room within kMaxWidth=" + std::to_string(kMaxWidth));
30 bar_.set_option(option::BarWidth(kMaxWidth - prefix.size() - kReservedColumns));
31 bar_.set_option(option::MaxProgress(numOperations));
32 bar_.set_option(option::Start{
"["});
33 bar_.set_option(option::Fill{
"="});
34 bar_.set_option(option::Lead{
">"});
35 bar_.set_option(option::Remainder{
" "});
36 bar_.set_option(option::End{
"]"});
37 bar_.set_option(option::PrefixText{prefix});
38 bar_.set_option(option::ShowPercentage{
true});
39 bar_.set_option(option::FontStyles{std::vector<FontStyle>{FontStyle::bold}});