Updated enums to lowercase per the core guidelines. Bumped to wip v1.7

This commit is contained in:
Pranav Srinivas Kumar
2020-02-11 17:29:41 +05:30
parent 0588904b9d
commit a6c55b6936
15 changed files with 47 additions and 47 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(indicators VERSION 1.6.0 LANGUAGES CXX DESCRIPTION "Activity Indicators for Modern C++")
project(indicators VERSION 1.7.0 LANGUAGES CXX DESCRIPTION "Activity Indicators for Modern C++")
option(INDICATORS_BUILD_TESTS OFF)
option(SAMPLES "Build Samples" OFF)
option(DEMO "Build Demo" OFF)

View File

@@ -12,7 +12,7 @@
<a href="https://github.com/p-ranav/indicators/blob/master/LICENSE">
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="license"/>
</a>
<img src="https://img.shields.io/badge/version-1.6-blue.svg?cacheSeconds=2592000" alt="version"/>
<img src="https://img.shields.io/badge/version-1.7-blue.svg?cacheSeconds=2592000" alt="version"/>
</p>
<p align="center">
@@ -71,7 +71,7 @@ int main() {
option::Remainder{" "},
option::End{"]"},
option::PostfixText{"Extracting Archive"};
option::ForegroundColor{Color::GREEN};
option::ForegroundColor{Color::green};
};
// Update bar state
@@ -115,7 +115,7 @@ int main() {
option::Remainder{"-"},
option::End{" ]"},
option::PostfixText{"Loading dependency 1/4"},
option::ForegroundColor{Color::CYAN}
option::ForegroundColor{Color::cyan}
};
// Update bar state
@@ -173,8 +173,8 @@ int main() {
option::Lead{"█"},
option::Remainder{"-"},
option::End{"]"},
option::PrefixText{"Training Gaze Network "},
option::ForegroundColor{Color::YELLOW}
option::PrefixText{"Training Gaze Network 👀"},
option::ForegroundColor{Color::yellow}
option::ShowElapsedTime{true};
option::ShowRemainingTime{true};
};
@@ -217,7 +217,7 @@ int main() {
option::BarWidth{80},
option::Start{"["},
option::End{"]"},
option::ForegroundColor{Color::WHITE}
option::ForegroundColor{Color::white}
};
// Update bar state
@@ -263,7 +263,7 @@ int main() {
option::Lead{"■"},
option::Remainder{" "},
option::End{" ]"},
option::ForegroundColor{Color::YELLOW},
option::ForegroundColor{Color::yellow},
option::ShowElapsedTime{true},
option::ShowRemainingTime{true},
option::PrefixText{"Progress Bar #1 "}
@@ -278,7 +278,7 @@ int main() {
option::Lead{">"},
option::Remainder{" "},
option::End{" ]"},
option::ForegroundColor{Color::CYAN},
option::ForegroundColor{Color::cyan},
option::ShowElapsedTime{true},
option::ShowRemainingTime{true},
option::PrefixText{"Progress Bar #2 "}
@@ -292,7 +292,7 @@ int main() {
option::Lead{"#"},
option::Remainder{" "},
option::End{" ]"},
option::ForegroundColor{Color::RED},
option::ForegroundColor{Color::red},
option::ShowElapsedTime{true},
option::ShowRemainingTime{true},
option::PrefixText{"Progress Bar #3 "}
@@ -363,7 +363,7 @@ int main() {
using namespace indicators;
indicators::ProgressSpinner spinner{
option::PostfixText{"Checking credentials"},
option::ForegroundColor{Color::YELLOW},
option::ForegroundColor{Color::yellow},
option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}
};
@@ -371,7 +371,7 @@ int main() {
auto job = [&spinner]() {
while (true) {
if (spinner.is_completed()) {
spinner.set_option(option::ForegroundColor{Color::GREEN});
spinner.set_option(option::ForegroundColor{Color::green});
spinner.set_option(option::PrefixText{"✔"});
spinner.set_option(option::ShowSpinner{false});
spinner.set_option(option::ShowPercentage{false});

View File

@@ -17,7 +17,7 @@ int main() {
option::Lead{""},
option::Remainder{" "},
option::End{" ]"},
option::ForegroundColor{indicators::Color::YELLOW}};
option::ForegroundColor{indicators::Color::yellow}};
std::atomic<size_t> index{0};
std::vector<std::string> status_text = {"Rocket.exe is not responding",
@@ -56,7 +56,7 @@ int main() {
p.set_option(option::Lead{""});
p.set_option(option::Remainder{""});
p.set_option(option::End{""});
p.set_option(option::ForegroundColor{indicators::Color::WHITE});
p.set_option(option::ForegroundColor{indicators::Color::white});
p.set_option(option::ShowPercentage{false});
auto job = [&p]() {
while (true) {
@@ -86,7 +86,7 @@ int main() {
p.set_option(option::Remainder{" "});
p.set_option(option::End{"]"});
p.set_option(option::PostfixText{"Getting started"});
p.set_option(option::ForegroundColor{indicators::Color::GREEN});
p.set_option(option::ForegroundColor{indicators::Color::green});
auto job = [&p]() {
while (true) {
auto ticks = p.current();
@@ -120,7 +120,7 @@ int main() {
p4.set_option(option::Lead{""});
p4.set_option(option::Remainder{" "});
p4.set_option(option::End{""});
p4.set_option(option::ForegroundColor{indicators::Color::CYAN});
p4.set_option(option::ForegroundColor{indicators::Color::cyan});
p4.set_option(option::PostfixText{"Restoring system state"});
p4.set_option(option::ShowPercentage{false});
std::atomic<size_t> index4{0};
@@ -131,7 +131,7 @@ int main() {
index4 += 1;
if (p4.current() + 2 >= 100) {
std::cout << std::endl;
p4.set_option(option::ForegroundColor{indicators::Color::RED});
p4.set_option(option::ForegroundColor{indicators::Color::red});
p4.set_option(option::PrefixText{"{ ERROR }"});
p4.set_option(option::Start{});
p4.set_option(option::Fill{});
@@ -162,7 +162,7 @@ int main() {
option::Lead{""},
option::Remainder{"-"},
option::End{"]"},
option::ForegroundColor{indicators::Color::WHITE},
option::ForegroundColor{indicators::Color::white},
option::PostfixText{"Reverting system restore"}
};
p.set_progress(100); // TODO backwards as an option?
@@ -191,14 +191,14 @@ int main() {
indicators::ProgressSpinner p{
option::PrefixText{""},
option::PostfixText{"Checking credentials"},
option::ForegroundColor{indicators::Color::YELLOW},
option::ForegroundColor{indicators::Color::yellow},
option::SpinnerStates{std::vector<std::string>{"", "", "", "", "", "", "", ""}}
};
auto job = [&p]() {
while (true) {
if (p.is_completed()) {
p.set_option(option::ForegroundColor{indicators::Color::GREEN});
p.set_option(option::ForegroundColor{indicators::Color::green});
p.set_option(option::PrefixText{""});
p.set_option(option::ShowSpinner{false});
p.set_option(option::ShowPercentage{false});
@@ -222,7 +222,7 @@ int main() {
indicators::ProgressSpinner p{
option::PrefixText{" - "},
option::PostfixText{"Searching for the Moon"},
option::ForegroundColor{indicators::Color::WHITE},
option::ForegroundColor{indicators::Color::white},
option::ShowPercentage{false},
option::SpinnerStates{std::vector<std::string>{"", "", "", ""}}
};
@@ -270,7 +270,7 @@ int main() {
option::Remainder{" "},
option::End{"🌑"},
option::PostfixText{"Achieved low-Earth orbit"},
option::ForegroundColor{indicators::Color::WHITE}
option::ForegroundColor{indicators::Color::white}
};
std::vector<std::string> ship_trail{"", "", "", "", "", "", "", ""};
std::atomic<int> ship_trail_index{0};

View File

@@ -60,7 +60,7 @@ class BlockProgressBar {
public:
template <typename... Args, typename std::enable_if<details::are_settings_from_tuple<Settings, typename std::decay<Args>::type...>::value, void*>::type = nullptr>
explicit BlockProgressBar(Args&&... args) : settings_(
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::WHITE}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::white}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::bar_width>(option::BarWidth{100}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::start>(option::Start{"["}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::end>(option::End{"]"}, std::forward<Args>(args)...),

View File

@@ -28,5 +28,5 @@ SOFTWARE.
#include <indicators/termcolor.hpp>
namespace indicators {
enum class Color { GREY, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };
enum class Color { grey, red, green, yellow, blue, magenta, cyan, white };
}

View File

@@ -18,28 +18,28 @@ namespace details {
inline void set_stream_color(std::ostream &os, Color color) {
switch (color) {
case Color::GREY:
case Color::grey:
os << termcolor::grey;
break;
case Color::RED:
case Color::red:
os << termcolor::red;
break;
case Color::GREEN:
case Color::green:
os << termcolor::green;
break;
case Color::YELLOW:
case Color::yellow:
os << termcolor::yellow;
break;
case Color::BLUE:
case Color::blue:
os << termcolor::blue;
break;
case Color::MAGENTA:
case Color::magenta:
os << termcolor::magenta;
break;
case Color::CYAN:
case Color::cyan:
os << termcolor::cyan;
break;
case Color::WHITE:
case Color::white:
os << termcolor::white;
break;
default:

View File

@@ -82,7 +82,7 @@ public:
details::get<details::ProgressBarOption::show_elapsed_time>(option::ShowElapsedTime{false}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::show_remaining_time>(option::ShowRemainingTime{false}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::saved_start_time>(option::SavedStartTime{false}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::WHITE}, std::forward<Args>(args)...)
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::white}, std::forward<Args>(args)...)
)
{}

View File

@@ -62,7 +62,7 @@ class ProgressSpinner {
public:
template <typename... Args, typename std::enable_if<details::are_settings_from_tuple<Settings, typename std::decay<Args>::type...>::value, void*>::type = nullptr>
explicit ProgressSpinner(Args&&... args) : settings_(
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::WHITE}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::foreground_color>(option::ForegroundColor{Color::white}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::prefix_text>(option::PrefixText{}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::postfix_text>(option::PostfixText{}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::show_percentage>(option::ShowPercentage{true}, std::forward<Args>(args)...),

View File

@@ -5,7 +5,7 @@ int main() {
using namespace indicators;
BlockProgressBar bar1{
option::BarWidth{50},
option::ForegroundColor{Color::YELLOW},
option::ForegroundColor{Color::yellow},
option::ShowElapsedTime{true},
option::ShowRemainingTime{true},
option::PrefixText{"Progress Bar #1 "}
@@ -13,7 +13,7 @@ int main() {
BlockProgressBar bar2{
option::BarWidth{50},
option::ForegroundColor{Color::CYAN},
option::ForegroundColor{Color::cyan},
option::ShowElapsedTime{true},
option::ShowRemainingTime{true},
option::PrefixText{"Progress Bar #2 "}
@@ -21,7 +21,7 @@ int main() {
BlockProgressBar bar3{
option::BarWidth{50},
option::ForegroundColor{Color::RED},
option::ForegroundColor{Color::red},
option::ShowElapsedTime{true},
option::ShowRemainingTime{true},
option::PrefixText{"Progress Bar #3 "}

View File

@@ -10,7 +10,7 @@ int main() {
indicators::option::Lead{""},
indicators::option::Remainder{" "},
indicators::option::End{" ]"},
indicators::option::ForegroundColor{indicators::Color::YELLOW},
indicators::option::ForegroundColor{indicators::Color::yellow},
indicators::option::ShowElapsedTime{true},
indicators::option::ShowRemainingTime{true},
indicators::option::PrefixText{"Progress Bar #1 "}
@@ -23,7 +23,7 @@ int main() {
indicators::option::Lead{">"},
indicators::option::Remainder{" "},
indicators::option::End{" ]"},
indicators::option::ForegroundColor{indicators::Color::CYAN},
indicators::option::ForegroundColor{indicators::Color::cyan},
indicators::option::ShowElapsedTime{true},
indicators::option::ShowRemainingTime{true},
indicators::option::PrefixText{"Progress Bar #2 "}
@@ -36,7 +36,7 @@ int main() {
indicators::option::Lead{"#"},
indicators::option::Remainder{" "},
indicators::option::End{" ]"},
indicators::option::ForegroundColor{indicators::Color::RED},
indicators::option::ForegroundColor{indicators::Color::red},
indicators::option::ShowElapsedTime{true},
indicators::option::ShowRemainingTime{true},
indicators::option::PrefixText{"Progress Bar #3 "}

View File

@@ -10,7 +10,7 @@ int main() {
indicators::option::Lead{""},
indicators::option::Remainder{"-"},
indicators::option::End{" ]"},
indicators::option::ForegroundColor{indicators::Color::YELLOW},
indicators::option::ForegroundColor{indicators::Color::yellow},
};
// As configured, the bar will look like this:

View File

@@ -15,7 +15,7 @@ int main() {
indicators::option::Remainder{"-"},
indicators::option::End{" ]"},
indicators::option::PostfixText{"Loading dependency 1/4"},
indicators::option::ForegroundColor{indicators::Color::CYAN},
indicators::option::ForegroundColor{indicators::Color::cyan},
};
// Update bar state

View File

@@ -11,7 +11,7 @@ int main() {
indicators::option::Remainder{" "},
indicators::option::End{" ]"},
indicators::option::PostfixText{"Getting started"},
indicators::option::ForegroundColor{indicators::Color::GREEN},
indicators::option::ForegroundColor{indicators::Color::green},
};
// Update bar state

View File

@@ -7,7 +7,7 @@ int main() {
indicators::ProgressSpinner spinner{
indicators::option::PostfixText{"Checking credentials"},
indicators::option::ForegroundColor{indicators::Color::YELLOW},
indicators::option::ForegroundColor{indicators::Color::yellow},
indicators::option::SpinnerStates{std::vector<std::string>{"", "", "", "", "", "", "", ""}},
};
@@ -15,7 +15,7 @@ int main() {
auto job = [&spinner]() {
while (true) {
if (spinner.is_completed()) {
spinner.set_option(indicators::option::ForegroundColor{indicators::Color::GREEN});
spinner.set_option(indicators::option::ForegroundColor{indicators::Color::green});
spinner.set_option(indicators::option::PrefixText{""});
spinner.set_option(indicators::option::ShowSpinner{false});
spinner.set_option(indicators::option::ShowPercentage{false});

View File

@@ -10,8 +10,8 @@ int main() {
indicators::option::Lead{""},
indicators::option::Remainder{"-"},
indicators::option::End{"]"},
indicators::option::PostfixText{"Training Gaze Network "},
indicators::option::ForegroundColor{indicators::Color::YELLOW},
indicators::option::PrefixText{"Training Gaze Network 👀"},
indicators::option::ForegroundColor{indicators::Color::yellow},
indicators::option::ShowElapsedTime{true},
indicators::option::ShowRemainingTime{true},
};