33 progress_bars_.set_option(indicators::option::HideBarWhenComplete{
false});
37 const std::string &name,
size_t max, indicators::Color color)
39 auto postfix_text = max > 0 ? fmt::format(
"{}/{}", 0, max) : std::string{};
41 const auto kBarWidth = 35U;
42 const auto kPrefixTextWidth = 25U;
44 auto bar = std::make_shared<indicators::ProgressBar>(
45 indicators::option::Stream{
ostream_},
46 indicators::option::BarWidth{kBarWidth},
47 indicators::option::ForegroundColor{color},
48 indicators::option::ShowElapsedTime{
true},
50 indicators::option::Fill{
"="}, indicators::option::Lead{
">"},
52 indicators::option::Fill{
"█"}, indicators::option::Lead{
"█"},
54 indicators::option::Remainder{
"-"},
55 indicators::option::PrefixText{
57 indicators::option::PostfixText{postfix_text});
63 auto bar_index =
bars_.size() - 1;
71 const auto kASTTraverseProgressPercent = 95U;
85 bar.set_progress((p.progress * kASTTraverseProgressPercent) / p.max);
86 bar.set_option(indicators::option::PostfixText{
87 fmt::format(
"{}/{}", p.progress, p.max)});
105 const auto kCompleteProgressPercent = 100U;
119 bar.set_progress(kCompleteProgressPercent);
122 const auto postfix_text = fmt::format(
"{}/{} OK", p.progress, p.max);
124 const auto postfix_text = fmt::format(
"{}/{} ✔", p.progress, p.max);
126 bar.set_option(indicators::option::PostfixText{postfix_text});
128 indicators::option::ForegroundColor{indicators::Color::green});
129 bar.mark_as_completed();
147 const auto postfix_text = fmt::format(
"{}/{} FAILED", p.progress, p.max);
149 const auto postfix_text = fmt::format(
"{}/{} ✗", p.progress, p.max);
151 bar.set_option(indicators::option::ForegroundColor{indicators::Color::red});
152 bar.set_option(indicators::option::PostfixText{postfix_text});
153 bar.mark_as_completed();