Added dynamic postfix text sample based on #56

This commit is contained in:
Pranav Srinivas Kumar
2020-05-25 09:14:23 -05:00
parent 63bb0d8946
commit 7c1d7d6367
5 changed files with 66 additions and 0 deletions

View File

@@ -8,8 +8,10 @@
#include <atomic>
#include <chrono>
#include <indicators/setting.hpp>
#include <indicators/terminal_size.hpp>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <mutex>
#include <string>
#include <thread>
@@ -160,6 +162,12 @@ private:
}
}
size_t get_prefix_length() {
std::stringstream os;
os << get_value<details::ProgressBarOption::prefix_text>();
return os.str().size();
}
public:
void print_progress(bool from_multi_progress = false) {
std::lock_guard<std::mutex> lock{mutex_};

View File

@@ -9,6 +9,7 @@
#include <cmath>
#include <indicators/color.hpp>
#include <indicators/setting.hpp>
#include <indicators/terminal_size.hpp>
#include <iomanip>
#include <iostream>
#include <sstream>