2020-04-30 21:37:06 -05:00
|
|
|
#include <chrono>
|
|
|
|
|
#include <indicators/block_progress_bar.hpp>
|
|
|
|
|
#include <indicators/cursor_control.hpp>
|
|
|
|
|
#include <thread>
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
|
|
|
|
|
// Hide cursor
|
|
|
|
|
indicators::show_console_cursor(false);
|
|
|
|
|
|
|
|
|
|
indicators::BlockProgressBar bar{
|
2020-05-24 22:56:57 -05:00
|
|
|
indicators::option::BarWidth{80},
|
|
|
|
|
indicators::option::FontStyles{
|
2020-04-30 21:37:06 -05:00
|
|
|
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}},
|
2020-05-24 22:56:57 -05:00
|
|
|
indicators::option::MaxProgress{400}};
|
2020-04-30 21:37:06 -05:00
|
|
|
|
|
|
|
|
// Update bar state
|
|
|
|
|
while (true) {
|
|
|
|
|
bar.tick();
|
|
|
|
|
if (bar.is_completed())
|
|
|
|
|
break;
|
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Show cursor
|
|
|
|
|
indicators::show_console_cursor(true);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|