summaryrefslogtreecommitdiff
path: root/src/core/frontend
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-24 14:23:24 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-24 14:23:24 +0100
commit7e722fdd45496e6c8dd115faa7fab265e13b2e93 (patch)
tree1f01d95eeea1a1f4f2e777529c7dd932b6c07238 /src/core/frontend
parent99c6f5df144d0530fe43225d353dee881cfdf26a (diff)
Support for italic and underline in logger (yay, toys!)
Diffstat (limited to 'src/core/frontend')
-rw-r--r--src/core/frontend/Terminal.cpp20
-rw-r--r--src/core/frontend/Terminal.hpp14
2 files changed, 31 insertions, 3 deletions
diff --git a/src/core/frontend/Terminal.cpp b/src/core/frontend/Terminal.cpp
index 447e595..5664564 100644
--- a/src/core/frontend/Terminal.cpp
+++ b/src/core/frontend/Terminal.cpp
@@ -41,9 +41,23 @@ std::string Terminal::bright() const
if (!useColor) {
return std::string{};
}
- std::stringstream ss;
- ss << "\x1b[1m";
- return ss.str();
+ return "\x1b[1m";
+}
+
+std::string Terminal::italic() const
+{
+ if (!useColor) {
+ return std::string{};
+ }
+ return "\x1b[3m";
+}
+
+std::string Terminal::underline() const
+{
+ if (!useColor) {
+ return std::string{};
+ }
+ return "\x1b[4m";
}
std::string Terminal::reset() const
diff --git a/src/core/frontend/Terminal.hpp b/src/core/frontend/Terminal.hpp
index 730853d..90a2e6f 100644
--- a/src/core/frontend/Terminal.hpp
+++ b/src/core/frontend/Terminal.hpp
@@ -112,6 +112,20 @@ public:
std::string bright() const;
/**
+ * Makes the text italic.
+ *
+ * @return a control string to be included in the output stream.
+ */
+ std::string italic() const;
+
+ /**
+ * Underlines the text.
+ *
+ * @return a control string to be included in the output stream.
+ */
+ std::string underline() const;
+
+ /**
* Returns a control string for switching to the default mode.
*
* @return a control string to be included in the output stream.