Skip to main content

ClikaRT::progress

namespace

Classes​

NameDescription
BarA lightweight handle to a bar owned by a ProgressGroup. Returned by ProgressGroup::add_bar(); copyable and non-owning (valid while its group lives). Configure it with the fluent setters, then drive it; a bar may be added, configured, and driven at ANY time, including after the group has started rendering other bars (each bar materializes on its own first drive). Driving is safe at every point in the bar's life: a completed bar accepts further set_progress/total/postfix calls.
ProgressBarA standalone determinate progress bar over an arbitrary [min, max] range.
ProgressGroupOwns and renders several bars as one block: it controls the whole region and its cursor, so parallel bars never interleave or jump. print_above emits a line above the live bars without corrupting them (raw on a terminal; routed through the default logging channel (logging::logger()) when output isn't a terminal, so a handler installed there receives it). Writes to stdout.
SpinnerAn indeterminate activity spinner for work with no measurable progress.

Enumerations​

enum Color​

enum class Color

Foreground color for a widget. Default keeps the terminal's own color.

EnumeratorDescription
Defaultthe terminal's own color
BlackANSI black.
RedANSI red.
GreenANSI green.
YellowANSI yellow.
BlueANSI blue.
MagentaANSI magenta.
CyanANSI cyan.
WhiteANSI white.
BrightBlackbright ANSI black (gray)
BrightRedbright ANSI red
BrightGreenbright ANSI green
BrightYellowbright ANSI yellow
BrightBluebright ANSI blue
BrightMagentabright ANSI magenta
BrightCyanbright ANSI cyan
BrightWhitebright ANSI white

Declared in ClikaRT/progress/progress.h, line 35

ClikaRT/progress/progress.h​

#include <ClikaRT/progress/progress.h>

ClikaRT::progress: terminal progress bars, spinners, and a single-owner multi-bar group with print-above-the-bar logging.

ProgressBar bar;
bar.total(50).prefix("Training").color(Color::Green)
.show_percent().show_eta().show_rate().unit("step");
for (int i = 1; i <= 50; ++i) bar.set_progress(i);
bar.done();

Output auto-disables when it isn't a terminal (piped / redirected), so logs stay clean. On a console that cannot show UTF-8 (a Windows console outside the UTF-8 code page, a POSIX C locale) the block glyphs give way to their ASCII forms; on Windows a live region also switches the console to VT processing and the UTF-8 code page for its lifetime and restores both after. Rendering never mutates global locale and never throws. Backed by the internal progress engine.

Configure a widget with the fluent setters BEFORE driving it (they take effect on the first draw); then drive it with set_progress() / tick() / done().