From 4011040e571ebade16c734e5ed371df86073cddf Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 9 Oct 2017 20:36:18 +0200 Subject: [PATCH] Add Phrases::EndFlush --- CMakeLists.txt | 2 +- io/ansiescapecodes.cpp | 4 ++++ io/ansiescapecodes.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0fe9ff..25517f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,7 @@ set(META_APP_AUTHOR "Martchus") set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}") set(META_APP_DESCRIPTION "Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities") set(META_VERSION_MAJOR 4) -set(META_VERSION_MINOR 10) +set(META_VERSION_MINOR 11) set(META_VERSION_PATCH 0) # find required 3rd party libraries diff --git a/io/ansiescapecodes.cpp b/io/ansiescapecodes.cpp index 6d6c921..8d7e93a 100644 --- a/io/ansiescapecodes.cpp +++ b/io/ansiescapecodes.cpp @@ -53,6 +53,10 @@ std::ostream &operator<<(std::ostream &stream, Phrases phrase) setStyle(stream, TextAttribute::Reset); setStyle(stream, TextAttribute::Bold); break; + case Phrases::EndFlush: + setStyle(stream, TextAttribute::Reset); + stream << std::endl; + break; } return stream; } diff --git a/io/ansiescapecodes.h b/io/ansiescapecodes.h index 7d293fc..d5d68f0 100644 --- a/io/ansiescapecodes.h +++ b/io/ansiescapecodes.h @@ -112,6 +112,7 @@ enum class Phrases { SubMessage, /**< bold, blue " -> " */ ErrorMessage, /**< bold, red "==> ERROR: " */ WarningMessage, /**< bold, yellow "==> WARNING: " */ + EndFlush, /**< resets the style and flushes the stream */ }; CPP_UTILITIES_EXPORT std::ostream &operator<<(std::ostream &stream, Phrases phrase);