mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-14 03:08:52 +08:00
Clang format
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
find ./include ./samples/ -type f \( -iname \*.cpp -o -iname \*.hpp \) | xargs clang-format -style="{ColumnLimit : 100}" -i
|
find ./include ./demo/ -type f \( -iname \*.cpp -o -iname \*.hpp \) | xargs clang-format -style="{ColumnLimit : 100}" -i
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ int main() {
|
|||||||
p.hide_percentage();
|
p.hide_percentage();
|
||||||
auto job = [&p]() {
|
auto job = [&p]() {
|
||||||
while (true) {
|
while (true) {
|
||||||
p.set_prefix_text("Reading package list... " +
|
p.set_prefix_text("Reading package list... " + std::to_string(p.current()) + "% ");
|
||||||
std::to_string(p.current()) + "% ");
|
|
||||||
if (p.current() + 2 >= 100)
|
if (p.current() + 2 >= 100)
|
||||||
p.set_prefix_text("Reading package list... Done");
|
p.set_prefix_text("Reading package list... Done");
|
||||||
p.tick();
|
p.tick();
|
||||||
@@ -108,15 +107,13 @@ int main() {
|
|||||||
};
|
};
|
||||||
std::thread thread(job);
|
std::thread thread(job);
|
||||||
thread.join();
|
thread.join();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// PROGRESS BAR 4
|
// PROGRESS BAR 4
|
||||||
//
|
//
|
||||||
std::vector<std::string> lead_spinner{"⠋", "⠙", "⠹", "⠸", "⠼",
|
std::vector<std::string> lead_spinner{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"};
|
||||||
"⠴", "⠦", "⠧", "⠇", "⠏"};
|
|
||||||
indica::ProgressBar p4;
|
indica::ProgressBar p4;
|
||||||
p4.set_bar_width(40);
|
p4.set_bar_width(40);
|
||||||
p4.start_bar_with("");
|
p4.start_bar_with("");
|
||||||
@@ -186,7 +183,6 @@ int main() {
|
|||||||
std::thread thread(job);
|
std::thread thread(job);
|
||||||
thread.join();
|
thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ SOFTWARE.
|
|||||||
#include <indica/termcolor.hpp>
|
#include <indica/termcolor.hpp>
|
||||||
|
|
||||||
namespace indica {
|
namespace indica {
|
||||||
enum class Color { GREY, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };
|
enum class Color { GREY, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,4 +187,4 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace indica
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
_print_progress();
|
_print_progress();
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_spinner_states(const std::vector<std::string>& states) {
|
void set_spinner_states(const std::vector<std::string> &states) {
|
||||||
std::unique_lock<std::mutex> lock{_mutex};
|
std::unique_lock<std::mutex> lock{_mutex};
|
||||||
_states = states;
|
_states = states;
|
||||||
}
|
}
|
||||||
@@ -156,4 +156,4 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace indica
|
||||||
|
|||||||
Reference in New Issue
Block a user