libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
progress.hpp
1#pragma once
2
3#include "../core/string.hpp"
4#include "../core/timeout.hpp"
5
6namespace z {
7namespace util {
8
15class progress {
16 core::timeout timer;
17 bool displayed;
18
19public:
24 progress(unsigned int update_freq_micros = 100000) noexcept;
25
34 void set(std::ostream &stream, long item, long max, const zstring &message = "", bool force = false) noexcept;
35
44 void done(std::ostream &stream) noexcept;
45};
46
47} // namespace util
48} // namespace z
A template class for character strings.
Definition string.hpp:62
A class for easily managing timing.
Definition timeout.hpp:13
A class for outputting a progress bar to the terminal.
Definition progress.hpp:15
void done(std::ostream &stream) noexcept
Mark the progress bar as finished.
void set(std::ostream &stream, long item, long max, const zstring &message="", bool force=false) noexcept
Update the progress bar.
progress(unsigned int update_freq_micros=100000) noexcept
Constructor.