mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-16 04:18:51 +08:00
Clang format
This commit is contained in:
@@ -11,20 +11,15 @@ int main() {
|
||||
// Random list of numbers
|
||||
std::vector<size_t> numbers;
|
||||
for (size_t i = 0; i < 1259438; ++i) {
|
||||
numbers.push_back(i);
|
||||
numbers.push_back(i);
|
||||
}
|
||||
|
||||
using namespace indicators;
|
||||
BlockProgressBar bar{
|
||||
option::BarWidth{80},
|
||||
option::ForegroundColor{Color::white},
|
||||
option::FontStyles{
|
||||
std::vector<FontStyle>{FontStyle::bold}},
|
||||
option::MaxProgress{numbers.size()}
|
||||
};
|
||||
BlockProgressBar bar{option::BarWidth{80}, option::ForegroundColor{Color::white},
|
||||
option::FontStyles{std::vector<FontStyle>{FontStyle::bold}},
|
||||
option::MaxProgress{numbers.size()}};
|
||||
|
||||
std::cout << "Iterating over a list of numbers (size = "
|
||||
<< numbers.size() << ")\n";
|
||||
std::cout << "Iterating over a list of numbers (size = " << numbers.size() << ")\n";
|
||||
|
||||
std::vector<size_t> result;
|
||||
for (size_t i = 0; i < numbers.size(); ++i) {
|
||||
@@ -33,9 +28,7 @@ int main() {
|
||||
result.push_back(numbers[i] * numbers[i]);
|
||||
|
||||
// Show iteration as postfix text
|
||||
bar.set_option(option::PostfixText{
|
||||
std::to_string(i) + "/" + std::to_string(numbers.size())
|
||||
});
|
||||
bar.set_option(option::PostfixText{std::to_string(i) + "/" + std::to_string(numbers.size())});
|
||||
|
||||
// update progress bar
|
||||
bar.tick();
|
||||
|
||||
Reference in New Issue
Block a user