8 namespace EscapeCodes {
23 #ifdef CPP_UTILITIES_ESCAPE_CODES_ENABLED_BY_DEFAULT
44 stream <<
"Warning: ";
71 stream <<
"==> ERROR: ";
77 stream <<
"==> WARNING: ";
97 stream <<
" -> ERROR: ";
103 stream <<
" -> WARNING: ";
122 using namespace std::string_view_literals;
127 return "Warning: "sv;
135 return "==> ERROR: "sv;
137 return "==> WARNING: ";
141 return " -> ERROR: "sv;
143 return " -> WARNING: "sv;
150 return std::string_view{};
164 using namespace std::string_view_literals;
167 return "\e[1;31mError: \e[0m\e[1m"sv;
169 return "\e[1;33mWarning: \e[0m\e[1m"sv;
171 return " \e[0m\e[1m"sv;
173 return "\e[1;32m==> \e[0m\e[1m"sv;
175 return "\e[1;32m -> \e[0m\e[1m"sv;
177 return "\e[1;31m==> ERROR: \e[0m\e[1m"sv;
179 return "\e[1;33m==> WARNING: \e[0m\e[1m";
181 return "\e[1;34mInfo: \e[0m\e[1m"sv;
183 return "\e[1;31m -> ERROR: \e[0m\e[1m"sv;
185 return "\e[1;33m -> WARNING: \e[0m\e[1m"sv;
187 return "\e[1;37m==> \e[0m\e[1m"sv;
192 return std::string_view{};
CPP_UTILITIES_EXPORT std::string_view phraseString(Phrases phrase)
Returns a string for the specified phrase without formatting.
void eraseLine(std::ostream &stream)
CPP_UTILITIES_EXPORT bool enabled
Controls whether the functions inside the EscapeCodes namespace actually make use of escape codes.
void setStyle(std::ostream &stream, TextAttribute displayAttribute=TextAttribute::Reset)
CPP_UTILITIES_EXPORT std::string_view formattedPhraseString(Phrases phrase)
Returns a string for the specified phrase which is formatted using ANSI escape codes.
std::ostream & operator<<(std::ostream &stream, TextAttribute displayAttribute)
Phrases
The Phrases enum contains standard phrases which can be printed to any std::ostream and obtained as s...
Contains all utilities provides by the c++utilities library.