#include <progress_bar.h>
Definition at line 40 of file progress_bar.h.
| bsfm::util::ProgressBar::ProgressBar |
( |
const std::string & |
message, |
|
|
double |
max |
|
) |
| |
| bsfm::util::ProgressBar::~ProgressBar |
( |
| ) |
|
| double bsfm::util::ProgressBar::ElapsedToRemaining |
( |
double |
elapsed | ) |
const |
|
private |
| std::string bsfm::util::ProgressBar::FormatRemaining |
( |
double |
elapsed | ) |
const |
|
private |
Definition at line 85 of file progress_bar.cpp.
87 int hours =
static_cast<int>(elapsed) / 3600;
88 int minutes = (
static_cast<int>(elapsed) - 3600 * hours) / 60;
89 int seconds =
static_cast<int>(elapsed) % 60;
92 ss << std::setfill(
'0') << std::setw(2) << hours <<
"h:";
93 ss << std::setfill(
'0') << std::setw(2) << minutes <<
"m:";
94 ss << std::setfill(
'0') << std::setw(2) << seconds <<
"s";
| double bsfm::util::ProgressBar::GetMax |
( |
| ) |
const |
| double bsfm::util::ProgressBar::GetPercentage |
( |
| ) |
const |
| double bsfm::util::ProgressBar::GetProgress |
( |
| ) |
const |
| double bsfm::util::ProgressBar::GetRemainingSeconds |
( |
| ) |
|
Definition at line 74 of file progress_bar.cpp.
double ElapsedToRemaining(double elapsed) const
| std::string bsfm::util::ProgressBar::PrintProgress |
( |
double |
elapsed | ) |
|
|
private |
Definition at line 110 of file progress_bar.cpp.
114 std::stringstream ss;
117 <<
"%%), remaining: " << remaining_string <<
".";
122 printf(
"%s", std::string(num_backspaces,
'\b').c_str());
124 printf(
"%s", progress_bar.c_str());
125 printf(
"%s", ss.str().c_str());
127 last_message_length_ = ss.str().length();
std::string ProgressBarString() const
size_t last_message_length_
static const size_t bar_length_
double GetPercentage() const
std::string FormatRemaining(double elapsed) const
double ElapsedToRemaining(double elapsed) const
| std::string bsfm::util::ProgressBar::ProgressBarString |
( |
| ) |
const |
|
private |
Definition at line 99 of file progress_bar.cpp.
100 std::stringstream progress_bar;
102 progress_bar <<
"[" << equals <<
">";
104 std::string remainder(
bar_length_ - 3 - equals.length(),
' ');
105 progress_bar << remainder <<
"]";
107 return progress_bar.str();
static const size_t bar_length_
| void bsfm::util::ProgressBar::Reset |
( |
double |
max | ) |
|
| std::string bsfm::util::ProgressBar::Update |
( |
double |
progress | ) |
|
| const size_t bsfm::util::ProgressBar::bar_length_ = 40 |
|
staticprivate |
| size_t bsfm::util::ProgressBar::last_message_length_ |
|
private |
| double bsfm::util::ProgressBar::max_ |
|
private |
| std::string bsfm::util::ProgressBar::message_ |
|
private |
| double bsfm::util::ProgressBar::progress_ |
|
private |
| Timer bsfm::util::ProgressBar::timer_ |
|
private |
The documentation for this class was generated from the following files: