Files
openFPGALoader/src/progressBar.hpp
T

29 lines
638 B
C++
Raw Normal View History

2021-06-26 15:24:07 +02:00
// SPDX-License-Identifier: Apache-2.0
/*
* Copyright (C) 2019 Gwenhael Goavec-Merou <[email protected]>
*/
#ifndef PROGRESSBARE_HPP
#define PROGRESSBARE_HPP
#include <iostream>
2021-02-24 13:31:55 +01:00
#include <chrono>
class ProgressBar {
public:
2023-04-15 08:20:05 +02:00
ProgressBar(const std::string &mess, int maxValue, int progressLen,
bool quiet = false);
void display(int value, char force = 0);
void done();
2019-11-20 07:51:37 +01:00
void fail();
private:
std::string _mess;
int _maxValue;
int _progressLen;
2021-02-24 13:31:55 +01:00
//records the time of last progress bar update
std::chrono::time_point<std::chrono::system_clock> last_time;
bool _quiet;
bool _first;
};
#endif