Add Phrases::SubError and Phrases::SubWarning

This commit is contained in:
Martchus 2018-11-11 22:34:38 +01:00
parent 82816d7653
commit ec39e2f5d2
3 changed files with 16 additions and 2 deletions

View File

@ -136,7 +136,7 @@ set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
set(META_APP_DESCRIPTION "Useful C++ classes and routines such as argument parser, IO and conversion utilities")
set(META_FEATURES_FOR_COMPILER_DETECTION_HEADER cxx_thread_local)
set(META_VERSION_MAJOR 4)
set(META_VERSION_MINOR 16)
set(META_VERSION_MINOR 17)
set(META_VERSION_PATCH 0)
# find required 3rd party libraries

View File

@ -90,6 +90,18 @@ std::ostream &operator<<(std::ostream &stream, Phrases phrase)
eraseLine(stream);
stream << '\r';
break;
case Phrases::SubError:
setStyle(stream, Color::Red, ColorContext::Foreground, TextAttribute::Bold);
stream << " -> ERROR: ";
setStyle(stream, TextAttribute::Reset);
setStyle(stream, TextAttribute::Bold);
break;
case Phrases::SubWarning:
setStyle(stream, Color::Yellow, ColorContext::Foreground, TextAttribute::Bold);
stream << " -> WARNING: ";
setStyle(stream, TextAttribute::Reset);
setStyle(stream, TextAttribute::Bold);
break;
}
return stream;
}

View File

@ -138,12 +138,14 @@ enum class Phrases {
End, /**< resets the style */
PlainMessage, /**< bold, 4 spaces " " */
SuccessMessage, /**< bold, green "==> " */
SubMessage, /**< bold, blue " -> " */
SubMessage, /**< bold, green " -> " */
ErrorMessage, /**< bold, red "==> ERROR: " */
WarningMessage, /**< bold, yellow "==> WARNING: " */
EndFlush, /**< resets the style and flushes the stream */
Info, /**< bold, blue "Info: " */
Override, /**< erases the current line */
SubError, /**< bold, red " -> ERROR: " */
SubWarning, /**< bold, yellow " -> WARNING: " */
};
CPP_UTILITIES_EXPORT std::ostream &operator<<(std::ostream &stream, Phrases phrase);